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

Commit98eb3e0

Browse files
committed
Fix "missing continuation record" after standby promotion
Invalidate abortedRecPtr and missingContrecPtr after a missingcontinuation record is successfully skipped on a standby. This fixes aPANIC caused when a recently promoted standby attempts to write anOVERWRITE_RECORD with an LSN of the previously read aborted record.Backpatch to 10 (all stable versions).Author: Sami Imseih <simseih@amazon.com>Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>Reviewed-by: Álvaro Herrera <alvherre@alvh.no-ip.org>Discussion:https://postgr.es/m/44D259DE-7542-49C4-8A52-2AB01534DCA9@amazon.com
1 parentf784fcd commit98eb3e0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10383,6 +10383,10 @@ VerifyOverwriteContrecord(xl_overwrite_contrecord *xlrec, XLogReaderState *state
1038310383
(uint32) (state->overwrittenRecPtr >>32),
1038410384
(uint32)state->overwrittenRecPtr);
1038510385

10386+
/* We have safely skipped the aborted record */
10387+
abortedRecPtr=InvalidXLogRecPtr;
10388+
missingContrecPtr=InvalidXLogRecPtr;
10389+
1038610390
ereport(LOG,
1038710391
(errmsg("successfully skipped missing contrecord at %X/%X, overwritten at %s",
1038810392
(uint32) (xlrec->overwritten_lsn >>32),

‎src/test/recovery/t/026_overwrite_contrecord.pl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Test: Create a physical replica that's missing the last WAL file,
1616
# then restart the primary to create a divergent WAL file and observe
1717
# that the replica replays the "overwrite contrecord" from that new
18-
# file.
18+
# file and the standby promotes successfully.
1919

2020
my$node = PostgresNode->get_new_node('primary');
2121
$node->init(allows_streaming=> 1);
@@ -102,5 +102,8 @@ END
102102
qr[successfully skipped missing contrecord at],
103103
"found log line in standby");
104104

105+
# Verify promotion is successful
106+
$node_standby->promote;
107+
105108
$node->stop;
106109
$node_standby->stop;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp