RE: wake up logical workers after ALTER SUBSCRIPTION

Поиск
Список
Период
Сортировка
От Hayato Kuroda (Fujitsu)
Тема RE: wake up logical workers after ALTER SUBSCRIPTION
Дата
Msg-id TYAPR01MB58667E500F238E0A1D155FFCF50D9@TYAPR01MB5866.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на Re: wake up logical workers after ALTER SUBSCRIPTION  (Nathan Bossart <nathandbossart@gmail.com>)
Ответы RE: wake up logical workers after ALTER SUBSCRIPTION  ("houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>)
Список pgsql-hackers
Dear Nathan,

> 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.

Thanks for updating! It becomes better. Further comments:

01. AlterSubscription()

```
+    LogicalRepWorkersWakeupAtCommit(subid);
+
```

Currently subids will be recorded even if the subscription is not modified.
I think LogicalRepWorkersWakeupAtCommit() should be called inside the if (update_tuple).

02. LogicalRepWorkersWakeupAtCommit()

```
+    oldcxt = MemoryContextSwitchTo(TopTransactionContext);
+    on_commit_wakeup_workers_subids = lappend_oid(on_commit_wakeup_workers_subids,
+                                                  subid);
```

If the subscription is altered twice in the same transaction, the same subid will be recorded twice.
I'm not sure whether it may be caused some issued, but list_member_oid() can be used to avoid that.


Best Regards,
Hayato Kuroda
FUJITSU LIMITED




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Collation version tracking for macOS
Следующее
От: "Drouvot, Bertrand"
Дата:
Сообщение: Generate pg_stat_get_* functions with Macros