suppressing useless wakeups in logical/worker.c
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: pgsql-hackers@postgresql.org
Date: 2022-12-02T19:55:03Z
Lists: pgsql-hackers
Attachments
Hi hackers, I've attached an attempt at porting a similar change to 05a7be9 [0] to logical/worker.c. The bulk of the patch is lifted from the walreceiver patch, but I did need to add a hack for waking up after wal_retrieve_retry_interval to start sync workers. This hack involves a new wakeup variable that process_syncing_tables_for_apply() sets. For best results, this patch should be applied on top of [1], which is an attempt at fixing all the stuff that only runs within a reasonable timeframe because logical worker processes currently wake up at least once a second. With the attached patch applied, those periodic wakeups are gone, so we need to make sure we wake up the logical workers as needed. [0] https://postgr.es/m/CA%2BhUKGJGhX4r2LPUE3Oy9BX71Eum6PBcS8L3sJpScR9oKaTVaA%40mail.gmail.com [1] https://postgr.es/m/20221122004119.GA132961%40nathanxps13 -- Nathan Bossart Amazon Web Services: https://aws.amazon.com
Commits
-
Improve TimestampDifferenceMilliseconds to cope with overflow sanely.
- 3a28d7808928 16.0 landed
-
Code review for commit 05a7be935.
- 24ff700f6aee 16.0 landed