Commit fa7ff64
committed
Fix minor nbtree page deletion buffer lock issue.
Avoid accessing the deletion target page's special area during nbtree
page deletion at a point where there is no buffer lock held. This issue
was detected by a patch that extends Valgrind's memcheck tool to mark
nbtree pages that are unsafe to access (due to not having a buffer lock
or buffer pin) as NOACCESS.
We do hold a buffer pin at this point, and only access the special area,
so the old approach was safe. Even still, it seems like a good idea to
tighten up the rules in this area. There is no reason to not simply
insist on always holding a buffer lock (not just a pin) when accessing
nbtree pages.
Update some related comments in passing.
Discussion: https://postgr.es/m/CAH2-WzkLgyN3zBvRZ1pkNJThC=xi_0gpWRUb_45eexLH1+k2_Q@mail.gmail.com1 parent f246ea3 commit fa7ff64
1 file changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1611 | 1611 | | |
1612 | 1612 | | |
1613 | 1613 | | |
1614 | | - | |
| 1614 | + | |
1615 | 1615 | | |
1616 | 1616 | | |
1617 | 1617 | | |
| |||
1695 | 1695 | | |
1696 | 1696 | | |
1697 | 1697 | | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
1698 | 1704 | | |
1699 | 1705 | | |
1700 | 1706 | | |
| |||
1904 | 1910 | | |
1905 | 1911 | | |
1906 | 1912 | | |
1907 | | - | |
1908 | | - | |
| 1913 | + | |
| 1914 | + | |
1909 | 1915 | | |
1910 | 1916 | | |
1911 | 1917 | | |
| |||
0 commit comments