A sequencesync worker builds its list of sequences and then processes them in batches. If ALTER SUBSCRIPTION ... REFRESH PUBLICATION removes one of those sequences in the meantime, the worker updated the local sequence and then failed while marking it READY, because its catalog row was gone. That rolled back the batch, and with disable_on_error the entire subscription was disabled. The worker now checks that the sequence is still part of the subscription before updating it, and skips it if not. The check is done under the lock on the subscription that the refresh also takes, so the row cannot go away in between. Reported-by: Nikolay Samokhvalov <nik@postgres.ai> Author: vignesh C <vignesh21@gmail.com> Reviewed-by: shveta malik <shveta.malik@gmail.com> Reviewed-by: Zhijie Hou <houzj.fnst@fujitsu.com> Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru> Discussion: https://postgr.es/m/CAM527d9mL-bOofX-G7Sp441vA3Y_fa_7JBh03m-ZPduikn_XUg@mail.gmail.com Backpatch-through: 19, where it was introduced
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.