This is an automated email from the ASF dual-hosted git repository.

yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 1886c4e79dc81f24630d968bb7abb912ba22b3b5
Author: Alvaro Herrera <[email protected]>
AuthorDate: Wed Mar 23 18:22:10 2022 +0100

    Fix "missing continuation record" after standby promotion
    
    Invalidate abortedRecPtr and missingContrecPtr after a missing
    continuation record is successfully skipped on a standby. This fixes a
    PANIC caused when a recently promoted standby attempts to write an
    OVERWRITE_RECORD with an LSN of the previously read aborted record.
    
    Backpatch to 10 (all stable versions).
    
    Author: Sami Imseih <[email protected]>
    Reviewed-by: Kyotaro Horiguchi <[email protected]>
    Reviewed-by: Álvaro Herrera <[email protected]>
    Discussion: 
https://postgr.es/m/[email protected]
---
 src/backend/access/transam/xlog.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/backend/access/transam/xlog.c 
b/src/backend/access/transam/xlog.c
index 4c1036e7d5..672d6fd792 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -11256,6 +11256,10 @@ VerifyOverwriteContrecord(xl_overwrite_contrecord 
*xlrec, XLogReaderState *state
        abortedRecPtr = InvalidXLogRecPtr;
        missingContrecPtr = InvalidXLogRecPtr;
 
+       /* We have safely skipped the aborted record */
+       abortedRecPtr = InvalidXLogRecPtr;
+       missingContrecPtr = InvalidXLogRecPtr;
+
        ereport(LOG,
                        (errmsg("successfully skipped missing contrecord at 
%X/%X, overwritten at %s",
                                        LSN_FORMAT_ARGS(xlrec->overwritten_lsn),


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to