- Notifications
You must be signed in to change notification settings - Fork4.9k
Commite1c6db6
committed
pg_basebackup: Generate valid temporary slot names under PQbackendPID()
pgbouncer can cause PQbackendPID() to return negative values due to itfilling be_pid with random bytes (even these days pid_max can only beset up to 2^22 on 64b machines on Linux, for example, so this cannothappen with normal PID numbers). When this happens, pg_basebackup maygenerate a temporary slot name that may not be accepted by the parser,leading to spurious failures, like:pg_basebackup: error: could not send replication commandERROR: replication slot name "pg_basebackup_-1201966863" containsinvalid characterThis commit fixes that problem by formatting the result fromPQbackendPID() as an unsigned integer when creating the temporaryreplication slot name, so as the invalid character is gone and thecommand can be parsed.Author: Jelte FennemaReviewed-by: Daniel Gustafsson, Nishant SharmaDiscussion:https://postgr.es/m/CAGECzQQOGvYfp8ziF4fWQ_o8s2K7ppaoWBQnTmdakn3s-4Z=5g@mail.gmail.comBackpatch-through: 111 parent0174c2d commite1c6db6
1 file changed
+2
-1
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
654 | 654 |
| |
655 | 655 |
| |
656 | 656 |
| |
657 |
| - | |
| 657 | + | |
| 658 | + | |
658 | 659 |
| |
659 | 660 |
| |
660 | 661 |
| |
|
0 commit comments
Comments
(0)