Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9f11fce

Browse files
committed
Fix bug so logical rep launcher saves correctly time of last startup of worker.
Previously the logical replication launcher stored the last timestampwhen it started the worker, in the local variable "last_start_time",in order to check whether wal_retrive_retry_interval elapsed sincethe last startup of worker. If it has elapsed, the launcher seespg_subscription and starts new worker if necessary. This is forlimitting the startup of worker to once a wal_retrieve_retry_interval.The bug was that the variable "last_start_time" was defined andalways initialized with 0 at the beginning of the launcher's main loop.So even if it's set to the last timestamp in later phase of the loop,it's always reset to 0. Therefore the launcher could not checkcorrectly whether wal_retrieve_retry_interval elapsed sincethe last startup.This patch moves the variable "last_start_time" outside the main loopso that it will not be reset.Reviewed-by: Petr JelinekDiscussion:http://postgr.es/m/CAHGQGwGJrPO++XM4mFENAwpy1eGXKsGdguYv43GUgLgU-x8nTQ@mail.gmail.com
1 parent82ebbeb commit9f11fce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/replication/logical/launcher.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,8 @@ ApplyLauncherWakeup(void)
781781
void
782782
ApplyLauncherMain(Datummain_arg)
783783
{
784+
TimestampTzlast_start_time=0;
785+
784786
ereport(DEBUG1,
785787
(errmsg("logical replication launcher started")));
786788

@@ -812,7 +814,6 @@ ApplyLauncherMain(Datum main_arg)
812814
MemoryContextsubctx;
813815
MemoryContextoldctx;
814816
TimestampTznow;
815-
TimestampTzlast_start_time=0;
816817
longwait_time=DEFAULT_NAPTIME_PER_CYCLE;
817818

818819
now=GetCurrentTimestamp();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp