forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite6c3ba7
committed
Fix portability problem in pgbench.
The pgbench regression test supposed that srandom() with a specific valuewould result in deterministic output from random(), as required by POSIX.It emerges however that OpenBSD is too smart to be constrained by merestandards, so their random() emits nondeterministic output anyway.While a workaround does exist, what seems like a better fix is to stoprelying on the platform's srandom()/random() altogether, so that whatyou get from --random-seed=N is not merely deterministic but platformindependent. Hence, use a separate pg_jrand48() random sequence inplace of random().Also adjust the regression test case that's supposed to detectnondeterminism so that it's more likely to detect it; the originalchoice of random_zipfian parameter tended to produce the same outputall the time even if the underlying behavior wasn't deterministic.In passing, improve pgbench's docs about random_zipfian().Back-patch to v11 where this code was introduced.Fabien Coelho and Tom LaneDiscussion:https://postgr.es/m/4615.1547792324@sss.pgh.pa.us1 parent19184fc commite6c3ba7
File tree
3 files changed
+58
-29
lines changed- doc/src/sgml/ref
- src/bin/pgbench
- t
3 files changed
+58
-29
lines changedLines changed: 14 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1604 | 1604 |
| |
1605 | 1605 |
| |
1606 | 1606 |
| |
1607 |
| - | |
| 1607 | + | |
1608 | 1608 |
| |
1609 | 1609 |
| |
1610 | 1610 |
| |
1611 |
| - | |
1612 |
| - | |
1613 |
| - | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
1614 | 1614 |
| |
1615 |
| - | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
1616 | 1625 |
| |
1617 | 1626 |
| |
1618 | 1627 |
| |
|
Lines changed: 37 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
185 | 185 |
| |
186 | 186 |
| |
187 | 187 |
| |
188 |
| - | |
| 188 | + | |
189 | 189 |
| |
190 | 190 |
| |
191 | 191 |
| |
| |||
287 | 287 |
| |
288 | 288 |
| |
289 | 289 |
| |
| 290 | + | |
| 291 | + | |
| 292 | + | |
290 | 293 |
| |
291 | 294 |
| |
292 | 295 |
| |
| |||
833 | 836 |
| |
834 | 837 |
| |
835 | 838 |
| |
| 839 | + | |
| 840 | + | |
836 | 841 |
| |
837 | 842 |
| |
838 | 843 |
| |
839 | 844 |
| |
840 |
| - | |
841 |
| - | |
842 |
| - | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
843 | 851 |
| |
844 | 852 |
| |
845 |
| - | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
846 | 861 |
| |
847 | 862 |
| |
848 | 863 |
| |
| |||
5126 | 5141 |
| |
5127 | 5142 |
| |
5128 | 5143 |
| |
5129 |
| - | |
| 5144 | + | |
| 5145 | + | |
| 5146 | + | |
| 5147 | + | |
5130 | 5148 |
| |
5131 | 5149 |
| |
5132 | 5150 |
| |
5133 |
| - | |
5134 |
| - | |
| 5151 | + | |
5135 | 5152 |
| |
5136 | 5153 |
| |
5137 | 5154 |
| |
5138 | 5155 |
| |
5139 | 5156 |
| |
5140 | 5157 |
| |
5141 | 5158 |
| |
5142 |
| - | |
| 5159 | + | |
5143 | 5160 |
| |
5144 | 5161 |
| |
5145 | 5162 |
| |
| |||
5155 | 5172 |
| |
5156 | 5173 |
| |
5157 | 5174 |
| |
5158 |
| - | |
| 5175 | + | |
5159 | 5176 |
| |
5160 | 5177 |
| |
5161 | 5178 |
| |
| |||
5165 | 5182 |
| |
5166 | 5183 |
| |
5167 | 5184 |
| |
5168 |
| - | |
5169 |
| - | |
5170 |
| - | |
| 5185 | + | |
5171 | 5186 |
| |
| 5187 | + | |
| 5188 | + | |
| 5189 | + | |
| 5190 | + | |
| 5191 | + | |
| 5192 | + | |
5172 | 5193 |
| |
5173 | 5194 |
| |
5174 | 5195 |
| |
| |||
5862 | 5883 |
| |
5863 | 5884 |
| |
5864 | 5885 |
| |
5865 |
| - | |
5866 |
| - | |
5867 |
| - | |
5868 |
| - | |
| 5886 | + | |
| 5887 | + | |
| 5888 | + | |
5869 | 5889 |
| |
5870 | 5890 |
| |
5871 | 5891 |
| |
|
Lines changed: 7 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
259 | 259 |
| |
260 | 260 |
| |
261 | 261 |
| |
262 |
| - | |
263 |
| - | |
264 |
| - | |
265 |
| - | |
266 |
| - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
267 | 267 |
| |
268 | 268 |
| |
269 | 269 |
| |
| |||
276 | 276 |
| |
277 | 277 |
| |
278 | 278 |
| |
279 |
| - | |
| 279 | + | |
280 | 280 |
| |
281 | 281 |
| |
282 | 282 |
| |
| |||
471 | 471 |
| |
472 | 472 |
| |
473 | 473 |
| |
474 |
| - | |
| 474 | + | |
475 | 475 |
| |
476 | 476 |
| |
477 | 477 |
| |
|
0 commit comments
Comments
(0)