RE: wake up logical workers after ALTER SUBSCRIPTION
Takamichi Osumi (Fujitsu) <osumi.takamichi@fujitsu.com>
From: "Takamichi Osumi (Fujitsu)" <osumi.takamichi@fujitsu.com>
To: 'Nathan Bossart' <nathandbossart@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2022-11-22T07:18:40Z
Lists: pgsql-hackers
On Tuesday, November 22, 2022 1:39 PM Nathan Bossart <nathandbossart@gmail.com> wrote: > On Tue, Nov 22, 2022 at 03:03:52AM +0000, Hayato Kuroda (Fujitsu) wrote: > > Just One comment: IIUC the statement "ALTER SUBSCRIPTION" can be > > executed inside the transaction. So if two subscriptions are altered > > in the same transaction, only one of them will awake. Is it expected > behavior? > > > > I think we can hold a suboid list and record oids when the > > subscription are altered, and then the backend process can consume all > > of list cells at the end of the transaction. > > I think you are correct. I did it this way in v2. I've also moved the bulk of > the logic to logical/worker.c. Hi, thanks for updating. I just quickly had a look at your patch and had one minor question. With this patch, when we execute alter subscription in a sub transaction and additionally rollback to it, is there any possibility that we'll wake up the workers that don't need to do so ? I'm not sure if this brings about some substantial issue, but just wondering if there is any need of improvement for this. Best Regards, Takamichi Osumi
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