Re: wake up logical workers after ALTER SUBSCRIPTION
Nathan Bossart <nathandbossart@gmail.com>
From: Nathan Bossart <nathandbossart@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Melih Mutlu <m.melihmutlu@gmail.com>, Thomas Munro <thomas.munro@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2023-01-10T17:43:45Z
Lists: pgsql-hackers
Attachments
- v17-0001-bypass-wal_retrieve_retry_interval-for-logical-w.patch (text/x-diff) patch v17-0001
On Tue, Jan 10, 2023 at 10:59:14AM +0530, Amit Kapila wrote: > I haven't looked in detail but isn't it better to explain somewhere in > the comments that it achieves to rate limit the restart of workers in > case of error and allows them to restart immediately in case of > subscription parameter change? I expanded one of the existing comments to make this clear. > Another minor point: Don't we need to set the launcher's latch after > removing the entry from the hash table to avoid the launcher waiting > on the latch for a bit longer? The launcher's latch should be set when the apply worker exits. The apply worker's notify_pid is set to the launcher, which means the launcher will be sent SIGUSR1 on exit. The launcher's SIGUSR1 handler sets its latch. Of course, if the launcher restarts, then the notify_pid will no longer be accurate. However, I see that workers also register a before_shmem_exit callback that will send SIGUSR1 to the launcher_pid currently stored in shared memory. (I wonder if there is a memory ordering bug here.) -- Nathan Bossart Amazon Web Services: https://aws.amazon.com
Commits
-
Avoid type cheats for invalid dsa_handles and dshash_table_handles.
- 3b4ac33254e1 16.0 landed
-
Track logrep apply workers' last start times to avoid useless waits.
- 5a3a95385bd5 16.0 landed
-
Check for two_phase change at end of process_syncing_tables_for_apply.
- 4c032dd8046b 16.0 landed
-
Wake up a subscription's replication worker processes after DDL.
- c6e1f62e2cee 16.0 landed