Bump postgres version

This commit is contained in:
Konstantin Knizhnik
2024-11-11 21:46:21 +02:00
parent 26f5bafb99
commit e252a4208b
2 changed files with 53 additions and 14 deletions

View File

@@ -5,20 +5,11 @@ import time
from fixtures.neon_fixtures import NeonEnv, logical_replication_sync
def test_physical_and_logical_replication(neon_simple_env: NeonEnv, vanilla_pg):
def test_physical_and_logical_replication_slot_not_copied(neon_simple_env: NeonEnv, vanilla_pg):
"""Test read replica of a primary which has a logical replication publication"""
env = neon_simple_env
<<<<<<< HEAD
<<<<<<< HEAD
n_records = 100000
=======
n_records = 1000000
>>>>>>> 7fbb1d150 (Add test for combination of physical and logical replication)
=======
n_records = 200000
>>>>>>> 8fefd8cd6 (Update test_physical_and_logical_replicaiton.py to reproduce the problem)
primary = env.endpoints.create_start(
branch_name="main",
endpoint_id="primary",
@@ -66,3 +57,51 @@ def test_physical_and_logical_replication(neon_simple_env: NeonEnv, vanilla_pg):
# Check that LR slot is not copied to replica
s_cur.execute("select count(*) from pg_replication_slots")
assert s_cur.fetchall()[0][0] == 0
def test_aux_not_logged_at_replica(neon_simple_env: NeonEnv, vanilla_pg):
"""Test that AUX files are not saved at replica"""
env = neon_simple_env
n_records = 200000
primary = env.endpoints.create_start(
branch_name="main",
endpoint_id="primary",
)
p_con = primary.connect()
p_cur = p_con.cursor()
p_cur.execute("CREATE TABLE t(pk bigint primary key, payload text default repeat('?',200))")
p_cur.execute("create publication pub1 for table t")
# start subscriber
vanilla_pg.start()
vanilla_pg.safe_psql("CREATE TABLE t(pk bigint primary key, payload text)")
connstr = primary.connstr().replace("'", "''")
vanilla_pg.safe_psql(f"create subscription sub1 connection '{connstr}' publication pub1")
for pk in range(n_records):
p_cur.execute("insert into t (pk) values (%s)", (pk,))
# LR snapshot is stored each 15 seconds
time.sleep(16)
# start replica
secondary = env.endpoints.new_replica_start(
origin=primary,
endpoint_id="secondary",
)
s_con = secondary.connect()
s_cur = s_con.cursor()
logical_replication_sync(vanilla_pg, primary)
assert vanilla_pg.safe_psql("select count(*) from t")[0][0] == n_records
s_cur.execute("select count(*) from t")
assert s_cur.fetchall()[0][0] == n_records
primary.stop()
time.sleep(1)
secondary.stop()
assert not secondary.log_contains("cannot make new WAL entries during recovery")

View File

@@ -1,18 +1,18 @@
{
"v17": [
"17.0",
"9ad2f3c5c37c08069a01c1e3f6b7cf275437e0cb"
"37de60d9597d3dd4910d574edaf8c1fdeeef47f4"
],
"v16": [
"16.4",
"ab3d5dfcc1ca2ec2c801bc1142cb54472690c781"
"e10ba55a63d04f838ac28da25e9addb11d704992"
],
"v15": [
"15.8",
"3efb921f77d9d99923d893ec8948cc54df120cd0"
"95d5bb14c7ca806ad6f0e959662c54906ce658b4"
],
"v14": [
"14.13",
"a112778e034f71bce5bb063e34a286aa7c42aa14"
"de0a000dafc2e66ce2e39282d3aa1c704fe0390e"
]
}