Re: POC and rebased patch for CSN based snapshots - Mailing list pgsql-hackers

From Andrey V. Lepikhov
Subject Re: POC and rebased patch for CSN based snapshots
Date
Msg-id 7106cb92-c69d-e206-5b1e-b7423380a996@postgrespro.ru
Whole thread Raw
In response to Re: POC and rebased patch for CSN based snapshots  ("movead.li@highgo.ca" <movead.li@highgo.ca>)
Responses Re: POC and rebased patch for CSN based snapshots
List pgsql-hackers
On 6/12/20 2:41 PM, movead.li@highgo.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



pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: [Bug fix]There is the case archive_timeout parameter isignored after recovery works.
Next
From: Michael Paquier
Date:
Subject: Re: pg_bsd_indent compiles bytecode