forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0f275b0
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 parent23ce748 commit0f275b0
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 |
| |
| |||
1372 | 1373 |
| |
1373 | 1374 |
| |
1374 | 1375 |
| |
1375 |
| - | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
1376 | 1382 |
| |
1377 |
| - | |
1378 |
| - | |
1379 |
| - | |
1380 |
| - | |
1381 |
| - | |
1382 |
| - | |
1383 |
| - | |
1384 |
| - | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
1385 | 1390 |
| |
1386 |
| - | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
1387 | 1401 |
| |
1388 |
| - | |
1389 |
| - | |
1390 |
| - | |
| 1402 | + | |
| 1403 | + | |
1391 | 1404 |
| |
1392 | 1405 |
| |
1393 | 1406 |
| |
|
0 commit comments
Comments
(0)