forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitae6d536
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 parent5396b18 commitae6d536
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 |
| |
| |||
1377 | 1378 |
| |
1378 | 1379 |
| |
1379 | 1380 |
| |
1380 |
| - | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
1381 | 1387 |
| |
1382 |
| - | |
1383 |
| - | |
1384 |
| - | |
1385 |
| - | |
1386 |
| - | |
1387 |
| - | |
1388 |
| - | |
1389 |
| - | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
1390 | 1395 |
| |
1391 |
| - | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
1392 | 1406 |
| |
1393 |
| - | |
1394 |
| - | |
1395 |
| - | |
| 1407 | + | |
| 1408 | + | |
1396 | 1409 |
| |
1397 | 1410 |
| |
1398 | 1411 |
| |
|
0 commit comments
Comments
(0)