Skip to content

Commit 83baef1

Browse files
author
Antonin Houska
committed
Adjust replication slot number to make collisions less likely.
1 parent 40ced69 commit 83baef1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

worker.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,11 @@ create_replication_slots(int nslots, MemoryContext mcxt)
15471547
* name.
15481548
*/
15491549
Assert(nslots == 1);
1550-
slot_nr = MyProcPid;
1550+
/*
1551+
* Try to minimize the probability of collision with a
1552+
* "non-standalone" worker.
1553+
*/
1554+
slot_nr = Min(MyProcPid, MyProcPid + 1024);
15511555
}
15521556
else
15531557
slot_nr = i;

0 commit comments

Comments
 (0)