RE: Synchronizing slots from primary to standby
| От | Zhijie Hou (Fujitsu) |
|---|---|
| Тема | RE: Synchronizing slots from primary to standby |
| Дата | |
| Msg-id | OS0PR01MB57160C7184E17C6765AAE38294752@OS0PR01MB5716.jpnprd01.prod.outlook.com обсуждение исходный текст |
| Ответ на | Re: Synchronizing slots from primary to standby (shveta malik <shveta.malik@gmail.com>) |
| Список | pgsql-hackers |
On Monday, January 22, 2024 11:36 AM shveta malik <shveta.malik@gmail.com> wrote:
Hi,
> On Fri, Jan 19, 2024 at 4:18 PM shveta malik <shveta.malik@gmail.com> wrote:
> >
> > PFA v64.
>
> V64 fails to apply to HEAD due to a recent commit. Rebased it. PFA v64_2. It has
> no new changes.
I noticed few things while analyzing the patch.
1.
sleep_ms = Min(sleep_ms * 2, MAX_WORKER_NAPTIME_MS);
The initial value for sleep_ms is 0(default value for static variable) which
will not be advanced in this expression. We should initialize sleep_ms to a positive
number.
2.
/ Wait a bit, we don't expect to have to wait long /
rc = WaitLatch(MyLatch,
WL_LATCH_SET | WL_TIMEOUT | WL_EXIT_ON_PM_DEATH,
10L, WAIT_EVENT_BGWORKER_SHUTDOWN);
The slotsync worker is not a bgworker anymore after 0003 patch, so a new event
is needed I think.
3.
slot->effective_catalog_xmin = xmin_horizon;
The assignment is also needed in local_slot_update() to make
ReplicationSlotsComputeRequiredXmin work.
Best Regards,
Hou zj
В списке pgsql-hackers по дате отправления: