Make test_replica_promote.py pass at pg17

This commit is contained in:
Konstantin Knizhnik
2025-05-18 17:31:00 +03:00
parent d7cecc485c
commit a5d45bceed
4 changed files with 4 additions and 9 deletions

View File

@@ -434,6 +434,7 @@ pub fn empty_shmem() -> crate::bindings::WalproposerShmemState {
donor_conninfo: [0; 1024],
donor_lsn: 0,
mutex: 0,
bgw_started: false,
mineLastElectedTerm: crate::bindings::pg_atomic_uint64 { value: 0 },
backpressureThrottlingTime: crate::bindings::pg_atomic_uint64 { value: 0 },
currentClusterSize: crate::bindings::pg_atomic_uint64 { value: 0 },

View File

@@ -5,14 +5,12 @@ This far, only contains a test that we don't break and that the data is persiste
"""
import psycopg2
import pytest
import time
from fixtures.neon_fixtures import Endpoint, NeonEnv, wait_replica_caughtup
from fixtures.pg_version import PgVersion
from fixtures.log_helper import log
from pytest import raises
@pytest.mark.timeout(6000)
def test_replica_promotes(neon_simple_env: NeonEnv, pg_version: PgVersion):
"""
Test that a replica safely promotes, and can commit data updates which
@@ -90,12 +88,8 @@ def test_replica_promotes(neon_simple_env: NeonEnv, pg_version: PgVersion):
new_primary_cur.execute("select count(*) from t")
assert new_primary_cur.fetchone() == (200,)
new_primary_cur.execute("select pg_current_wal_flush_lsn()")
lsn = new_primary_cur.fetchall()[0][0]
log.info(f"New primary flush LSN={lsn}")
new_primary.stop(mode="immediate")
new_primary.hot_standby = False
new_primary.start()
with new_primary.connect() as new_primary_conn:

View File

@@ -1,7 +1,7 @@
{
"v17": [
"17.5",
"8be779fd3ab9e87206da96a7e4842ef1abf04f44"
"28b88cfedf9a6028cf7ea32a80ea15a9bf971803"
],
"v16": [
"16.9",