pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: vignesh C <vignesh21@gmail.com>
Cc: Noah Misch <noah@leadboat.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: sequencesync worker race with REFRESH SEQUENCES
Date: Fri, 17 Jul 2026 01:33:57 -0400
Message-ID: <3848535.1784266437@sss.pgh.pa.us> (raw)
In-Reply-To: <CALDaNm2mSAAjAX3d=E-XUXWZgVyy-dtcAhh+whe0a=6JTM0Bgg@mail.gmail.com>
References: <20260710045217.f0.noahmisch@microsoft.com>
	<CAA4eK1K8LD243UzHgVNCm4skJZ4UCjR3vowDhKp=cWnK5oBT-Q@mail.gmail.com>
	<20260715025809.cd.noahmisch@microsoft.com>
	<CAA4eK1+k+iKhNtt6bq2SJQm+K_ZYUrS5GCqnf6a6qK6_DrX5Gg@mail.gmail.com>
	<20260715115601.fd.noahmisch@microsoft.com>
	<3614163.1784163070@sss.pgh.pa.us>
	<CALDaNm2myhhkoctERWc2x9xA2N3eJojk9h-mAPi-oXatq+ivMA@mail.gmail.com>
	<CALDaNm2mSAAjAX3d=E-XUXWZgVyy-dtcAhh+whe0a=6JTM0Bgg@mail.gmail.com>

[ please, please, please: proper bottom-quoting does not mean to quote
the entire damn thread and then add a few lines of new material.  The
point of quoting is just to *briefly* remind readers of the topic. ]

vignesh C <vignesh21@gmail.com> writes:
> While reviewing this further, I noticed another scenario. After the
> sequence synchronization worker marks all sequences as READY, if we
> pause execution at report_sequence_errors(), an ALTER SUBSCRIPTION ...
> REFRESH SEQUENCES can still fail. This means that checking
> pg_subscription_rel and verifying that all sequences are in the READY
> state is not sufficient. We also need to ensure that the sequence
> synchronization worker itself has exited before proceeding, since it
> may still be running even after updating the state to READY. I've
> updated the test accordingly to include this additional check.

I grow even more skeptical that f38afa4ab was a good idea.  It seems
inevitable that it will cause annoying failures in the field.
I think that our goal here needs to be to fix the backend, not
band-aid these existing, always-worked-before test cases.

Could we, on detecting the race condition problem, wait awhile
to see if it resolves?  Or simply exit and let the REFRESH be
a no-op?

			regards, tom lane






view thread (82+ messages)  latest in thread

Message-ID: <3848535.1784266437@sss.pgh.pa.us>
Permalink:  ../3848535.1784266437@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3848535.1784266437@sss.pgh.pa.us

 · 

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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, vignesh21@gmail.com, noah@leadboat.com, amit.kapila16@gmail.com
  Subject: Re: sequencesync worker race with REFRESH SEQUENCES
  In-Reply-To: <3848535.1784266437@sss.pgh.pa.us>

* 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