forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit93519b0
committed
Fix race condition in relcache init file invalidation.
The previous code tried to synchronize by unlinking the init file twice,but that doesn't actually work: it leaves a window wherein a third processcould read the already-stale init file but miss the SI messages that wouldtell it the data is stale. The result would be bizarre failures in catalogaccesses, typically "could not read block 0 in file ..." later duringstartup.Instead, hold RelCacheInitLock across both the unlink and the sending ofthe SI messages. This is more straightforward, and might even be a bitfaster since only one unlink call is needed.This has been wrong since it was put in (in 2002!), so back-patch to allsupported releases.1 parentf239ec5 commit93519b0
File tree
4 files changed
+57
-49
lines changed- src
- backend
- access/transam
- utils/cache
- include/utils
4 files changed
+57
-49
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1338 | 1338 |
| |
1339 | 1339 |
| |
1340 | 1340 |
| |
1341 |
| - | |
| 1341 | + | |
1342 | 1342 |
| |
1343 | 1343 |
| |
1344 |
| - | |
| 1344 | + | |
1345 | 1345 |
| |
1346 | 1346 |
| |
1347 | 1347 |
| |
|
Lines changed: 17 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
849 | 849 |
| |
850 | 850 |
| |
851 | 851 |
| |
852 |
| - | |
853 |
| - | |
854 |
| - | |
855 |
| - | |
856 |
| - | |
857 |
| - | |
858 |
| - | |
859 |
| - | |
860 | 852 |
| |
861 | 853 |
| |
862 | 854 |
| |
863 | 855 |
| |
864 | 856 |
| |
865 | 857 |
| |
866 |
| - | |
867 |
| - | |
868 |
| - | |
869 |
| - | |
870 | 858 |
| |
871 | 859 |
| |
872 | 860 |
| |
| |||
880 | 868 |
| |
881 | 869 |
| |
882 | 870 |
| |
883 |
| - | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
884 | 885 |
| |
885 | 886 |
| |
886 | 887 |
| |
887 | 888 |
| |
888 |
| - | |
| 889 | + | |
889 | 890 |
| |
890 | 891 |
| |
891 | 892 |
| |
| |||
926 | 927 |
| |
927 | 928 |
| |
928 | 929 |
| |
929 |
| - | |
| 930 | + | |
930 | 931 |
| |
931 | 932 |
| |
932 | 933 |
| |
| |||
935 | 936 |
| |
936 | 937 |
| |
937 | 938 |
| |
938 |
| - | |
| 939 | + | |
939 | 940 |
| |
940 | 941 |
| |
941 | 942 |
| |
|
Lines changed: 36 additions & 30 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4402 | 4402 |
| |
4403 | 4403 |
| |
4404 | 4404 |
| |
4405 |
| - | |
4406 |
| - | |
| 4405 | + | |
| 4406 | + | |
4407 | 4407 |
| |
4408 | 4408 |
| |
4409 | 4409 |
| |
| |||
4467 | 4467 |
| |
4468 | 4468 |
| |
4469 | 4469 |
| |
4470 |
| - | |
4471 |
| - | |
4472 |
| - | |
4473 |
| - | |
4474 |
| - | |
4475 |
| - | |
4476 |
| - | |
4477 |
| - | |
4478 |
| - | |
4479 |
| - | |
| 4470 | + | |
| 4471 | + | |
| 4472 | + | |
| 4473 | + | |
| 4474 | + | |
| 4475 | + | |
| 4476 | + | |
| 4477 | + | |
| 4478 | + | |
| 4479 | + | |
| 4480 | + | |
| 4481 | + | |
4480 | 4482 |
| |
4481 |
| - | |
4482 |
| - | |
| 4483 | + | |
| 4484 | + | |
| 4485 | + | |
4483 | 4486 |
| |
4484 | 4487 |
| |
4485 | 4488 |
| |
| |||
4489 | 4492 |
| |
4490 | 4493 |
| |
4491 | 4494 |
| |
4492 |
| - | |
| 4495 | + | |
4493 | 4496 |
| |
4494 | 4497 |
| |
4495 | 4498 |
| |
4496 | 4499 |
| |
4497 | 4500 |
| |
4498 | 4501 |
| |
4499 |
| - | |
4500 |
| - | |
4501 |
| - | |
4502 |
| - | |
4503 |
| - | |
4504 |
| - | |
| 4502 | + | |
| 4503 | + | |
| 4504 | + | |
4505 | 4505 |
| |
4506 | 4506 |
| |
4507 |
| - | |
4508 |
| - | |
4509 |
| - | |
4510 |
| - | |
4511 |
| - | |
4512 |
| - | |
| 4507 | + | |
| 4508 | + | |
| 4509 | + | |
| 4510 | + | |
4513 | 4511 |
| |
4514 |
| - | |
4515 |
| - | |
4516 |
| - | |
| 4512 | + | |
| 4513 | + | |
| 4514 | + | |
| 4515 | + | |
| 4516 | + | |
4517 | 4517 |
| |
4518 | 4518 |
| |
4519 | 4519 |
| |
| 4520 | + | |
| 4521 | + | |
| 4522 | + | |
| 4523 | + | |
| 4524 | + | |
| 4525 | + | |
4520 | 4526 |
| |
4521 | 4527 |
| |
4522 | 4528 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
96 | 96 |
| |
97 | 97 |
| |
98 | 98 |
| |
99 |
| - | |
| 99 | + | |
| 100 | + | |
100 | 101 |
| |
101 | 102 |
| |
102 | 103 |
| |
|
0 commit comments
Comments
(0)