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

From: cca5507 <cca5507(at)qq(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: 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: 2024-08-08 07:53:29
Message-ID: tencent_925626C5508612AFE720C7CE37B4A9D0A205@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Thanks for pointing it out!

Here are the new version patches with a test case.

--
Regards,
ChangAo Chen

------------------&nbsp;Original&nbsp;------------------
From: "Bertrand Drouvot" <bertranddrouvot(dot)pg(at)gmail(dot)com&gt;;
Date:&nbsp;Wed, Aug 7, 2024 06:33 PM
To:&nbsp;"cca5507"<cca5507(at)qq(dot)com&gt;;
Cc:&nbsp;"Michael Paquier"<michael(at)paquier(dot)xyz&gt;;"pgsql-hackers"<pgsql-hackers(at)lists(dot)postgresql(dot)org&gt;;
Subject:&nbsp;Re: Historic snapshot doesn't track txns committed in BUILDING_SNAPSHOT state

Hi,

On Mon, Jun 10, 2024 at 10:04:31PM +0800, cca5507 wrote:
&gt; Thank you for reply!I am trying to fix it. This patch (pass check-world) will track txns
&gt; committed in BUILDING_SNAPSHOT state and can fix this bug.

Thanks for the report and the patch!

I did not look at the patch in detail but I can see that it does no contain a test
related to this issue.

Would you mind to add a test in say contrib/test_decoding? (see catalog_change_snapshot
for example).

FWIW, to ease the writing of the test, I think you don't need pub/sub to produce
the issue. I think you can reproduce with a single instance and multiple sessions
: replace in your repro the "(sub)create subscription" by a "logical slot creation"
and finish the test by "pg_logical_slot_get_changes" on the slot created above.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v2-0001-Track-transactions-committed-in-BUILDING_SNAPSHOT.patch application/octet-stream 5.0 KB
v2-0002-Add-test-case-snapshot_build-for-test_decoding.patch application/octet-stream 5.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ertan Küçükoglu 2024-08-08 08:08:55 Re: Windows default locale vs initdb
Previous Message torikoshia 2024-08-08 07:36:02 Re: Add on_error and log_verbosity options to file_fdw