pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix the race condition in the test added by 7c99dc587.
Date: Tue, 13 May 2025 04:41:52 +0000
Message-ID: <E1uEhSi-001RRE-0B@gemulon.postgresql.org> (raw)

Fix the race condition in the test added by 7c99dc587.

After executing ALTER SUBSCRIPTION tap_sub SET PUBLICATION, we did not
wait for the new walsender process to restart. As a result, an INSERT
executed immediately after the ALTER could be decoded and skipped,
considering it is not part of any subscribed publication. And, the old
apply worker could also confirm the LSN of such an INSERT. This could
cause the replication to resume from a point after the INSERT. In such
cases, we miss the expected warning about the missing publication.

To fix this, ensure the walsender has restarted before continuing after
ALTER SUBSCRIPTION.

Reported-by: Tom Lane as per CI
Author: vignesh C <vignesh21@gmail.com>
Reviewed-by: Xuneng Zhou <xunengzhou@gmail.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Discussion: https://postgr.es/m/1230066.1745992333@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8ede692de512750ecb6930213e6d78ed90ef06d0

Modified Files
--------------
src/test/subscription/t/024_add_drop_pub.pl | 11 +++++++++++
1 file changed, 11 insertions(+)



view thread (2+ messages)

Message-ID: <E1uEhSi-001RRE-0B@gemulon.postgresql.org>
Permalink:  ../E1uEhSi-001RRE-0B@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uEhSi-001RRE-0B@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: akapila@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix the race condition in the test added by 7c99dc587.
  In-Reply-To: <E1uEhSi-001RRE-0B@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox