From d96206f259d6799de066c6fa88a4b51c494f7167 Mon Sep 17 00:00:00 2001 From: Amit Kapila Date: Fri, 25 Apr 2025 12:32:00 +0530 Subject: Fix typo in test file name added in commit 4909b38af0. Author: Shlok Kyal Backpatch-through: 13 Discussion: https://postgr.es/m/CANhcyEXsObdjkjxEnq10aJumDpa5J6aiPzgTh_w4KCWRYHLw6Q@mail.gmail.com --- contrib/test_decoding/Makefile | 2 +- .../expected/invalidation_distribution.out | 20 ++++++++++++++ .../expected/invalidation_distrubution.out | 20 -------------- contrib/test_decoding/meson.build | 2 +- .../specs/invalidation_distribution.spec | 32 ++++++++++++++++++++++ .../specs/invalidation_distrubution.spec | 32 ---------------------- 6 files changed, 54 insertions(+), 54 deletions(-) create mode 100644 contrib/test_decoding/expected/invalidation_distribution.out delete mode 100644 contrib/test_decoding/expected/invalidation_distrubution.out create mode 100644 contrib/test_decoding/specs/invalidation_distribution.spec delete mode 100644 contrib/test_decoding/specs/invalidation_distrubution.spec diff --git a/contrib/test_decoding/Makefile b/contrib/test_decoding/Makefile index eef70770674..02e961f4d31 100644 --- a/contrib/test_decoding/Makefile +++ b/contrib/test_decoding/Makefile @@ -9,7 +9,7 @@ REGRESS = ddl xact rewrite toast permissions decoding_in_xact \ ISOLATION = mxact delayed_startup ondisk_startup concurrent_ddl_dml \ oldest_xmin snapshot_transfer subxact_without_top concurrent_stream \ twophase_snapshot slot_creation_error catalog_change_snapshot \ - skip_snapshot_restore invalidation_distrubution + skip_snapshot_restore invalidation_distribution REGRESS_OPTS = --temp-config $(top_srcdir)/contrib/test_decoding/logical.conf ISOLATION_OPTS = --temp-config $(top_srcdir)/contrib/test_decoding/logical.conf diff --git a/contrib/test_decoding/expected/invalidation_distribution.out b/contrib/test_decoding/expected/invalidation_distribution.out new file mode 100644 index 00000000000..ad0a944cbf3 --- /dev/null +++ b/contrib/test_decoding/expected/invalidation_distribution.out @@ -0,0 +1,20 @@ +Parsed test spec with 2 sessions + +starting permutation: s1_insert_tbl1 s1_begin s1_insert_tbl1 s2_alter_pub_add_tbl s1_commit s1_insert_tbl1 s2_get_binary_changes +step s1_insert_tbl1: INSERT INTO tbl1 (val1, val2) VALUES (1, 1); +step s1_begin: BEGIN; +step s1_insert_tbl1: INSERT INTO tbl1 (val1, val2) VALUES (1, 1); +step s2_alter_pub_add_tbl: ALTER PUBLICATION pub ADD TABLE tbl1; +step s1_commit: COMMIT; +step s1_insert_tbl1: INSERT INTO tbl1 (val1, val2) VALUES (1, 1); +step s2_get_binary_changes: SELECT count(data) FROM pg_logical_slot_get_binary_changes('isolation_slot', NULL, NULL, 'proto_version', '4', 'publication_names', 'pub') WHERE get_byte(data, 0) = 73; +count +----- + 1 +(1 row) + +?column? +-------- +stop +(1 row) + diff --git a/contrib/test_decoding/expected/invalidation_distrubution.out b/contrib/test_decoding/expected/invalidation_distrubution.out deleted file mode 100644 index ad0a944cbf3..00000000000 --- a/contrib/test_decoding/expected/invalidation_distrubution.out +++ /dev/null @@ -1,20 +0,0 @@ -Parsed test spec with 2 sessions - -starting permutation: s1_insert_tbl1 s1_begin s1_insert_tbl1 s2_alter_pub_add_tbl s1_commit s1_insert_tbl1 s2_get_binary_changes -step s1_insert_tbl1: INSERT INTO tbl1 (val1, val2) VALUES (1, 1); -step s1_begin: BEGIN; -step s1_insert_tbl1: INSERT INTO tbl1 (val1, val2) VALUES (1, 1); -step s2_alter_pub_add_tbl: ALTER PUBLICATION pub ADD TABLE tbl1; -step s1_commit: COMMIT; -step s1_insert_tbl1: INSERT INTO tbl1 (val1, val2) VALUES (1, 1); -step s2_get_binary_changes: SELECT count(data) FROM pg_logical_slot_get_binary_changes('isolation_slot', NULL, NULL, 'proto_version', '4', 'publication_names', 'pub') WHERE get_byte(data, 0) = 73; -count ------ - 1 -(1 row) - -?column? --------- -stop -(1 row) - diff --git a/contrib/test_decoding/meson.build b/contrib/test_decoding/meson.build index b31c433681d..03dd80b7f19 100644 --- a/contrib/test_decoding/meson.build +++ b/contrib/test_decoding/meson.build @@ -63,7 +63,7 @@ tests += { 'twophase_snapshot', 'slot_creation_error', 'skip_snapshot_restore', - 'invalidation_distrubution', + 'invalidation_distribution', ], 'regress_args': [ '--temp-config', files('logical.conf'), diff --git a/contrib/test_decoding/specs/invalidation_distribution.spec b/contrib/test_decoding/specs/invalidation_distribution.spec new file mode 100644 index 00000000000..decbed627e3 --- /dev/null +++ b/contrib/test_decoding/specs/invalidation_distribution.spec @@ -0,0 +1,32 @@ +# Test that catalog cache invalidation messages are distributed to ongoing +# transactions, ensuring they can access the updated catalog content after +# processing these messages. +setup +{ + SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'pgoutput'); + CREATE TABLE tbl1(val1 integer, val2 integer); + CREATE PUBLICATION pub; +} + +teardown +{ + DROP TABLE tbl1; + DROP PUBLICATION pub; + SELECT 'stop' FROM pg_drop_replication_slot('isolation_slot'); +} + +session "s1" +setup { SET synchronous_commit=on; } + +step "s1_begin" { BEGIN; } +step "s1_insert_tbl1" { INSERT INTO tbl1 (val1, val2) VALUES (1, 1); } +step "s1_commit" { COMMIT; } + +session "s2" +setup { SET synchronous_commit=on; } + +step "s2_alter_pub_add_tbl" { ALTER PUBLICATION pub ADD TABLE tbl1; } +step "s2_get_binary_changes" { SELECT count(data) FROM pg_logical_slot_get_binary_changes('isolation_slot', NULL, NULL, 'proto_version', '4', 'publication_names', 'pub') WHERE get_byte(data, 0) = 73; } + +# Expect to get one insert change. LOGICAL_REP_MSG_INSERT = 'I' +permutation "s1_insert_tbl1" "s1_begin" "s1_insert_tbl1" "s2_alter_pub_add_tbl" "s1_commit" "s1_insert_tbl1" "s2_get_binary_changes" diff --git a/contrib/test_decoding/specs/invalidation_distrubution.spec b/contrib/test_decoding/specs/invalidation_distrubution.spec deleted file mode 100644 index decbed627e3..00000000000 --- a/contrib/test_decoding/specs/invalidation_distrubution.spec +++ /dev/null @@ -1,32 +0,0 @@ -# Test that catalog cache invalidation messages are distributed to ongoing -# transactions, ensuring they can access the updated catalog content after -# processing these messages. -setup -{ - SELECT 'init' FROM pg_create_logical_replication_slot('isolation_slot', 'pgoutput'); - CREATE TABLE tbl1(val1 integer, val2 integer); - CREATE PUBLICATION pub; -} - -teardown -{ - DROP TABLE tbl1; - DROP PUBLICATION pub; - SELECT 'stop' FROM pg_drop_replication_slot('isolation_slot'); -} - -session "s1" -setup { SET synchronous_commit=on; } - -step "s1_begin" { BEGIN; } -step "s1_insert_tbl1" { INSERT INTO tbl1 (val1, val2) VALUES (1, 1); } -step "s1_commit" { COMMIT; } - -session "s2" -setup { SET synchronous_commit=on; } - -step "s2_alter_pub_add_tbl" { ALTER PUBLICATION pub ADD TABLE tbl1; } -step "s2_get_binary_changes" { SELECT count(data) FROM pg_logical_slot_get_binary_changes('isolation_slot', NULL, NULL, 'proto_version', '4', 'publication_names', 'pub') WHERE get_byte(data, 0) = 73; } - -# Expect to get one insert change. LOGICAL_REP_MSG_INSERT = 'I' -permutation "s1_insert_tbl1" "s1_begin" "s1_insert_tbl1" "s2_alter_pub_add_tbl" "s1_commit" "s1_insert_tbl1" "s2_get_binary_changes" -- cgit v1.2.3