Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit582fbff

Browse files
committed
In the pg_rewind test suite, receive WAL fully before promoting.
If a transaction never reaches the standby, later tests find unexpectedcluster state. A "tail-copy: query result matches" test failure hasbeen the usual symptom. Among the buildfarm members having run thistest suite, most have exhibited that symptom at least once. Back-patchto 9.5, where pg_rewind was introduced.Michael Paquier, reported by Christoph Berg.
1 parentb1e1862 commit582fbff

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

‎src/bin/pg_rewind/RewindTest.pm

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,19 +222,21 @@ recovery_target_timeline='latest'
222222
'-l',"$log_path/standby.log",
223223
'-o',"-p$port_standby",'start');
224224

225-
# Wait until the standby has caught up with the primary, by polling
226-
# pg_stat_replication.
227-
my$caughtup_query =
228-
"SELECT pg_current_xlog_location() = replay_location FROM pg_stat_replication WHERE application_name = 'rewind_standby';";
229-
poll_query_until($caughtup_query,$connstr_master)
230-
ordie"Timed out while waiting for standby to catch up";
225+
# The standby may have WAL to apply before it matches the primary. That
226+
# is fine, because no test examines the standby before promotion.
231227
}
232228

233229
subpromote_standby
234230
{
235231
#### Now run the test-specific parts to run after standby has been started
236232
# up standby
237233

234+
# Wait for the standby to receive and write all WAL.
235+
my$wal_received_query =
236+
"SELECT pg_current_xlog_location() = write_location FROM pg_stat_replication WHERE application_name = 'rewind_standby';";
237+
poll_query_until($wal_received_query,$connstr_master)
238+
ordie"Timed out while waiting for standby to receive and write WAL";
239+
238240
# Now promote slave and insert some new data on master, this will put
239241
# the master out-of-sync with the standby. Wait until the standby is
240242
# out of recovery mode, and is ready to accept read-write connections.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp