pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix _bt_readnextpage half-dead leftmost page assert. 3+ messages / 1 participants [nested] [flat]
* pgsql: Fix _bt_readnextpage half-dead leftmost page assert. @ 2026-10-15 16:18 Peter Geoghegan <pg@bowt.ie> 0 siblings, 0 replies; 3+ messages in thread From: Peter Geoghegan @ 2026-10-15 16:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix _bt_readnextpage half-dead leftmost page assert. Backwards scans that reach a half-dead leftmost leaf page step over the page without calling _bt_readpage. This happens whenever the most recent _bt_lock_and_validate_left call returned a half-dead leftmost page. An assertion within _bt_readnextpage failed to consider this, causing it to fail spuriously. To fix, make the assertion accept the case where currPage doesn't match lastcurrblkno as long as blkno is P_NONE (it's always P_NONE when the last leaf page examined by _bt_readnextpage is either the leftmost or rightmost page). Oversight in commit caca6d8d27. Author: Peter Geoghegan <pg@bowt.ie> Backpatch-through: 18 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/931ce42ef9c891b5657d395abf3357a1db4a8974 Modified Files -------------- src/backend/access/nbtree/nbtsearch.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix _bt_readnextpage half-dead leftmost page assert. @ 2026-10-15 16:18 Peter Geoghegan <pg@bowt.ie> 0 siblings, 0 replies; 3+ messages in thread From: Peter Geoghegan @ 2026-10-15 16:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix _bt_readnextpage half-dead leftmost page assert. Backwards scans that reach a half-dead leftmost leaf page step over the page without calling _bt_readpage. This happens whenever the most recent _bt_lock_and_validate_left call returned a half-dead leftmost page. An assertion within _bt_readnextpage failed to consider this, causing it to fail spuriously. To fix, make the assertion accept the case where currPage doesn't match lastcurrblkno as long as blkno is P_NONE (it's always P_NONE when the last leaf page examined by _bt_readnextpage is either the leftmost or rightmost page). Oversight in commit caca6d8d27. Author: Peter Geoghegan <pg@bowt.ie> Backpatch-through: 18 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/6d4ee9203686d0426ec089ce965a96a86ef4651d Modified Files -------------- src/backend/access/nbtree/nbtsearch.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Fix _bt_readnextpage half-dead leftmost page assert. @ 2026-10-15 16:18 Peter Geoghegan <pg@bowt.ie> 0 siblings, 0 replies; 3+ messages in thread From: Peter Geoghegan @ 2026-10-15 16:18 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix _bt_readnextpage half-dead leftmost page assert. Backwards scans that reach a half-dead leftmost leaf page step over the page without calling _bt_readpage. This happens whenever the most recent _bt_lock_and_validate_left call returned a half-dead leftmost page. An assertion within _bt_readnextpage failed to consider this, causing it to fail spuriously. To fix, make the assertion accept the case where currPage doesn't match lastcurrblkno as long as blkno is P_NONE (it's always P_NONE when the last leaf page examined by _bt_readnextpage is either the leftmost or rightmost page). Oversight in commit caca6d8d27. Author: Peter Geoghegan <pg@bowt.ie> Backpatch-through: 18 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/7a28f1d0280ac11c12aa27e36d330e751f4285fe Modified Files -------------- src/backend/access/nbtree/nbtsearch.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2026-10-15 16:18 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2026-10-15 16:18 pgsql: Fix _bt_readnextpage half-dead leftmost page assert. Peter Geoghegan <pg@bowt.ie> 2026-10-15 16:18 pgsql: Fix _bt_readnextpage half-dead leftmost page assert. Peter Geoghegan <pg@bowt.ie> 2026-10-15 16:18 pgsql: Fix _bt_readnextpage half-dead leftmost page assert. 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