diff --git a/test_runner/regress/test_logical_replication.py b/test_runner/regress/test_logical_replication.py index 3a92f0d1d1..182b9859f0 100644 --- a/test_runner/regress/test_logical_replication.py +++ b/test_runner/regress/test_logical_replication.py @@ -624,3 +624,45 @@ def test_subscriber_synchronous_commit(neon_simple_env: NeonEnv, vanilla_pg: Van log.info("waiting for sync after restart") logical_replication_wait_flush_lsn_sync(vanilla_pg) assert sub.safe_psql_scalar("SELECT count(*) FROM t") == 1000 + + +def test_logical_replication_ondemand_download(neon_simple_env: NeonEnv, vanilla_pg): + env = neon_simple_env + + env.create_branch("publisher") + endpoint = env.endpoints.create("publisher", config_lines=["max_slot_wal_keep_size=1MB"]) + endpoint.start() + + pg_conn = endpoint.connect() + cur = pg_conn.cursor() + + # create table... + cur.execute( + "create table t(x integer primary key, fillter text default repeat(' ', 1000)) with (fillfactor=10)" + ) + cur.execute("create publication pub1 for table t") + + # now start subscriber + vanilla_pg.start() + vanilla_pg.safe_psql( + "create table t(x integer primary key, fillter text default repeat(' ', 1000)) with (fillfactor=10)" + ) + + connstr = endpoint.connstr().replace("'", "''") + log.info(f"ep connstr is {endpoint.connstr()}, subscriber connstr {vanilla_pg.connstr()}") + vanilla_pg.safe_psql(f"create subscription sub1 connection '{connstr}' publication pub1") + + # Stop subscriber... + vanilla_pg.stop() + + # ... and insert some data which should be delivered to subscriber after restart + cur.execute("insert into t values (generate_series(1,1000000))") # 8Gb + + # Stop subscriber... + vanilla_pg.start() + + # Check that subscribers receives all data + def check_that_changes_propagated(): + assert vanilla_pg.safe_psql("select count(*) from t")[0][0] == 1000000 + + wait_until(check_that_changes_propagated, timeout=200.0, interval=10.0) diff --git a/vendor/postgres-v14 b/vendor/postgres-v14 index 9085654ee8..ced5045624 160000 --- a/vendor/postgres-v14 +++ b/vendor/postgres-v14 @@ -1 +1 @@ -Subproject commit 9085654ee8022d5cc4ca719380a1dc53e5e3246f +Subproject commit ced5045624096851658c6de00c5b8930cfea8755 diff --git a/vendor/postgres-v15 b/vendor/postgres-v15 index 8c3249f36c..d1627bff1c 160000 --- a/vendor/postgres-v15 +++ b/vendor/postgres-v15 @@ -1 +1 @@ -Subproject commit 8c3249f36c7df6ac0efb8ee9f1baf4aa1b83e5c9 +Subproject commit d1627bff1c5f8172845406a3b85b7aa84a7760e2 diff --git a/vendor/postgres-v16 b/vendor/postgres-v16 index 7a4c0eacae..35f6d1ba51 160000 --- a/vendor/postgres-v16 +++ b/vendor/postgres-v16 @@ -1 +1 @@ -Subproject commit 7a4c0eacaeb9b97416542fa19103061c166460b1 +Subproject commit 35f6d1ba51577b03ba2affc238ba190541434f6d diff --git a/vendor/postgres-v17 b/vendor/postgres-v17 index db424d42d7..611710b6ed 160000 --- a/vendor/postgres-v17 +++ b/vendor/postgres-v17 @@ -1 +1 @@ -Subproject commit db424d42d748f8ad91ac00e28db2c7f2efa42f7f +Subproject commit 611710b6ed40269e7c09c8095c5e916c5fd19417 diff --git a/vendor/revisions.json b/vendor/revisions.json index b260698c86..12b62be1b4 100644 --- a/vendor/revisions.json +++ b/vendor/revisions.json @@ -1,18 +1,18 @@ { "v17": [ "17.5", - "db424d42d748f8ad91ac00e28db2c7f2efa42f7f" + "611710b6ed40269e7c09c8095c5e916c5fd19417" ], "v16": [ "16.9", - "7a4c0eacaeb9b97416542fa19103061c166460b1" + "35f6d1ba51577b03ba2affc238ba190541434f6d" ], "v15": [ "15.13", - "8c3249f36c7df6ac0efb8ee9f1baf4aa1b83e5c9" + "d1627bff1c5f8172845406a3b85b7aa84a7760e2" ], "v14": [ "14.18", - "9085654ee8022d5cc4ca719380a1dc53e5e3246f" + "ced5045624096851658c6de00c5b8930cfea8755" ] }