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

From movead.li@highgo.ca
Subject Re: POC and rebased patch for CSN based snapshots
Date
Msg-id 2020061911121085197414@highgo.ca
Whole thread Raw
In response to POC and rebased patch for CSN based snapshots  (Movead Li <movead.li@highgo.ca>)
Responses Re: POC and rebased patch for CSN based snapshots
List pgsql-hackers

Thanks for reply.

>Probably it's not time to do the code review yet, but when I glanced the patch,
>I came up with one question.
>0002 patch changes GenerateCSN() so that it generates CSN-related WAL records
>(and inserts it into WAL buffers). Which means that new WAL record is generated
>whenever CSN is assigned, e.g., in GetSnapshotData(). Is this WAL generation
>really necessary for CSN?
This is designed for crash recovery, here we record our most new lsn in wal so it
will not use a history lsn after a restart. It will not write into wal every time, but with
gap which you can see CSNAddByNanosec() function.

>BTW, GenerateCSN() is called while holding ProcArrayLock. Also it inserts new
>WAL record in WriteXidCsnXlogRec() while holding spinlock. Firstly this is not
>acceptable because spinlocks are intended for *very* short-term locks.
>Secondly, I don't think that WAL generation during ProcArrayLock is good
>design because ProcArrayLock is likely to be bottleneck and its term should
>be short for performance gain.
Thanks for point out which may help me deeply, I will reconsider that.


Regards,
Highgo Software (Canada/China/Pakistan)
URL : www.highgo.ca
EMAIL: mailto:movead(dot)li(at)highgo(dot)ca

pgsql-hackers by date:

Previous
From: Kyotaro Horiguchi
Date:
Subject: Re: Asynchronous Append on postgres_fdw nodes.
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: min_safe_lsn column in pg_replication_slots view