Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for invalid down link while prefetching B-Tree leave pages for index-only scan #534

Merged
merged 6 commits into from
Dec 13, 2024

Conversation

knizhnik
Copy link

No description provided.

Comment on lines 893 to 894
else if (!BlockNumberIsValid(so->next_parent))
elog(FATAL, "btpo_next is invalid");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opaque->ptpo_next can be P_NONE, but IIUC that is 0, not InvalidBlockNumber. I don't understand how it could be InvalidBlockNumber.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the check isn't wrong per se, I think this is irrelevant as btpo_prev shouldn't be InvalidBlockNumber, ever.

Same comment on the same addition around line 908-912 - I think both can be reverted.

@knizhnik knizhnik force-pushed the ios_prefetch_fix_v17 branch from 4fc8da9 to 424b5ba Compare December 1, 2024 15:59
Copy link

@MMeent MMeent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is an improvement over the previous version, but seems to have some additions that I'd rather see gone.

Comment on lines 893 to 894
else if (!BlockNumberIsValid(so->next_parent))
elog(FATAL, "btpo_next is invalid");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the check isn't wrong per se, I think this is irrelevant as btpo_prev shouldn't be InvalidBlockNumber, ever.

Same comment on the same addition around line 908-912 - I think both can be reverted.

src/backend/access/nbtree/nbtsearch.c Outdated Show resolved Hide resolved
@knizhnik knizhnik force-pushed the ios_prefetch_fix_v17 branch from 398fb77 to 9b1bcff Compare December 12, 2024 06:00
@knizhnik knizhnik requested a review from MMeent December 13, 2024 15:06
@knizhnik knizhnik merged commit 010c0ea into REL_17_STABLE_neon Dec 13, 2024
1 check passed
@knizhnik knizhnik deleted the ios_prefetch_fix_v17 branch December 13, 2024 16:30
github-merge-queue bot pushed a commit to neondatabase/neon that referenced this pull request Dec 13, 2024
…index-only scan (#9867)

## Problem

See #9866

Index-only scan prefetch implementation doesn't take in account that
down link may be invalid

## Summary of changes

Check that downlink is valid block number


Correspondent Postgres PRs:
neondatabase/postgres#534
neondatabase/postgres#535
neondatabase/postgres#536
neondatabase/postgres#537

---------

Co-authored-by: Konstantin Knizhnik <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants