[HACKERS] some review comments on logical rep code

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема [HACKERS] some review comments on logical rep code
Дата
Msg-id CAHGQGwFDWh_Qr-q_GEMpD+qH=vYPMdVqw=ZOSY3kX_Pna9R9SA@mail.gmail.com
обсуждение исходный текст
Ответы Re: [HACKERS] some review comments on logical rep code
Re: [HACKERS] some review comments on logical rep code
Список pgsql-hackers
Hi,

Though I've read only a part of the logical rep code yet, I'd like to
share some (relatively minor) review comments that I got so far.

In ApplyWorkerMain(), DatumGetInt32() should be used to get integer
value from the argument, instead of DatumGetObjectId().

No one resets on_commit_launcher_wakeup flag to false.

ApplyLauncherWakeup() should be static function.

Seems not only CREATE SUBSCRIPTION but also ALTER SUBSCRIPTION's
subcommands (e.g., ENABLED one) should wake the launcher up on commit.

Why is IsBackendPid() check necessary in ApplyLauncherWakeup()?

Normal statements that the walsender for logical rep runs are logged
by log_replication_commands. So if log_statement is also set,
those commands are logged twice.

LogicalRepCtx->launcher_pid isn't reset to 0 when the launcher emits
an error. The callback function to reset it needs to be registered
via on_shmem_exit().

Typo: "an subscriber" should be "a subscriber" in some places.
   /* Get conninfo */   datum = SysCacheGetAttr(SUBSCRIPTIONOID,       tup,       Anum_pg_subscription_subconninfo,
 &isnull);   Assert(!isnull);
 

This assertion makes me think that pg_subscription.subconnifo should
have NOT NULL constraint. Also subslotname and subpublications
should have NOT NULL constraint because of the same reason.
   SpinLockAcquire(&MyLogicalRepWorker->relmutex);   MyLogicalRepWorker->relstate =
GetSubscriptionRelState(MyLogicalRepWorker->subid,          MyLogicalRepWorker->relid,
&MyLogicalRepWorker->relstate_lsn,          false);   SpinLockRelease(&MyLogicalRepWorker->relmutex);
 

Non-"short-term" function like GetSubscriptionRelState() should not
be called while spinlock is being held.

Regards,

-- 
Fujii Masao



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] pg_upgrade vs extension upgrades
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: [HACKERS] pg_upgrade vs extension upgrades