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

Commitc714ebd

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 parentbd19ab2 commitc714ebd

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
@@ -10149,6 +10149,10 @@ VerifyOverwriteContrecord(xl_overwrite_contrecord *xlrec, XLogReaderState *state
1014910149
(uint32) (state->overwrittenRecPtr >>32),
1015010150
(uint32)state->overwrittenRecPtr);
1015110151

10152+
/* We have safely skipped the aborted record */
10153+
abortedRecPtr=InvalidXLogRecPtr;
10154+
missingContrecPtr=InvalidXLogRecPtr;
10155+
1015210156
ereport(LOG,
1015310157
(errmsg("successfully skipped missing contrecord at %X/%X, overwritten at %s",
1015410158
(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