Re: POC and rebased patch for CSN based snapshots

From: "Andrey V(dot) Lepikhov" <a(dot)lepikhov(at)postgrespro(dot)ru>
To: "movead(dot)li(at)highgo(dot)ca" <movead(dot)li(at)highgo(dot)ca>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Subject: Re: POC and rebased patch for CSN based snapshots
Date: 2020-06-29 07:47:38
Message-ID: 7106cb92-c69d-e206-5b1e-b7423380a996@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 6/12/20 2:41 PM, movead(dot)li(at)highgo(dot)ca wrote:
> Hello hackers,
>
> Currently, I do some changes based on the last version:
> 1. Catch up to the current  commit (c2bd1fec32ab54).
> 2. Add regression and document.
> 3. Add support to switch from xid-base snapshot to csn-base snapshot,
> and the same with standby side.

Some remarks on your patch:
1. The variable last_max_csn can be an atomic variable.
2. GenerateCSN() routine: in the case than csn < csnState->last_max_csn
This is the case when someone changed the value of the system clock. I
think it is needed to write a WARNING to the log file. (May be we can do
synchronization with a time server.
3. That about global snapshot xmin? In the pgpro version of the patch we
had GlobalSnapshotMapXmin() routine to maintain circular buffer of
oldestXmins for several seconds in past. This buffer allows to shift
oldestXmin in the past when backend is importing global transaction.
Otherwise old versions of tuples that were needed for this transaction
can be recycled by other processes (vacuum, HOT, etc).
How do you implement protection from local pruning? I saw
SNAP_DESYNC_COMPLAIN, but it is not used anywhere.
4. The current version of the patch is not applied clearly with current
master.

--
regards,
Andrey Lepikhov
Postgres Professional

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-06-29 07:48:58 Re: pg_bsd_indent compiles bytecode
Previous Message Kyotaro Horiguchi 2020-06-29 07:41:11 Re: [Bug fix]There is the case archive_timeout parameter is ignored after recovery works.