Re: Proposal for CSN based snapshots - Mailing list pgsql-hackers

From Ants Aasma
Subject Re: Proposal for CSN based snapshots
Date
Msg-id CA+CSw_v_c=DJ3xG5eZkCHwng_1=LTg25DTj5WfGfuqYwg8C39A@mail.gmail.com
Whole thread Raw
In response to Re: Proposal for CSN based snapshots  (Markus Wanner <markus@bluegap.ch>)
List pgsql-hackers
On Wed, Aug 10, 2016 at 7:54 PM, Alexander Korotkov
<a.korotkov@postgrespro.ru> wrote:
> Oh, I found that I underestimated complexity of async commit...  :)
>
> Do I understand right that now async commit right as follows?
> 1) Async transaction confirms commit before flushing WAL.
> 2) Other transactions sees effect of async transaction only when its WAL
> flushed.
> 3) In the session which just committed async transaction, effect of this
> transaction is visible immediately (before WAL flushed). Is it true?

Current code  simplified:

XactLogCommitRecord()
if (synchronous_commit)    XLogFlush()
ProcArrayEndTransaction() // Become visible

The issue we are discussing is that with CSNs, the "become visible"
portion must occur in CSN order. If CSN == LSN, then async
transactions that have their commit record after a sync record must
wait for the sync record to flush and become visible. Simplest
solution is to not require CSN == LSN and just assign a CSN value
immediately before becoming visible.

Regards,
Ants Aasma



pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: Proposal for CSN based snapshots
Next
From: Alvaro Herrera
Date:
Subject: Re: Assertion failure in REL9_5_STABLE