| От | Nathan Bossart |
|---|---|
| Тема | Re: wake up logical workers after ALTER SUBSCRIPTION |
| Дата | |
| Msg-id | 20221206212954.GA3403597@nathanxps13 обсуждение исходный текст |
| Ответ на | Re: wake up logical workers after ALTER SUBSCRIPTION (Nathan Bossart <nathandbossart@gmail.com>) |
| Ответы |
Re: wake up logical workers after ALTER SUBSCRIPTION
|
| Список | pgsql-hackers |
On Tue, Dec 06, 2022 at 11:25:51AM -0800, Nathan Bossart wrote: > On Tue, Dec 06, 2022 at 07:44:46PM +0300, Melih Mutlu wrote: >> - When the state is SYNCDONE and the apply worker has to wake up to change >> the state to READY. >> >> I think we already call logicalrep_worker_wakeup_ptr wherever it's needed >> for the above cases? What am I missing here? > > IIUC we must restart all the apply workers for a subscription to enable > two_phase mode. It looks like finish_sync_worker() only wakes up its own > apply worker. I moved this logic to where the sync worker marks the state > as SYNCDONE and added a check that two_phase mode is pending. Even so, > there can still be unnecessary wakeups, but this adjustment should limit > them. Actually, that's not quite right. The sync worker will wake up the apply worker to change the state from SYNCDONE to READY. AllTablesyncsReady() checks that all tables are READY, so we need to wake up all the workers when an apply worker changes the state to READY. Each worker will then evaluate whether to restart for two_phase mode. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера