pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: nbtree VACUUM: cope with right sibling link corruption.
6+ messages / 1 participants
[nested] [flat]

* pgsql: nbtree VACUUM: cope with right sibling link corruption.
@ 2023-05-25 22:33  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Geoghegan @ 2023-05-25 22:33 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

nbtree VACUUM: cope with right sibling link corruption.

Avoid "right sibling's left-link doesn't match" errors when vacuuming a
corrupt nbtree index.  Just LOG the issue and press on.  That way VACUUM
will have a decent chance of finishing off all required processing for
the index (and for the table as a whole).

This error was seen in the field from time to time (it's more than a
theoretical risk), so giving VACUUM the ability to press on like this
has real value.  Nothing short of a REINDEX is expected to fix the
underlying index corruption, so giving up (by throwing an error) risks
making a bad situation far worse.  Anything that blocks forward progress
by VACUUM like this might go unnoticed for a long time.  This could
eventually lead to a wraparound/xidStopLimit outage.

Note that _bt_unlink_halfdead_page() has always been able to bail on
page deletion when the target page's left sibling page was in an
inconsistent state.  It now does the same thing (returns false to back
out of the second phase of deletion) when it notices sibling link
corruption in the target page's right sibling page.

This is similar to the work from commit 5b861baa (later backpatched as
commit 43e409ce), which taught nbtree to press on with vacuuming an
index when page deletion fails to "re-find" a downlink in the target
page's parent page.  The "re-find" check seems to make VACUUM bail on
page deletion more often in practice, but there is no reason to take any
chances 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.com
Backpatch: 11- (all supported versions).

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8f876d15ca93f7b62b5daf07ab896573991eb935

Modified Files
--------------
src/backend/access/nbtree/nbtpage.c | 45 ++++++++++++++++++++++++++++---------
src/backend/access/nbtree/nbtree.c  |  3 +--
2 files changed, 35 insertions(+), 13 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: nbtree VACUUM: cope with right sibling link corruption.
@ 2023-05-25 22:33  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Geoghegan @ 2023-05-25 22:33 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

nbtree VACUUM: cope with right sibling link corruption.

Avoid "right sibling's left-link doesn't match" errors when vacuuming a
corrupt nbtree index.  Just LOG the issue and press on.  That way VACUUM
will have a decent chance of finishing off all required processing for
the index (and for the table as a whole).

This error was seen in the field from time to time (it's more than a
theoretical risk), so giving VACUUM the ability to press on like this
has real value.  Nothing short of a REINDEX is expected to fix the
underlying index corruption, so giving up (by throwing an error) risks
making a bad situation far worse.  Anything that blocks forward progress
by VACUUM like this might go unnoticed for a long time.  This could
eventually lead to a wraparound/xidStopLimit outage.

Note that _bt_unlink_halfdead_page() has always been able to bail on
page deletion when the target page's left sibling page was in an
inconsistent state.  It now does the same thing (returns false to back
out of the second phase of deletion) when it notices sibling link
corruption in the target page's right sibling page.

This is similar to the work from commit 5b861baa (later backpatched as
commit 43e409ce), which taught nbtree to press on with vacuuming an
index when page deletion fails to "re-find" a downlink in the target
page's parent page.  The "re-find" check seems to make VACUUM bail on
page deletion more often in practice, but there is no reason to take any
chances 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.com
Backpatch: 11- (all supported versions).

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5abff197cc3ec2b0a1f5a64fd34953d0318bca79

Modified Files
--------------
src/backend/access/nbtree/nbtpage.c | 62 ++++++++++++++++++++++++++-----------
src/backend/access/nbtree/nbtree.c  |  3 +-
2 files changed, 45 insertions(+), 20 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: nbtree VACUUM: cope with right sibling link corruption.
@ 2023-05-25 22:33  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Geoghegan @ 2023-05-25 22:33 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

nbtree VACUUM: cope with right sibling link corruption.

Avoid "right sibling's left-link doesn't match" errors when vacuuming a
corrupt nbtree index.  Just LOG the issue and press on.  That way VACUUM
will have a decent chance of finishing off all required processing for
the index (and for the table as a whole).

This error was seen in the field from time to time (it's more than a
theoretical risk), so giving VACUUM the ability to press on like this
has real value.  Nothing short of a REINDEX is expected to fix the
underlying index corruption, so giving up (by throwing an error) risks
making a bad situation far worse.  Anything that blocks forward progress
by VACUUM like this might go unnoticed for a long time.  This could
eventually lead to a wraparound/xidStopLimit outage.

Note that _bt_unlink_halfdead_page() has always been able to bail on
page deletion when the target page's left sibling page was in an
inconsistent state.  It now does the same thing (returns false to back
out of the second phase of deletion) when it notices sibling link
corruption in the target page's right sibling page.

This is similar to the work from commit 5b861baa (later backpatched as
commit 43e409ce), which taught nbtree to press on with vacuuming an
index when page deletion fails to "re-find" a downlink in the target
page's parent page.  The "re-find" check seems to make VACUUM bail on
page deletion more often in practice, but there is no reason to take any
chances 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.com
Backpatch: 11- (all supported versions).

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a72b503ca8289bc418094ba3fc37a83ddcbab93b

Modified Files
--------------
src/backend/access/nbtree/nbtpage.c | 47 ++++++++++++++++++++++++++++---------
1 file changed, 36 insertions(+), 11 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: nbtree VACUUM: cope with right sibling link corruption.
@ 2023-05-25 22:33  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Geoghegan @ 2023-05-25 22:33 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

nbtree VACUUM: cope with right sibling link corruption.

Avoid "right sibling's left-link doesn't match" errors when vacuuming a
corrupt nbtree index.  Just LOG the issue and press on.  That way VACUUM
will have a decent chance of finishing off all required processing for
the index (and for the table as a whole).

This error was seen in the field from time to time (it's more than a
theoretical risk), so giving VACUUM the ability to press on like this
has real value.  Nothing short of a REINDEX is expected to fix the
underlying index corruption, so giving up (by throwing an error) risks
making a bad situation far worse.  Anything that blocks forward progress
by VACUUM like this might go unnoticed for a long time.  This could
eventually lead to a wraparound/xidStopLimit outage.

Note that _bt_unlink_halfdead_page() has always been able to bail on
page deletion when the target page's left sibling page was in an
inconsistent state.  It now does the same thing (returns false to back
out of the second phase of deletion) when it notices sibling link
corruption in the target page's right sibling page.

This is similar to the work from commit 5b861baa (later backpatched as
commit 43e409ce), which taught nbtree to press on with vacuuming an
index when page deletion fails to "re-find" a downlink in the target
page's parent page.  The "re-find" check seems to make VACUUM bail on
page deletion more often in practice, but there is no reason to take any
chances 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.com
Backpatch: 11- (all supported versions).

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6983a511288cca3ed0c40f7e5f71c4c94010293a

Modified Files
--------------
src/backend/access/nbtree/nbtpage.c | 62 ++++++++++++++++++++++++++-----------
src/backend/access/nbtree/nbtree.c  |  3 +-
2 files changed, 45 insertions(+), 20 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: nbtree VACUUM: cope with right sibling link corruption.
@ 2023-05-25 22:33  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Geoghegan @ 2023-05-25 22:33 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

nbtree VACUUM: cope with right sibling link corruption.

Avoid "right sibling's left-link doesn't match" errors when vacuuming a
corrupt nbtree index.  Just LOG the issue and press on.  That way VACUUM
will have a decent chance of finishing off all required processing for
the index (and for the table as a whole).

This error was seen in the field from time to time (it's more than a
theoretical risk), so giving VACUUM the ability to press on like this
has real value.  Nothing short of a REINDEX is expected to fix the
underlying index corruption, so giving up (by throwing an error) risks
making a bad situation far worse.  Anything that blocks forward progress
by VACUUM like this might go unnoticed for a long time.  This could
eventually lead to a wraparound/xidStopLimit outage.

Note that _bt_unlink_halfdead_page() has always been able to bail on
page deletion when the target page's left sibling page was in an
inconsistent state.  It now does the same thing (returns false to back
out of the second phase of deletion) when it notices sibling link
corruption in the target page's right sibling page.

This is similar to the work from commit 5b861baa (later backpatched as
commit 43e409ce), which taught nbtree to press on with vacuuming an
index when page deletion fails to "re-find" a downlink in the target
page's parent page.  The "re-find" check seems to make VACUUM bail on
page deletion more often in practice, but there is no reason to take any
chances 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.com
Backpatch: 11- (all supported versions).

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/322c9b340adae0b48eed6fe822cbb700a2e6cf34

Modified Files
--------------
src/backend/access/nbtree/nbtpage.c | 62 ++++++++++++++++++++++++++-----------
src/backend/access/nbtree/nbtree.c  |  3 +-
2 files changed, 45 insertions(+), 20 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: nbtree VACUUM: cope with right sibling link corruption.
@ 2023-05-25 22:33  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Geoghegan @ 2023-05-25 22:33 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

nbtree VACUUM: cope with right sibling link corruption.

Avoid "right sibling's left-link doesn't match" errors when vacuuming a
corrupt nbtree index.  Just LOG the issue and press on.  That way VACUUM
will have a decent chance of finishing off all required processing for
the index (and for the table as a whole).

This error was seen in the field from time to time (it's more than a
theoretical risk), so giving VACUUM the ability to press on like this
has real value.  Nothing short of a REINDEX is expected to fix the
underlying index corruption, so giving up (by throwing an error) risks
making a bad situation far worse.  Anything that blocks forward progress
by VACUUM like this might go unnoticed for a long time.  This could
eventually lead to a wraparound/xidStopLimit outage.

Note that _bt_unlink_halfdead_page() has always been able to bail on
page deletion when the target page's left sibling page was in an
inconsistent state.  It now does the same thing (returns false to back
out of the second phase of deletion) when it notices sibling link
corruption in the target page's right sibling page.

This is similar to the work from commit 5b861baa (later backpatched as
commit 43e409ce), which taught nbtree to press on with vacuuming an
index when page deletion fails to "re-find" a downlink in the target
page's parent page.  The "re-find" check seems to make VACUUM bail on
page deletion more often in practice, but there is no reason to take any
chances 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.com
Backpatch: 11- (all supported versions).

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/188dad680e8f32308311c4e1edf4955bf33206c5

Modified Files
--------------
src/backend/access/nbtree/nbtpage.c | 47 ++++++++++++++++++++++++++++---------
1 file changed, 36 insertions(+), 11 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2023-05-25 22:33 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-05-25 22:33 pgsql: nbtree VACUUM: cope with right sibling link corruption. Peter Geoghegan <pg@bowt.ie>
2023-05-25 22:33 pgsql: nbtree VACUUM: cope with right sibling link corruption. Peter Geoghegan <pg@bowt.ie>
2023-05-25 22:33 pgsql: nbtree VACUUM: cope with right sibling link corruption. Peter Geoghegan <pg@bowt.ie>
2023-05-25 22:33 pgsql: nbtree VACUUM: cope with right sibling link corruption. Peter Geoghegan <pg@bowt.ie>
2023-05-25 22:33 pgsql: nbtree VACUUM: cope with right sibling link corruption. Peter Geoghegan <pg@bowt.ie>
2023-05-25 22:33 pgsql: nbtree VACUUM: cope with right sibling link corruption. Peter Geoghegan <pg@bowt.ie>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox