RE: Logical Replication of sequences

From: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Euler Taveira <euler(at)eulerto(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>
Subject: RE: Logical Replication of sequences
Date: 2025-10-29 10:31:13
Message-ID: TY4PR01MB16907CAA300EE41232FB0BA8194FAA@TY4PR01MB16907.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tuesday, October 28, 2025 8:30 PM vignesh C <vignesh21(at)gmail(dot)com> wrote:
>
> Peter's comments from [1] have also been addressed. The attached
> v20251029 version patch has the changes for the same.

Thanks for updating the patch. I have few comments on 0001:

1.

+ /*
+ * Record the remote sequence’s LSN in pg_subscription_rel and mark the

There is a problem with the encoding of the single quote here.

2.

+#define isApplyWorker(worker) ((worker)->in_use && \
+ (worker)->type == WORKERTYPE_APPLY)

The macro is unused.

3.

-FinishSyncWorker(void)
+FinishSyncWorker()

Is this change necessary ?

4.

+ LWLockAcquire(LogicalRepWorkerLock, LW_SHARED);
+
+ worker = logicalrep_worker_find(WORKERTYPE_APPLY,
+ MyLogicalRepWorker->subid, InvalidOid,
+ true);
+ if (worker)
+ worker->last_seqsync_start_time = 0;
+
+ LWLockRelease(LogicalRepWorkerLock);

I think we should take Exclusive lock here because we are modifying
the worker data.

Best Regards,
Hou zj

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2025-10-29 10:33:07 Re: Optimize LISTEN/NOTIFY
Previous Message Peter Eisentraut 2025-10-29 10:11:51 Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup