git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ef0ba57)
Wake up launcher when enabling a subscription
2017年4月25日 18:40:33 +0000 (14:40 -0400)
2017年4月25日 18:40:33 +0000 (14:40 -0400)
Otherwise one would have to wait up to DEFAULT_NAPTIME_PER_CYCLE until
the subscription worker is considered for starting.

There is a small race condition: If one enables a subscription right
after disabling it, the launcher might not have registered the stopping
when receiving the wakeup signal for the re-enabling. The start will
then not happen right away but after the full cycle time.

Author: Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>


diff --git a/src/backend/commands/subscriptioncmds.c b/src/backend/commands/subscriptioncmds.c
index c29a57ed52d2bb4c9bc7045b00213e23821b007c..6a404bbe1e3d18be28fad1a325e3466ae87fc45f 100644 (file)
--- a/src/backend/commands/subscriptioncmds.c
+++ b/src/backend/commands/subscriptioncmds.c
@@ -644,6 +644,9 @@ AlterSubscription(AlterSubscriptionStmt *stmt)
BoolGetDatum(enabled);
replaces[Anum_pg_subscription_subenabled - 1] = true;
+ if (enabled)
+ ApplyLauncherWakeupAtCommit();
+
update_tuple = true;
break;
}
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /