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

Commit2712da8

Browse files
committed
Generate pg_basebackup temporary slot name using backend pid
Using the client pid can easily be non-unique when used on differenthosts. Using the backend pid should be guaranteed unique, since thetemporary slot gets removed when the client disconnects so it will begone even if the pid is renewed.Reported by Ludovic Vaugeois-Pepin
1 parent814573e commit2712da8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ LogStreamerMain(logstreamer_param *param)
493493
stream.replication_slot=replication_slot;
494494
stream.temp_slot=param->temp_slot;
495495
if (stream.temp_slot&& !stream.replication_slot)
496-
stream.replication_slot=psprintf("pg_basebackup_%d", (int)getpid());
496+
stream.replication_slot=psprintf("pg_basebackup_%d", (int)PQbackendPID(param->bgconn));
497497

498498
if (format=='p')
499499
stream.walmethod=CreateWalDirectoryMethod(param->xlog,0,do_sync);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp