Re: Historic snapshot doesn't track txns committed in BUILDING_SNAPSHOT state

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: cca5507 <cca5507(at)qq(dot)com>
Cc: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Historic snapshot doesn't track txns committed in BUILDING_SNAPSHOT state
Date: 2025-04-04 06:09:35
Message-ID: CAD21AoCRD1=D2JOQmR444OttUf4ddbL-ChFLkzvQCCNfh1768w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 12, 2024 at 9:25 PM cca5507 <cca5507(at)qq(dot)com> wrote:
>
> Hi,
>
> I refactor the code and fix the git apply warning according to [1].
>
> Here are the new version patches.
>

I've investigated the reported issue and reviewed the patch. IIUC to
fix this issue, what we need to do is to track catalog-change
transactions even in BUILDING_SNAPSHOT phase so that we can decode
transactions correctly that started in FULL_SNAPSHOT. My question is;
in order to track just catalog-change transactions, whether it's
sufficient to check if XLOG_XACT_COMMIT[_PREPARED] has the
XACT_XINFO_HAS_INVALS flag. If yes, we probably should change only
xact_decode() to check the commit records even in BUILDING_SNAPSHOT.
Otherwise, we would need to change mostly all paths where we mark the
transaction as catalog-change as the patch does.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2025-04-04 06:20:18 Re: Conflict detection for multiple_unique_conflicts in logical replication
Previous Message David Rowley 2025-04-04 06:04:42 Re: [PoC] Reducing planning time when tables have many partitions