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

Commit6b67d72

Browse files
author
Amit Kapila
committed
Fix race condition in drop subscription's handling of tablesync slots.
Commitce0fdbf made tablesync slots permanent and allow DropSubscription to drop such slots. However, it is possible that beforetablesync worker could get the acknowledgment of slot creation, dropsubscription stops it and that can lead to a dangling slot on thepublisher. Prevent cancel/die interrupts while creating a slot in thetablesync worker.Reported-by: Thomas Munro as per buildfarmAuthor: Amit KapilaReviewed-by: Vignesh C, Takamichi OsumiDiscussion:https://postgr.es/m/CA+hUKGJG9dWpw1cOQ2nzWU8PHjm=PTraB+KgE5648K9nTfwvxg@mail.gmail.com
1 parent7efeb21 commit6b67d72

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,9 +1051,16 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
10511051
* Create a new permanent logical decoding slot. This slot will be used
10521052
* for the catchup phase after COPY is done, so tell it to use the
10531053
* snapshot to make the final data consistent.
1054+
*
1055+
* Prevent cancel/die interrupts while creating slot here because it is
1056+
* possible that before the server finishes this command, a concurrent
1057+
* drop subscription happens which would complete without removing this
1058+
* slot leading to a dangling slot on the server.
10541059
*/
1060+
HOLD_INTERRUPTS();
10551061
walrcv_create_slot(wrconn,slotname, false/* permanent */ ,
10561062
CRS_USE_SNAPSHOT,origin_startpos);
1063+
RESUME_INTERRUPTS();
10571064

10581065
/*
10591066
* Setup replication origin tracking. The purpose of doing this before the

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp