Hi,

My colleague, Nick Ivanov, reported to me that it's possible for WAL
summarizer to get stuck when a timeline switch occurs. As far as I can
tell, for this to happen, all of the following things need to be true:

1. There must be a standby that is summarizing WAL.
2. That standby must see a timeline change due to some other server
(not itself) being promoted.
3. That standby must be retrieving WAL via archiving, not streaming.
4. The WAL file that contains the switchpoint must be archived on the
new timeline, but not the original one.

The reason this case is a problem is that the WAL summarizer is coded
to only read WAL from a file where the TLI in the filename matches the
TLI of the WAL sought. But in this scenario, the partial segment at
the end of the old timeline is only available from the beginning of
the first file archived on the new timeline, so WAL summarization
cannot progress to, or beyond, the TLI switch.

Here is a patch, with a test case.

-- 
Robert Haas
EDB: http://www.enterprisedb.com

Attachment: v1-0001-Prevent-walsummarizer-from-getting-stuck-at-a-tim.patch
Description: Binary data

Reply via email to