Two-phase update of restart_lsn in LogicalConfirmReceivedLocation

From: Arseny Sher <a(dot)sher(at)postgrespro(dot)ru>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Two-phase update of restart_lsn in LogicalConfirmReceivedLocation
Date: 2018-03-01 05:39:34
Message-ID: 87a7vsqrqh.fsf@ars-thinkpad
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-03-01 05:42:25 Re: 2018-03 Commitfest starts tomorrow
Previous Message Thomas Munro 2018-03-01 05:27:19 Re: PATCH: Unlogged tables re-initialization tests