RE: Logical Replication of sequences - Mailing list pgsql-hackers

From Zhijie Hou (Fujitsu)
Subject RE: Logical Replication of sequences
Date
Msg-id TY4PR01MB16907CAA300EE41232FB0BA8194FAA@TY4PR01MB16907.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Logical Replication of sequences  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
On Tuesday, October 28, 2025 8:30 PM vignesh C <vignesh21@gmail.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

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup
Next
From: "Joel Jacobson"
Date:
Subject: Re: Optimize LISTEN/NOTIFY