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

Commit9414e41

Browse files
committed
Fix logical replication launcher wake up and reset
After the logical replication launcher was told to wake up atcommit (for example, by a CREATE SUBSCRIPTION command), the flag to wakeup was not reset, so it would be woken up at every following commit aswell. So fix that by resetting the flag.Also, we don't need to wake up anything if the transaction was rolledback. Just reset the flag in that case.Author: Masahiko Sawada <sawada.mshk@gmail.com>Reported-by: Fujii Masao <masao.fujii@gmail.com>
1 parente180c8a commit9414e41

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

‎src/backend/access/transam/xact.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2138,7 +2138,7 @@ CommitTransaction(void)
21382138
AtEOXact_HashTables(true);
21392139
AtEOXact_PgStat(true);
21402140
AtEOXact_Snapshot(true, false);
2141-
AtCommit_ApplyLauncher();
2141+
AtEOXact_ApplyLauncher(true);
21422142
pgstat_report_xact_timestamp(0);
21432143

21442144
CurrentResourceOwner=NULL;
@@ -2612,6 +2612,7 @@ AbortTransaction(void)
26122612
AtEOXact_ComboCid();
26132613
AtEOXact_HashTables(false);
26142614
AtEOXact_PgStat(false);
2615+
AtEOXact_ApplyLauncher(false);
26152616
pgstat_report_xact_timestamp(0);
26162617
}
26172618

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,10 +748,12 @@ ApplyLauncherShmemInit(void)
748748
* Wakeup the launcher on commit if requested.
749749
*/
750750
void
751-
AtCommit_ApplyLauncher(void)
751+
AtEOXact_ApplyLauncher(boolisCommit)
752752
{
753-
if (on_commit_launcher_wakeup)
753+
if (isCommit&&on_commit_launcher_wakeup)
754754
ApplyLauncherWakeup();
755+
756+
on_commit_launcher_wakeup= false;
755757
}
756758

757759
/*

‎src/include/replication/logicallauncher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ extern Size ApplyLauncherShmemSize(void);
2222
externvoidApplyLauncherShmemInit(void);
2323

2424
externvoidApplyLauncherWakeupAtCommit(void);
25-
externvoidAtCommit_ApplyLauncher(void);
25+
externvoidAtEOXact_ApplyLauncher(boolisCommit);
2626

2727
#endif/* LOGICALLAUNCHER_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp