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

Commitb5c5173

Browse files
author
Amit Kapila
committed
Fix possible crash in tablesync worker.
Commitc3afe8c added a new password_required option but forgot that youneed database access to check whether an arbitrary role ID is a superuser.Commite7e7da2 fixed a similar bug in apply worker, and this patchfixes a similar bug in tablesync worker.Author: Hou ZhijieReviewed-by: Amit KapilaDiscussion:https://postgr.es/m/OS0PR01MB571607F5A9D723755268D36294759@OS0PR01MB5716.jpnprd01.prod.outlook.com
1 parentf9f31aa commitb5c5173

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,12 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
12621262
relstate=GetSubscriptionRelState(MyLogicalRepWorker->subid,
12631263
MyLogicalRepWorker->relid,
12641264
&relstate_lsn);
1265+
1266+
/* Is the use of a password mandatory? */
1267+
must_use_password=MySubscription->passwordrequired&&
1268+
!superuser_arg(MySubscription->owner);
1269+
1270+
/* Note that the superuser_arg call can access the DB */
12651271
CommitTransactionCommand();
12661272

12671273
SpinLockAcquire(&MyLogicalRepWorker->relmutex);
@@ -1288,10 +1294,6 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
12881294
slotname,
12891295
NAMEDATALEN);
12901296

1291-
/* Is the use of a password mandatory? */
1292-
must_use_password=MySubscription->passwordrequired&&
1293-
!superuser_arg(MySubscription->owner);
1294-
12951297
/*
12961298
* Here we use the slot name instead of the subscription name as the
12971299
* application_name, so that it is different from the leader apply worker,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp