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

Commitcaaeb88

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 parentcd3a505 commitcaaeb88

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
@@ -10592,6 +10592,10 @@ VerifyOverwriteContrecord(xl_overwrite_contrecord *xlrec, XLogReaderState *state
1059210592
LSN_FORMAT_ARGS(xlrec->overwritten_lsn),
1059310593
LSN_FORMAT_ARGS(state->overwrittenRecPtr));
1059410594

10595+
/* We have safely skipped the aborted record */
10596+
abortedRecPtr=InvalidXLogRecPtr;
10597+
missingContrecPtr=InvalidXLogRecPtr;
10598+
1059510599
ereport(LOG,
1059610600
(errmsg("successfully skipped missing contrecord at %X/%X, overwritten at %s",
1059710601
LSN_FORMAT_ARGS(xlrec->overwritten_lsn),

‎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