Re: [PATCH] Fix stale relation close in sequence synchronization
vignesh C <vignesh21@gmail.com>
From: vignesh C <vignesh21@gmail.com>
To: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
Amit Kapila <amit.kapila16@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-04-30T04:30:15Z
Lists: pgsql-hackers
On Tue, 28 Apr 2026 at 19:05, Ayush Tiwari <ayushtiwari.slg01@gmail.com> wrote:
>
> Hi,
>
> Thanks for reviewing and confirming the issue.
>
> Attached is v3 with these changes.
Few comments:
1) Since we are setting the variable to NULL for every sequence now,
this is not required:
@@ -246,6 +246,8 @@ get_and_validate_seq_info(TupleTableSlot *slot,
Relation *sequence_rel,
Form_pg_sequence local_seq;
LogicalRepSequenceInfo *seqinfo_local;
+ *sequence_rel = NULL;
+
*seqidx = DatumGetInt32(slot_getattr(slot, ++col, &isnull));
Assert(!isnull);
2) Creating a subscription is costly as it has more work to do as it
has to sync all relations and requires more processes to be started,
instead shall we use "ALTER SUBSCRIPTION ... SET CONNECTION" followed
by "ALTER SUBSCRIPTION ... REFRESH SEQUENCES"
+$node_subscriber->safe_psql(
+ 'postgres',
+ "CREATE SUBSCRIPTION regress_seq_sub_no_select CONNECTION
'$publisher_limited_connstr' PUBLICATION regress_seq_pub WITH
(disable_on_error = true)"
+);
3) You can use sequence name as regress_s5 to be consistent with the
other sequence names nearby or alternatively you can change the privs
of an already existing sequence:
+ CREATE ROLE regress_seq_repl LOGIN REPLICATION;
+ CREATE SEQUENCE regress_no_select;
+ GRANT USAGE ON SCHEMA public TO regress_seq_repl;
4) I feel this is not required:
+$result = $node_subscriber->safe_psql('postgres', 'SELECT 1');
+is($result, '1',
+ 'subscriber remains running after publisher returns NULL
sequence data');
Regards,
Vignesh
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix BF failure introduced in commit 2bf6c9ff71.
- f67dbd8398c0 19 (unreleased) landed
-
Fix double table_close of sequence_rel in copy_sequences().
- 2bf6c9ff71c9 19 (unreleased) landed
-
Fix BF failure introduced by commit b3f6b14cf4.
- def0ce337068 17.0 cited