forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5abff19
committed
nbtree VACUUM: cope with right sibling link corruption.
Avoid "right sibling's left-link doesn't match" errors when vacuuming acorrupt nbtree index. Just LOG the issue and press on. That way VACUUMwill have a decent chance of finishing off all required processing forthe index (and for the table as a whole).This error was seen in the field from time to time (it's more than atheoretical risk), so giving VACUUM the ability to press on like thishas real value. Nothing short of a REINDEX is expected to fix theunderlying index corruption, so giving up (by throwing an error) risksmaking a bad situation far worse. Anything that blocks forward progressby VACUUM like this might go unnoticed for a long time. This couldeventually lead to a wraparound/xidStopLimit outage.Note that _bt_unlink_halfdead_page() has always been able to bail onpage deletion when the target page's left sibling page was in aninconsistent state. It now does the same thing (returns false to backout of the second phase of deletion) when it notices sibling linkcorruption in the target page's right sibling page.This is similar to the work from commit5b861ba (later backpatched ascommit43e409c), which taught nbtree to press on with vacuuming anindex when page deletion fails to "re-find" a downlink in the targetpage's parent page. The "re-find" check seems to make VACUUM bail onpage deletion more often in practice, but there is no reason to take anychances here.Author: Peter Geoghegan <pg@bowt.ie>Reviewed-By: Heikki Linnakangas <hlinnaka@iki.fi>Discussion:https://postgr.es/m/CAH2-Wzko2q2kP1+UvgJyP9g0mF4hopK0NtQZcxwvMv9_ytGhkQ@mail.gmail.comBackpatch: 11- (all supported versions).1 parent991a3df commit5abff19
2 files changed
+45
-20
lines changedLines changed: 44 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2404 | 2404 |
| |
2405 | 2405 |
| |
2406 | 2406 |
| |
2407 |
| - | |
2408 |
| - | |
2409 |
| - | |
2410 |
| - | |
2411 |
| - | |
2412 |
| - | |
2413 |
| - | |
2414 |
| - | |
2415 |
| - | |
2416 |
| - | |
2417 |
| - | |
2418 |
| - | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
2419 | 2412 |
| |
2420 | 2413 |
| |
2421 | 2414 |
| |
2422 |
| - | |
| 2415 | + | |
2423 | 2416 |
| |
2424 |
| - | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
2425 | 2423 |
| |
2426 | 2424 |
| |
2427 | 2425 |
| |
| |||
2496 | 2494 |
| |
2497 | 2495 |
| |
2498 | 2496 |
| |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
2499 | 2502 |
| |
2500 |
| - | |
| 2503 | + | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
2501 | 2511 |
| |
2502 | 2512 |
| |
2503 |
| - | |
2504 |
| - | |
2505 |
| - | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
2506 | 2531 |
| |
2507 | 2532 |
| |
2508 | 2533 |
| |
| |||
2727 | 2752 |
| |
2728 | 2753 |
| |
2729 | 2754 |
| |
| 2755 | + | |
2730 | 2756 |
| |
2731 | 2757 |
| |
2732 | 2758 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1093 | 1093 |
| |
1094 | 1094 |
| |
1095 | 1095 |
| |
1096 |
| - | |
1097 |
| - | |
| 1096 | + | |
1098 | 1097 |
| |
1099 | 1098 |
| |
1100 | 1099 |
| |
|
0 commit comments
Comments
(0)