mirror of
https://github.com/postgres/postgres.git
synced 2026-07-15 12:51:05 -04:00
Generate pg_basebackup temporary slot name using backend pid
Using the client pid can easily be non-unique when used on different hosts. Using the backend pid should be guaranteed unique, since the temporary slot gets removed when the client disconnects so it will be gone even if the pid is renewed. Reported by Ludovic Vaugeois-Pepin
This commit is contained in:
parent
814573e6c4
commit
2712da8b64
1 changed files with 1 additions and 1 deletions
|
|
@ -493,7 +493,7 @@ LogStreamerMain(logstreamer_param *param)
|
|||
stream.replication_slot = replication_slot;
|
||||
stream.temp_slot = param->temp_slot;
|
||||
if (stream.temp_slot && !stream.replication_slot)
|
||||
stream.replication_slot = psprintf("pg_basebackup_%d", (int) getpid());
|
||||
stream.replication_slot = psprintf("pg_basebackup_%d", (int) PQbackendPID(param->bgconn));
|
||||
|
||||
if (format == 'p')
|
||||
stream.walmethod = CreateWalDirectoryMethod(param->xlog, 0, do_sync);
|
||||
|
|
|
|||
Loading…
Reference in a new issue