Re: sequencesync worker race with REFRESH SEQUENCES
От
vignesh C
Тема
Re: sequencesync worker race with REFRESH SEQUENCES
Дата
Msg-id
CALDaNm1jzTXoqXWbnpcOuS7PM-bAFLswcya5fvpqp=H9Y6xEGg@mail.gmail.com
Ответ на
sequencesync worker race with REFRESH SEQUENCES (Noah Misch)
Список
Дерево обсуждения
sequencesync worker race with REFRESH SEQUENCES Noah Misch <noah@leadboat.com>
Re: sequencesync worker race with REFRESH SEQUENCES Amit Kapila <amit.kapila16@gmail.com>
Re: sequencesync worker race with REFRESH SEQUENCES Noah Misch <noah@leadboat.com>
Re: sequencesync worker race with REFRESH SEQUENCES Amit Kapila <amit.kapila16@gmail.com>
Re: sequencesync worker race with REFRESH SEQUENCES Noah Misch <noah@leadboat.com>
Re: sequencesync worker race with REFRESH SEQUENCES Tom Lane <tgl@sss.pgh.pa.us>
Re: sequencesync worker race with REFRESH SEQUENCES vignesh C <vignesh21@gmail.com>
Re: sequencesync worker race with REFRESH SEQUENCES vignesh C <vignesh21@gmail.com>
Re: sequencesync worker race with REFRESH SEQUENCES Tom Lane <tgl@sss.pgh.pa.us>
Re: sequencesync worker race with REFRESH SEQUENCES vignesh C <vignesh21@gmail.com>
Re: sequencesync worker race with REFRESH SEQUENCES Amit Kapila <amit.kapila16@gmail.com>
Re: sequencesync worker race with REFRESH SEQUENCES Noah Misch <noah@leadboat.com>
Re: sequencesync worker race with REFRESH SEQUENCES Amit Kapila <amit.kapila16@gmail.com>
Re: sequencesync worker race with REFRESH SEQUENCES Noah Misch <noah@leadboat.com>
Re: sequencesync worker race with REFRESH SEQUENCES vignesh C <vignesh21@gmail.com>
RE: sequencesync worker race with REFRESH SEQUENCES "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: sequencesync worker race with REFRESH SEQUENCES vignesh C <vignesh21@gmail.com>
Re: sequencesync worker race with REFRESH SEQUENCES vignesh C <vignesh21@gmail.com>
RE: sequencesync worker race with REFRESH SEQUENCES "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: sequencesync worker race with REFRESH SEQUENCES Amit Kapila <amit.kapila16@gmail.com>
RE: sequencesync worker race with REFRESH SEQUENCES "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Re: sequencesync worker race with REFRESH SEQUENCES Amit Kapila <amit.kapila16@gmail.com>
On Fri, 10 Jul 2026 at 10:22, Noah Misch wrote: > > The other findings are gray areas, perhaps. I analyzed finding 4: "Gathering scan holds a lock on every INIT relation in one unbounded transaction." The sequence synchronization worker acquires a RowExclusiveLock on every INIT sequence while scanning pg_subscription_rel and retains those locks until the transaction commits. On subscriptions with a large number of INIT sequences, this can exhaust the shared lock table, causing repeated "out of shared memory" failures. The attached v1-0001 patch addresses this by releasing the lock immediately after synchronizing each sequence, preventing lock accumulation. It also acquires an AccessShareLock instead of a RowExclusiveLock, since AccessShareLock is sufficient to ensure that the sequence's identity (namespace and name) remains stable against concurrent DROP, RENAME, and SET SCHEMA operations while the sequence is being synchronized. The attached v1-0002 patch contains a TAP test that reproduces the issue on HEAD. I'm attaching it in case anyone wants to reproduce the problem locally, although I don't think this test needs to be committed. Regards, Vignesh
В списке pgsql-hackers по дате отправления
От: Matt Suiche
Дата: