($INBOX_DIR/description missing)help / color / mirror / Atom feed
[PATCH v5 1/3] Test for snapshot too old and wal_level=minimal 22+ messages / 2 participants [nested] [flat]
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal @ 2021-01-20 11:57 Kyotaro Horiguchi <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Kyotaro Horiguchi @ 2021-01-20 11:57 UTC (permalink / raw) --- src/test/modules/snapshot_too_old/Makefile | 12 ++++- .../expected/sto_wal_optimized.out | 24 ++++++++++ .../input_sto/sto_wal_optimized.spec | 44 +++++++++++++++++++ src/test/modules/snapshot_too_old/sto.conf | 3 ++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out create mode 100644 src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec diff --git a/src/test/modules/snapshot_too_old/Makefile b/src/test/modules/snapshot_too_old/Makefile index dfb4537f63..1e0b0b6efc 100644 --- a/src/test/modules/snapshot_too_old/Makefile +++ b/src/test/modules/snapshot_too_old/Makefile @@ -4,7 +4,7 @@ # we have to clean those result files explicitly EXTRA_CLEAN = $(pg_regress_clean_files) -ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index +ISOLATION = sto_using_cursor sto_using_select sto_using_hash_index sto_wal_optimized ISOLATION_OPTS = --temp-config $(top_srcdir)/src/test/modules/snapshot_too_old/sto.conf # Disabled because these tests require "old_snapshot_threshold" >= 0, which @@ -22,6 +22,16 @@ include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif +.PHONY: tablespace-setup specfile-setup +tablespace-setup: + rm -rf ./testtablespace + mkdir ./testtablespace + +specfile-setup: input_sto/*.spec + sed 's!@srcdir@!$(realpath $(top_srcdir))!g' $? > specs/$(notdir $?) + +check: tablespace-setup specfile-setup + # But it can nonetheless be very helpful to run tests on preexisting # installation, allow to do so, but only if requested explicitly. installcheck-force: diff --git a/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out new file mode 100644 index 0000000000..4038d0a713 --- /dev/null +++ b/src/test/modules/snapshot_too_old/expected/sto_wal_optimized.out @@ -0,0 +1,24 @@ +Parsed test spec with 3 sessions + +starting permutation: s1a1 s1a2 s2a1 s2a2 s1b1 a3-0 a3-1 s3-2 s3-3 s3-4 s2b1 +step s1a1: BEGIN; +step s1a2: DELETE FROM t; +step s2a1: BEGIN ISOLATION LEVEL REPEATABLE READ; +step s2a2: SELECT 1; +?column? + +1 +step s1b1: COMMIT; +step a3-0: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; +setting pg_sleep + +0 +step a3-1: BEGIN; +step s3-2: ALTER TABLE t SET TABLESPACE tsp1; +step s3-3: SELECT count(*) FROM t; +count + +0 +step s3-4: COMMIT; +step s2b1: SELECT count(*) FROM t; +ERROR: snapshot too old diff --git a/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec new file mode 100644 index 0000000000..02adb50581 --- /dev/null +++ b/src/test/modules/snapshot_too_old/input_sto/sto_wal_optimized.spec @@ -0,0 +1,44 @@ +# This test provokes a "snapshot too old" error +# +# The sleep is needed because with a threshold of zero a statement could error +# on changes it made. With more normal settings no external delay is needed, +# but we don't want these tests to run long enough to see that, since +# granularity is in minutes. +# +# Since results depend on the value of old_snapshot_threshold, sneak that into +# the line generated by the sleep, so that a surprising values isn't so hard +# to identify. + +setup +{ + CREATE TABLESPACE tsp1 LOCATION '@srcdir@/src/test/modules/snapshot_too_old/testtablespace'; +} + +setup +{ + CREATE TABLE t AS SELECT a FROM generate_series(0, 9) a; +} + +session "s1" +step "s1a1" { BEGIN; } +step "s1a2" { DELETE FROM t; } +step "s1b1" { COMMIT; } + +session "s2" +# s2a : take snapshot +step "s2a1" { BEGIN ISOLATION LEVEL REPEATABLE READ; } +step "s2a2" { SELECT 1; } +# s2b : wanted "snapshot too old" +step "s2b1" { SELECT count(*) FROM t; } + +session "s3" +# s3-0 : wait for snapshot is expired +step "a3-0" { SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold'; } +step "a3-1" { BEGIN; } +# s3-2 : start skipping WAL when wal_level=minimal +step "s3-2" { ALTER TABLE t SET TABLESPACE tsp1; } +# s3-3 : early pruning. w/o WAL and LSN changes when wal_level=minimal +step "s3-3" { SELECT count(*) FROM t; } +step "s3-4" { COMMIT; } + +permutation "s1a1" "s1a2" "s2a1" "s2a2" "s1b1" "a3-0" "a3-1" "s3-2" "s3-3" "s3-4" "s2b1" diff --git a/src/test/modules/snapshot_too_old/sto.conf b/src/test/modules/snapshot_too_old/sto.conf index 7eeaeeb0dc..09887fc725 100644 --- a/src/test/modules/snapshot_too_old/sto.conf +++ b/src/test/modules/snapshot_too_old/sto.conf @@ -1,2 +1,5 @@ autovacuum = off old_snapshot_threshold = 0 + +# needed when setting wal_level=minimal +wal_skip_threshold = 0 -- 2.27.0 ----Next_Part(Thu_Jan_21_00_28_44_2021_003)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="v5-0002-Do-not-use-RelationNeedsWAL-to-identify-relation-.patch" ^ permalink raw reply [nested|flat] 22+ messages in thread
* [PATCH] btree merge scan proposal @ 2026-01-30 09:32 Alexandre Felipe <[email protected]> 0 siblings, 0 replies; 22+ messages in thread From: Alexandre Felipe @ 2026-01-30 09:32 UTC (permalink / raw) To: pgsql-hackers Hello hackers, I am proposing a new access method, that combines skip index scan and K-way merge sort, query data from a limited distinct prefixes of the index that within each prefix is sorted. The attached patch adds a test case for the upcoming implementation, and gives proofs that the access method can work efficiently. It will SELECT * FROM table(with N) WHERE filter(leading_columns) ORDER BY natural order after dropping leading columns LIMIT BY M The idx_tup_read currently O(N), my proposal is to make it O(M). I am showing an example with a grid WHERE indexrelname = 'btree_merge_test_idx'; idx_scan | idx_tup_read | idx_tup_fetch ----------+--------------+--------------- - 5 | 10 | 10 + 5 | 224 | 224 (1 row) I have brought this up in 2022, at the time after reading about how demanding the review process could be I gave up on the idea. I have not worked much on database related stuff since then. But I would say that I learned a lot about the internals of postgres with Vinicius Schmidt that joined our team recently. Loosely, this is how the algorithm should work Until M live tuples are retrieved Until M tuples are retrieved: Begin Fetch index For each distinct prefix, read 1 page of index tuples Filter the index tuples Merge index tuples for the obtained pages Begin fetch heap Read the rows as required, filter out dead tuples Fetch next page of each prefix Using as baseline commit bb26a81ee28c9d9c64e6f233fafa2792768ece1b. Kind Regards, Alexandre Felipe Research & Development Engineer Phone: +353 (0) 1 9696 400 Visit: <https://info.tpro.io/; https://info.tpro.io<https://info.tpro.io/; Talk to our team: <https://info.tpro.io/; https://info.tpro.io/contact/book-a-demo [cid:1b0a8822-5677-4656-8709-4424ae24bb92] Attachments: [image/png] Outlook-q51lt0r0.png (220.9K, ../../AS1PR02MB78468B976C3198FD926CEA039A9FA@AS1PR02MB7846.eurprd02.prod.outlook.com/3-Outlook-q51lt0r0.png) download | view image [application/octet-stream] btree_merge_test.patch (7.5K, ../../AS1PR02MB78468B976C3198FD926CEA039A9FA@AS1PR02MB7846.eurprd02.prod.outlook.com/4-btree_merge_test.patch) download | inline diff: From 2869fe8fa7b1e23640bce3b7c121a53b05a68d45 Mon Sep 17 00:00:00 2001 From: Alexandre Felipe <[email protected]> Date: Fri, 30 Jan 2026 08:35:15 +0000 Subject: [PATCH] [MERGE-SCAN]: Test the baseline --- src/test/regress/expected/btree_merge.out | 113 ++++++++++++++++++++++ src/test/regress/sql/btree_merge.sql | 100 +++++++++++++++++++ 2 files changed, 213 insertions(+) create mode 100644 src/test/regress/expected/btree_merge.out create mode 100644 src/test/regress/sql/btree_merge.sql diff --git a/src/test/regress/expected/btree_merge.out b/src/test/regress/expected/btree_merge.out new file mode 100644 index 00000000000..441ae1d0657 --- /dev/null +++ b/src/test/regress/expected/btree_merge.out @@ -0,0 +1,113 @@ +-- B-Tree Merge Scan Access Method Test +-- +-- B-Tree Merge Scan is an access method that allows lazily producing +-- output sorted by a non-leading column when the prefix has few distinct values. +-- +-- +-- Let S be an infinite set of lattic points (x,y). +-- Let S(x=1,y>=b) be the sequence of points +-- SELECT * FROM S WHERE x = a and y >= b ORDER BY b; +-- i.e. (a, b), (a, b+1), (a, b+2), ... +-- Similarly, S(x IN X, y=b) being the sequence of points +-- SELECT * FROM S WHERE x IN X and y = b ORDER BY x; +-- i.e. (x[1], b), ..., (x[n], b), (x[1], b+1), ... +-- The output of S(x IN X, y >= b) can be computed as a +-- +-- Proposition (uncomputable): +-- S(x, IN X, y >= b) is the K-way merge of the sequences +-- {S(x=x[i], y >= b), x[i] in X} +-- +-- +-- +-- Proposition (computable): Bounded suffix +-- +-- S(x, IN X, b1 <= y <= b2) as bounded +-- can be computed with (SELECT count(distinct x) + count(1) FROM bounded) +-- tuple accesses. +-- (Constructive) Proof: +-- The result of +-- SELECT * FROM X +-- JOIN S on x = x[i] WHERE y BETWEEN b1 AND b2; +-- is the same as +-- SELECT * FROM X, +-- LATERAL ( +-- (SELECT * FROM S +-- WHERE x = x[i] AND y BETWEEN b1 AND b2 +-- ) AS subscan[i] +-- ) as merged +-- +-- Each of subscan[i] is covered by a single range in the index and can +-- and require at most +-- (count(1) FROM subscan[i]) + 1 -- subscan tuple access count +-- tupples to be accessed. +-- The merged result can be computed using a K-way merge sort +-- whose number of rows is +-- sum(count(1) FROM subscan[i]) -- query output rows +-- Q.E.D. +-- +-- +-- Proposition (computable): Limitted query +-- The query +-- S(x, IN X, y >= b) LIMIT N as limited +-- Can be computed with at most +-- N + count(distinct X) - 1 +-- tuple accesses. +-- +-- (Constructive) Proof: +-- If an upper `u` bound for `MAX(y IN S(x, IN X, y >= b) LIMIT N)` is known, +-- then the query can be rewritten as +-- S(x, IN X, b <= y <= u) LIMIT N +-- The K-way can produce the next element as soon as it has fetched +-- the next element for each subquery +-- 1 row can be produced after count(distinct X) fetches, +-- After that it can produce one new row for each fetch. +-- Thus, the total number of fetches is at most +-- N + count(distinct X) - 1 +-- Q.E.D. +-- Generate a table with lattice points +-- Could be infinite +CREATE TABLE btree_merge_test AS ( + SELECT x, y FROM + generate_series(1, 50) AS x, + generate_series(1, 50) AS y + ORDER BY random() +); +CREATE INDEX btree_merge_test_idx ON btree_merge_test USING btree (x, y); +ANALYSE btree_merge_test; +SET enable_seqscan = OFF; +SET enable_bitmapscan = OFF; +SHOW track_counts; -- should be 'on' + track_counts +-------------- + on +(1 row) + +-- From the limited query proposition this can be computed with 10 +-- tupple accesses. +SELECT x, y +FROM btree_merge_test +WHERE x IN (1,2,5,8,13,21,34,55) AND y >= 19 +ORDER BY y, x -- sort x to make result unique +LIMIT 3; + x | y +---+---- + 1 | 19 + 2 | 19 + 5 | 19 +(3 rows) + +SELECT pg_stat_force_next_flush(); + pg_stat_force_next_flush +-------------------------- + +(1 row) + +SELECT idx_scan, idx_tup_read, idx_tup_fetch +FROM pg_stat_user_indexes +WHERE indexrelname = 'btree_merge_test_idx'; + idx_scan | idx_tup_read | idx_tup_fetch +----------+--------------+--------------- + 5 | 10 | 10 +(1 row) + +DROP TABLE btree_merge_test; diff --git a/src/test/regress/sql/btree_merge.sql b/src/test/regress/sql/btree_merge.sql new file mode 100644 index 00000000000..be00c33c2a5 --- /dev/null +++ b/src/test/regress/sql/btree_merge.sql @@ -0,0 +1,100 @@ +-- B-Tree Merge Scan Access Method Test +-- +-- B-Tree Merge Scan is an access method that allows lazily producing +-- output sorted by a non-leading column when the prefix has few distinct values. +-- +-- +-- Let S be an infinite set of lattic points (x,y). +-- Let S(x=1,y>=b) be the sequence of points +-- SELECT * FROM S WHERE x = a and y >= b ORDER BY b; +-- i.e. (a, b), (a, b+1), (a, b+2), ... +-- Similarly, S(x IN X, y=b) being the sequence of points +-- SELECT * FROM S WHERE x IN X and y = b ORDER BY x; +-- i.e. (x[1], b), ..., (x[n], b), (x[1], b+1), ... +-- The output of S(x IN X, y >= b) can be computed as a +-- +-- Proposition (uncomputable): +-- S(x, IN X, y >= b) is the K-way merge of the sequences +-- {S(x=x[i], y >= b), x[i] in X} +-- +-- +-- +-- Proposition (computable): Bounded suffix +-- +-- S(x, IN X, b1 <= y <= b2) as bounded +-- can be computed with (SELECT count(distinct x) + count(1) FROM bounded) +-- tuple accesses. +-- (Constructive) Proof: +-- The result of +-- SELECT * FROM X +-- JOIN S on x = x[i] WHERE y BETWEEN b1 AND b2; +-- is the same as +-- SELECT * FROM X, +-- LATERAL ( +-- (SELECT * FROM S +-- WHERE x = x[i] AND y BETWEEN b1 AND b2 +-- ) AS subscan[i] +-- ) as merged +-- +-- Each of subscan[i] is covered by a single range in the index and can +-- and require at most +-- (count(1) FROM subscan[i]) + 1 -- subscan tuple access count +-- tupples to be accessed. +-- The merged result can be computed using a K-way merge sort +-- whose number of rows is +-- sum(count(1) FROM subscan[i]) -- query output rows +-- Q.E.D. +-- +-- +-- Proposition (computable): Limitted query +-- The query +-- S(x, IN X, y >= b) LIMIT N as limited +-- Can be computed with at most +-- N + count(distinct X) - 1 +-- tuple accesses. +-- +-- (Constructive) Proof: +-- If an upper `u` bound for `MAX(y IN S(x, IN X, y >= b) LIMIT N)` is known, +-- then the query can be rewritten as +-- S(x, IN X, b <= y <= u) LIMIT N +-- The K-way can produce the next element as soon as it has fetched +-- the next element for each subquery +-- 1 row can be produced after count(distinct X) fetches, +-- After that it can produce one new row for each fetch. +-- Thus, the total number of fetches is at most +-- N + count(distinct X) - 1 +-- Q.E.D. + + +-- Generate a table with lattice points +-- Could be infinite +CREATE TABLE btree_merge_test AS ( + SELECT x, y FROM + generate_series(1, 50) AS x, + generate_series(1, 50) AS y + ORDER BY random() +); +CREATE INDEX btree_merge_test_idx ON btree_merge_test USING btree (x, y); + +ANALYSE btree_merge_test; + +SET enable_seqscan = OFF; +SET enable_bitmapscan = OFF; +SHOW track_counts; -- should be 'on' +-- From the limited query proposition this can be computed with 10 +-- tupple accesses. +SELECT x, y +FROM btree_merge_test +WHERE x IN (1,2,5,8,13,21,34,55) AND y >= 19 +ORDER BY y, x -- sort x to make result unique +LIMIT 3; + + +SELECT pg_stat_force_next_flush(); + + +SELECT idx_scan, idx_tup_read, idx_tup_fetch +FROM pg_stat_user_indexes +WHERE indexrelname = 'btree_merge_test_idx'; + +DROP TABLE btree_merge_test; \ No newline at end of file -- 2.40.0 ^ permalink raw reply [nested|flat] 22+ messages in thread
end of thread, other threads:[~2026-01-30 09:32 UTC | newest] Thread overview: 22+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2021-01-20 11:57 [PATCH v5 1/3] Test for snapshot too old and wal_level=minimal Kyotaro Horiguchi <[email protected]> 2026-01-30 09:32 [PATCH] btree merge scan proposal Alexandre Felipe <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox