forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit44631ee
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 parent443a44b commit44631ee
File tree
3 files changed
+43
-36
lines changed- src
- backend/utils/cache
- include/utils
3 files changed
+43
-36
lines changedLines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
767 | 767 |
| |
768 | 768 |
| |
769 | 769 |
| |
770 |
| - | |
| 770 | + | |
771 | 771 |
| |
772 | 772 |
| |
773 |
| - | |
| 773 | + | |
774 | 774 |
| |
775 | 775 |
| |
776 | 776 |
| |
| |||
817 | 817 |
| |
818 | 818 |
| |
819 | 819 |
| |
820 |
| - | |
| 820 | + | |
821 | 821 |
| |
822 | 822 |
| |
823 | 823 |
| |
| |||
826 | 826 |
| |
827 | 827 |
| |
828 | 828 |
| |
829 |
| - | |
| 829 | + | |
830 | 830 |
| |
831 | 831 |
| |
832 | 832 |
| |
|
Lines changed: 37 additions & 31 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3642 | 3642 |
| |
3643 | 3643 |
| |
3644 | 3644 |
| |
3645 |
| - | |
3646 |
| - | |
| 3645 | + | |
| 3646 | + | |
3647 | 3647 |
| |
3648 | 3648 |
| |
3649 | 3649 |
| |
| |||
3707 | 3707 |
| |
3708 | 3708 |
| |
3709 | 3709 |
| |
3710 |
| - | |
3711 |
| - | |
3712 |
| - | |
3713 |
| - | |
3714 |
| - | |
3715 |
| - | |
3716 |
| - | |
3717 |
| - | |
3718 |
| - | |
3719 |
| - | |
3720 |
| - | |
3721 |
| - | |
3722 |
| - | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
| 3713 | + | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
| 3721 | + | |
| 3722 | + | |
| 3723 | + | |
| 3724 | + | |
| 3725 | + | |
3723 | 3726 |
| |
3724 | 3727 |
| |
3725 |
| - | |
| 3728 | + | |
3726 | 3729 |
| |
3727 | 3730 |
| |
3728 | 3731 |
| |
3729 | 3732 |
| |
3730 | 3733 |
| |
3731 | 3734 |
| |
3732 |
| - | |
3733 |
| - | |
3734 |
| - | |
3735 |
| - | |
3736 |
| - | |
3737 |
| - | |
| 3735 | + | |
| 3736 | + | |
| 3737 | + | |
3738 | 3738 |
| |
3739 | 3739 |
| |
3740 |
| - | |
3741 |
| - | |
3742 |
| - | |
3743 |
| - | |
3744 |
| - | |
3745 |
| - | |
| 3740 | + | |
| 3741 | + | |
| 3742 | + | |
| 3743 | + | |
3746 | 3744 |
| |
3747 |
| - | |
3748 |
| - | |
3749 |
| - | |
| 3745 | + | |
| 3746 | + | |
| 3747 | + | |
| 3748 | + | |
| 3749 | + | |
3750 | 3750 |
| |
3751 | 3751 |
| |
3752 | 3752 |
| |
| 3753 | + | |
| 3754 | + | |
| 3755 | + | |
| 3756 | + | |
| 3757 | + | |
| 3758 | + | |
3753 | 3759 |
| |
3754 | 3760 |
| |
3755 | 3761 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
71 |
| - | |
| 71 | + | |
| 72 | + | |
72 | 73 |
| |
73 | 74 |
| |
74 | 75 |
| |
|
0 commit comments
Comments
(0)