summaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/launcher.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2017-05-01 10:18:09 -0400
committerPeter Eisentraut <peter_e@gmx.net>2017-05-01 10:18:09 -0400
commit9414e41ea703ea5fcc288bcf7dc000e53306896b (patch)
tree974069d514fb35f6c294f3e7c94dcfd2b3231fdf /src/backend/replication/logical/launcher.c
parente180c8aa8caf5c55a273d4a8e6092e77ff3cff10 (diff)
Fix logical replication launcher wake up and reset
After the logical replication launcher was told to wake up at commit (for example, by a CREATE SUBSCRIPTION command), the flag to wake up was not reset, so it would be woken up at every following commit as well. So fix that by resetting the flag. Also, we don't need to wake up anything if the transaction was rolled back. Just reset the flag in that case. Author: Masahiko Sawada <sawada.mshk@gmail.com> Reported-by: Fujii Masao <masao.fujii@gmail.com>
Diffstat (limited to 'src/backend/replication/logical/launcher.c')
-rw-r--r--src/backend/replication/logical/launcher.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/replication/logical/launcher.c b/src/backend/replication/logical/launcher.c
index f5058d5a9ac..09c87d7c53a 100644
--- a/src/backend/replication/logical/launcher.c
+++ b/src/backend/replication/logical/launcher.c
@@ -748,10 +748,12 @@ ApplyLauncherShmemInit(void)
* Wakeup the launcher on commit if requested.
*/
void
-AtCommit_ApplyLauncher(void)
+AtEOXact_ApplyLauncher(bool isCommit)
{
- if (on_commit_launcher_wakeup)
+ if (isCommit && on_commit_launcher_wakeup)
ApplyLauncherWakeup();
+
+ on_commit_launcher_wakeup = false;
}
/*