Two-phase update of restart_lsn in LogicalConfirmReceivedLocation - Mailing list pgsql-hackers

From Arseny Sher
Subject Two-phase update of restart_lsn in LogicalConfirmReceivedLocation
Date
Msg-id 87a7vsqrqh.fsf@ars-thinkpad
Whole thread Raw
Responses Re: Two-phase update of restart_lsn in LogicalConfirmReceivedLocation  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
Hello,

In LogicalConfirmReceivedLocation two fields (data.catalog_xmin and
effective_catalog_xmin) of ReplicationSlot structure are used for
advancing xmin of the slot. This allows to avoid hole when tuples might
already have been vacuumed, but slot's state was not yet flushed to the
disk: if we crash during this hole, after restart we would assume that
all tuples with xmax > old catalog_xmin are still there, while actually
some of them might be already vacuumed. However, the same dodge is not
used for restart_lsn advancement. This means that under somewhat
unlikely circumstances it is possible that we will start decoding from
segment which was already recycled, making the slot broken. Shouldn't
this be fixed?

--
Arseny Sher
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: PATCH: Unlogged tables re-initialization tests
Next
From: Tom Lane
Date:
Subject: Re: 2018-03 Commitfest starts tomorrow