Skip to content

Commit 35b68b4

Browse files
committed
test: fix busy replication slot test
The test's intention was to spawn a reader of the replication and ensure that Materialize can successfully reclaim it by killing the appropriate server process. However, the WAL reader that we spawned also advanced the slot forward without Materialize having seen and committed that section. To avoid this we pass an extremely long fsync-interval parameter that will result in the slot being busy but not advanced. Fixes MaterializeInc/database-issues#8447 Signed-off-by: Petros Angelatos <[email protected]>
1 parent 77ac79a commit 35b68b4

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

test/pg-cdc-old-syntax/mzcompose.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ def __init__(self, replication_slot_name: str, publication_name: str) -> None:
5757
f"{replication_slot_name}",
5858
"--file",
5959
"-",
60+
# We pass the maximum allowed fsync-interval (~24 days) to prevent
61+
# this process from advancing the slot. The purpose of this reader
62+
# is to just mark the slot as busy, not to move its reserved WAL
63+
# forward.
64+
"--fsync-interval",
65+
"2147483",
6066
"--dbname",
6167
"postgres",
6268
"--host",

test/pg-cdc/mzcompose.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ def __init__(self, replication_slot_name: str, publication_name: str) -> None:
5050
f"{replication_slot_name}",
5151
"--file",
5252
"-",
53+
# We pass the maximum allowed fsync-interval (~24 days) to prevent
54+
# this process from advancing the slot. The purpose of this reader
55+
# is to just mark the slot as busy, not to move its reserved WAL
56+
# forward.
57+
"--fsync-interval",
58+
"2147483",
5359
"--dbname",
5460
"postgres",
5561
"--host",

0 commit comments

Comments
 (0)