Commit a0e0fb1
committed
Use conditional variable to wait for next MultiXact offset
In one multixact.c edge case, we need a mechanism to wait for one
multixact offset to be written before being allowed to read the next
one. We used to handle this case by sleeping for one millisecond and
retrying, but such sleeps have been reported as problematic in
production cases. We can avoid the problem by using a condition
variable: readers sleep on it and then every creator of multixacts
broadcasts into the CV when creation is sufficiently far along.
Author: Kyotaro Horiguchi <horikyotajntt@gmail.com>
Reviewed-by: Andrey Borodin <amborodin@acm.org>
Discussion: https://postgr.es/m/47A598F4-B4E7-4029-8FEC-A06A6C3CB4B5@yandex-team.ru
Discussion: https://postgr.es/m/20200515.090333.24867479329066911.horikyota.ntt1 parent 473411f commit a0e0fb1
File tree
2 files changed
+29
-2
lines changed- src/backend
- access/transam
- utils/activity
2 files changed
+29
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| |||
232 | 233 | | |
233 | 234 | | |
234 | 235 | | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
235 | 242 | | |
236 | 243 | | |
237 | 244 | | |
| |||
895 | 902 | | |
896 | 903 | | |
897 | 904 | | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
898 | 911 | | |
899 | 912 | | |
900 | 913 | | |
| |||
1253 | 1266 | | |
1254 | 1267 | | |
1255 | 1268 | | |
| 1269 | + | |
1256 | 1270 | | |
1257 | 1271 | | |
1258 | 1272 | | |
| |||
1340 | 1354 | | |
1341 | 1355 | | |
1342 | 1356 | | |
1343 | | - | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
1344 | 1360 | | |
1345 | 1361 | | |
1346 | 1362 | | |
| |||
1422 | 1438 | | |
1423 | 1439 | | |
1424 | 1440 | | |
1425 | | - | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
1426 | 1445 | | |
1427 | 1446 | | |
1428 | 1447 | | |
| |||
1432 | 1451 | | |
1433 | 1452 | | |
1434 | 1453 | | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
1435 | 1460 | | |
1436 | 1461 | | |
1437 | 1462 | | |
| |||
1921 | 1946 | | |
1922 | 1947 | | |
1923 | 1948 | | |
| 1949 | + | |
1924 | 1950 | | |
1925 | 1951 | | |
1926 | 1952 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
0 commit comments