Commit 692df42
committed
Fix data-corruption hazard in WAL-logged CREATE DATABASE.
RelationCopyStorageUsingBuffer thought it could skip copying
empty pages, but of course that does not work at all, because
subsequent blocks will be out of place.
Also fix it to acquire share lock on the source buffer. It *might*
be safe to not do that, but it's not very certain, and I don't think
this code deserves any benefit of the doubt.
Dilip Kumar, per complaint from me
Discussion: https://postgr.es/m/3679800.1659654066@sss.pgh.pa.us1 parent 922a8fa commit 692df42
1 file changed
+3
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3741 | 3741 | | |
3742 | 3742 | | |
3743 | 3743 | | |
| 3744 | + | |
3744 | 3745 | | |
3745 | | - | |
3746 | | - | |
3747 | | - | |
3748 | | - | |
3749 | | - | |
3750 | 3746 | | |
3751 | 3747 | | |
3752 | 3748 | | |
3753 | 3749 | | |
3754 | 3750 | | |
3755 | 3751 | | |
| 3752 | + | |
3756 | 3753 | | |
3757 | 3754 | | |
3758 | 3755 | | |
3759 | 3756 | | |
3760 | | - | |
3761 | 3757 | | |
3762 | 3758 | | |
3763 | 3759 | | |
| |||
3768 | 3764 | | |
3769 | 3765 | | |
3770 | 3766 | | |
3771 | | - | |
| 3767 | + | |
3772 | 3768 | | |
3773 | 3769 | | |
3774 | 3770 | | |
| |||
0 commit comments