Re: Synchronizing slots from primary to standby
От | Amit Kapila |
---|---|
Тема | Re: Synchronizing slots from primary to standby |
Дата | |
Msg-id | CAA4eK1L=P0zopPPiue_b4dkRAPFpyEJCY7hMiC2iN9yzx2UMqw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Synchronizing slots from primary to standby (shveta malik <shveta.malik@gmail.com>) |
Ответы |
Re: Synchronizing slots from primary to standby
|
Список | pgsql-hackers |
On Mon, Feb 19, 2024 at 9:46 AM shveta malik <shveta.malik@gmail.com> wrote: > > Okay I see. Thanks for pointing it out. Here are the patches > addressing your comments. Changes are in patch001, rest are rebased. > Few comments on 0001 ==================== 1. I think it is better to error out when the valid GUC or option is not set in ensure_valid_slotsync_params() and ensure_valid_remote_info() instead of waiting. And we shouldn't start the worker in the first place if not all required GUCs are set. This will additionally simplify the code a bit. 2. +typedef struct SlotSyncWorkerCtxStruct { - /* prevents concurrent slot syncs to avoid slot overwrites */ + pid_t pid; + bool stopSignaled; bool syncing; + time_t last_start_time; slock_t mutex; -} SlotSyncCtxStruct; +} SlotSyncWorkerCtxStruct; I think we don't need to change the name of this struct as this can be used both by the worker and the backend. We can probably add the comment to indicate that all the fields except 'syncing' are used by slotsync worker. 3. Similar to above, function names like SlotSyncShmemInit() shouldn't be changed to SlotSyncWorkerShmemInit(). 4. +ReplSlotSyncWorkerMain(int argc, char *argv[]) { ... + on_shmem_exit(slotsync_worker_onexit, (Datum) 0); ... + before_shmem_exit(slotsync_failure_callback, PointerGetDatum(wrconn)); ... } Do we need two separate callbacks? Can't we have just one (say slotsync_failure_callback) that cleans additional things in case of slotsync worker? And, if we need both those callbacks then please add some comments for both and why one is before_shmem_exit() and the other is on_shmem_exit(). In addition to the above, I have made a few changes in the comments and code (cosmetic code changes). Please include those in the next version if you find them okay. You need to rename .txt file to remove .txt and apply atop v90-0001*. -- With Regards, Amit Kapila.
Вложения
В списке pgsql-hackers по дате отправления: