- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit402da70
committed
Initialize random() in bootstrap/stand-alone postgres and in initdb.
This removes a difference between the standard IsUnderPostmasterexecution environment and that of --boot and --single. In a stand-alonebackend, "SELECT random()" always started at the same seed.On a system capable of using posix shared memory, initdb could stillconclude "selecting dynamic shared memory implementation ... sysv".Crashed --boot or --single postgres processes orphaned shared memoryobjects having names that collided with the not-actually-random namesthat initdb probed. The sysv fallback appeared after ten crashes of--boot or --single postgres. Since --boot and --single are rare inproduction use, systems used for PostgreSQL development are theprincipal candidate to notice this symptom.Back-patch to 9.3 (all supported versions). PostgreSQL 9.4 introduceddynamic shared memory, but 9.3 does share the "SELECT random()" problem.Reviewed by Tom Lane and Kyotaro HORIGUCHI.Discussion:https://postgr.es/m/20180915221546.GA3159382@rfd.leadboat.com1 parent00011a6 commit402da70
2 files changed
+16
-0
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
202 | 202 |
| |
203 | 203 |
| |
204 | 204 |
| |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
205 | 213 |
| |
206 | 214 |
| |
207 | 215 |
| |
|
Lines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3620 | 3620 |
| |
3621 | 3621 |
| |
3622 | 3622 |
| |
| 3623 | + | |
| 3624 | + | |
| 3625 | + | |
| 3626 | + | |
| 3627 | + | |
| 3628 | + | |
| 3629 | + | |
| 3630 | + | |
3623 | 3631 |
| |
3624 | 3632 |
| |
3625 | 3633 |
| |
|
0 commit comments
Comments
(0)