Re: Timeline switching with partial WAL records can break replica recovery - Mailing list pgsql-hackers

From Alena Vinter
Subject Re: Timeline switching with partial WAL records can break replica recovery
Date
Msg-id CAGWv16K=SkY8Y+jCNVdf7jot13YHK6opeWQAwyB+RDzgKKP=hg@mail.gmail.com
Whole thread Raw
In response to Re: Timeline switching with partial WAL records can break replica recovery  (Artem Gavrilov <artem.gavrilov@percona.com>)
List pgsql-hackers
Hi Artem!

Thank you for the clarification about archiving. I now fully understand why writing a missing contrecord into an already-archived timeline is unsafe.

Could this be avoided by having the standby check the WAL archive before promotion? Specifically, if the standby detects an incomplete contrecord at the end of its WAL stream, it attempts to fetch the contrecord from the archive, and only if the contrecord is not found in the archive, it proceeds with writing a missing contrecord and starting a new timeline. What do you think?

I plan to reproduce your described scenario to test both my original patch and this revised approach.

P.S. I'm attaching my notes just so I don’t lose them =)

---
Alena Vinter 
Attachment

pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: Sequence Access Methods, round two
Next
From: Shinya Kato
Date:
Subject: Re: remove unnecessary include in src/backend/commands/policy.c