Re: Fix LOCK_TIMEOUT handling in slotsync worker

2025-12-09 Thread Chao Li
> On Dec 9, 2025, at 19:39, Amit Kapila wrote: > > On Tue, Dec 9, 2025 at 11:50 AM Chao Li wrote: >> >>> On Dec 9, 2025, at 14:12, Amit Kapila wrote: >>> >>> On Tue, Dec 9, 2025 at 11:23 AM Chao Li wrote: Yeah, I just searched and see similar messages: ```

Re: Fix LOCK_TIMEOUT handling in slotsync worker

2025-12-09 Thread Amit Kapila
On Tue, Dec 9, 2025 at 11:50 AM Chao Li wrote: > > > On Dec 9, 2025, at 14:12, Amit Kapila wrote: > > > > On Tue, Dec 9, 2025 at 11:23 AM Chao Li wrote: > >> > >> > >> Yeah, I just searched and see similar messages: > >> > >> ``` > >> logical replication parallel apply worker for subscription \"

Re: Fix LOCK_TIMEOUT handling in slotsync worker

2025-12-09 Thread Amit Kapila
On Tue, Dec 9, 2025 at 11:50 AM Chao Li wrote: > > > On Dec 9, 2025, at 14:12, Amit Kapila wrote: > > > > On Tue, Dec 9, 2025 at 11:23 AM Chao Li wrote: > >> > >> > >> Yeah, I just searched and see similar messages: > >> > >> ``` > >> logical replication parallel apply worker for subscription \"

Re: Fix LOCK_TIMEOUT handling in slotsync worker

2025-12-08 Thread Chao Li
> On Dec 9, 2025, at 14:12, Amit Kapila wrote: > > On Tue, Dec 9, 2025 at 11:23 AM Chao Li wrote: >> >> >> Yeah, I just searched and see similar messages: >> >> ``` >> logical replication parallel apply worker for subscription \"%s\" will stop >> because the subscription owner's superuser

Re: Fix LOCK_TIMEOUT handling in slotsync worker

2025-12-08 Thread Amit Kapila
On Tue, Dec 9, 2025 at 11:23 AM Chao Li wrote: > > > Yeah, I just searched and see similar messages: > > ``` > logical replication parallel apply worker for subscription \"%s\" will stop > because the subscription owner's superuser privileges have been revoked > > logical replication worker for s

RE: Fix LOCK_TIMEOUT handling in slotsync worker

2025-12-08 Thread Zhijie Hou (Fujitsu)
On Tuesday, December 9, 2025 1:34 PM Amit Kapila wrote: > > On Mon, Dec 8, 2025 at 1:06 PM Chao Li wrote: > > > > I have nit comment: > > > > ``` > > - if (ShutdownRequestPending) > > + if (SlotSyncCtx->stopSignaled) > > { > > ereport(LOG, > > -

Re: Fix LOCK_TIMEOUT handling in slotsync worker

2025-12-08 Thread Chao Li
> On Dec 9, 2025, at 13:34, Amit Kapila wrote: > > On Mon, Dec 8, 2025 at 1:06 PM Chao Li wrote: >> >> I have nit comment: >> >> ``` >> - if (ShutdownRequestPending) >> + if (SlotSyncCtx->stopSignaled) >>{ >>ereport(LOG, >> -

Re: Fix LOCK_TIMEOUT handling in slotsync worker

2025-12-08 Thread Amit Kapila
On Mon, Dec 8, 2025 at 1:06 PM Chao Li wrote: > > I have nit comment: > > ``` > - if (ShutdownRequestPending) > + if (SlotSyncCtx->stopSignaled) > { > ereport(LOG, > - errmsg("replication slot synchronization > worker is shutting d

Re: Fix LOCK_TIMEOUT handling in slotsync worker

2025-12-07 Thread Chao Li
Hi Zhijie, Thanks for the patch. The change looks reasonable. ShutDownSlotSync() has set SlotSyncCtx->stopSignaled, and SIGUSR1’s procsignal_sigusr1_handler will do SetLatch(MyLatch) that will in turn wake up ProcessSlotSyncInterrupts(), then hit if (SlotSyncCtx->stopSignaled) and the slotsync

Re: Fix LOCK_TIMEOUT handling in slotsync worker

2025-12-07 Thread shveta malik
On Mon, Dec 8, 2025 at 7:34 AM Zhijie Hou (Fujitsu) wrote: > > Hi, > > Previously, the slotsync worker used SIGINT to receive a graceful shutdown > signal from the startup process on promotion. However, SIGINT is also used by > the LOCK_TIMEOUT handler to trigger a query-cancel interrupt. Given th

Fix LOCK_TIMEOUT handling in slotsync worker

2025-12-07 Thread Zhijie Hou (Fujitsu)
Hi, Previously, the slotsync worker used SIGINT to receive a graceful shutdown signal from the startup process on promotion. However, SIGINT is also used by the LOCK_TIMEOUT handler to trigger a query-cancel interrupt. Given that the slotsync worker can access and lock catalog tables while parsing