forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfe88497
committed
Fix race in SSI interaction with empty btrees.
When predicate-locking btrees, we have a special case for completelyempty btrees, since there is no page to lock. This was racy, because,without buffer lock held, a matching key could be inserted between the_bt_search() and the PredicateLockRelation() calls.Fix, by rechecking _bt_search() after taking the relation-level SIREADlock, if using SERIALIZABLE isolation and an empty btree is discovered.Back-patch to all supported releases. Fixes one aspect of bug #17949.Reported-by: Artem Anisimov <artem.anisimov.255@gmail.com>Reviewed-by: Dmitry Dolgov <9erthalion6@gmail.com>Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>Discussion:https://postgr.es/m/17949-a0f17035294a55e2%40postgresql.org1 parentbec0dcb commitfe88497
1 file changed
+26
-13
lines changedLines changed: 26 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| 20 | + | |
20 | 21 |
| |
21 | 22 |
| |
22 | 23 |
| |
| |||
1258 | 1259 |
| |
1259 | 1260 |
| |
1260 | 1261 |
| |
1261 |
| - | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
1262 | 1268 |
| |
1263 |
| - | |
1264 |
| - | |
1265 |
| - | |
1266 |
| - | |
1267 |
| - | |
1268 |
| - | |
1269 |
| - | |
1270 |
| - | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
1271 | 1276 |
| |
1272 |
| - | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
1273 | 1287 |
| |
1274 |
| - | |
1275 |
| - | |
1276 |
| - | |
| 1288 | + | |
| 1289 | + | |
1277 | 1290 |
| |
1278 | 1291 |
| |
1279 | 1292 |
| |
|
0 commit comments
Comments
(0)