Message-ID: From: "vlsi (@vlsi)" To: "pgjdbc/pgjdbc" Date: Thu, 19 Mar 2026 10:55:33 +0000 Subject: [pgjdbc/pgjdbc] PR #3975: fix: fix flaky replication restart tests by waiting for confirmed_flush_lsn List-Id: X-GitHub-Author-Id: 213894 X-GitHub-Author-Login: vlsi X-GitHub-Issue: 3975 X-GitHub-Labels: building-and-testing X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: merged X-GitHub-Type: pull_request X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3975 Content-Type: text/plain; charset=utf-8 The replicationRestartFromLastFeedbackPosition* tests were flaky because they called forceUpdateStatus() and then immediately closed the replication connection. forceUpdateStatus() only flushes the status update to the TCP socket — if the walsender has not read it before the connection is closed, the slot's confirmed_flush_lsn is not advanced and the slot replays from an earlier position on restart. Fix: after forceUpdateStatus(), poll pg_replication_slots until confirmed_flush_lsn matches the expected value before closing the connection. This ensures the server has processed the feedback.