airborne12 opened a new pull request, #66864:
URL: https://github.com/apache/doris/pull/66864
### What problem does this PR solve?
Issue Number: None
Related PR: #66052
Problem Summary:
A CRC-valid SNII BKD index whose split catalogue was ordered but outside its
persisted global bounds could open successfully and silently route queries to
the wrong leaf. The issue reproduces with values 0 through 19 split into two
leaves: changing the persisted split from 10 to 30 makes a point lookup for 15
inspect leaf 0 while the matching point remains in leaf 1.
This PR validates the complete non-decreasing `min_value <= split_values...
<= max_value` chain when opening the index and asserts the same invariant when
encoding. Equal adjacent values and splits equal to either inclusive global
bound remain valid.
### Release note
SNII BKD readers now reject corrupted indexes whose global bounds and split
catalogue disagree.
### Check List (For Author)
- Test
- [ ] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- Behavior changed:
- [ ] No.
- [x] Yes. Corrupted SNII BKD indexes with inconsistent global bounds or
split values are rejected at open. Valid existing indexes are unaffected. The
storage format and written bytes are unchanged, so existing indexes are
upgrade-compatible.
- Does this need documentation?
- [x] No.
- [ ] Yes. (add document PR link here)
- Release notes must contain the following three elements:
- [x] Problem Summary
- [x] User-visible Changes
- [x] Compatibility (storage format, upgrade, downgrade, rolling
upgrade, etc.)
### Tests
- TDD RED: four corruption expectations opened successfully before the fix;
the inclusive-boundary control passed
- Focused ASAN BE unit tests: 5/5 passed after the fix
- Relevant ASAN BE unit tests:
`SniiBkdIndexBlock.*:BkdCorruptionTest.*:BkdReaderTest.*` (80/80 passed)
- Full BE build: `./build.sh --be -j 192`
- BE format check: `build-support/check-format.sh`
### Reviewer Checklist
- [ ] The title is of the form `type(scope): [Issue #xxx] summary`
- [ ] The PR has a detailed problem description
- [ ] The PR has a detailed solution description
- [ ] The PR has a detailed test plan
- [ ] The PR has a detailed compatibility description
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]