forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit62a1657
committed
Fix corner-case errors in brin_doupdate().
In some cases the BRIN code releases lock on an index page, and laterre-acquires lock and tries to check that the tuple it was working on isstill there. That check was a couple bricks shy of a load. It didn'tconsider that the page might have turned into a "revmap" page. (Thesamepage code path doesn't call brin_getinsertbuffer(), so it isn'tprotected by the checks for revmap status there.) It also didn't checkwhether the tuple offset was now off the end of the linepointer array.Since commit24992c6 the latter case is pretty common, but at leastin principle it could have occurred before that. The net result isthat concurrent updates of a BRIN index could fail with errors like"invalid index offnum" or "inconsistent range map".Per report from Tomas Vondra. Back-patch to 9.5, since this code issubstantially the same in all versions containing BRIN.Discussion:https://postgr.es/m/10d2b9f9-f427-03b8-8ad9-6af4ecacbee9@2ndquadrant.com1 parent5eb8bf2 commit62a1657
1 file changed
+8
-2
lines changedLines changed: 8 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
113 | 113 |
| |
114 | 114 |
| |
115 | 115 |
| |
116 |
| - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
117 | 121 |
| |
118 |
| - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
119 | 125 |
| |
120 | 126 |
| |
121 | 127 |
| |
|
0 commit comments
Comments
(0)