Repository navigation
unionstore/art: avoid checkptr panic after final prefix chunk (tidb-8.5) - #2150
Conversation
Return before advancing pointers past the allocation after the final matching chunk. Add heap-allocated regression coverage for chunk boundaries, prefixes, depths, and tails. Fixes tikv#2116 Signed-off-by: zyguan <zhongyangguan@gmail.com> (cherry picked from commit ac35602) Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Chunk comparison and boundary tests internal/unionstore/art/art_node.go, internal/unionstore/art/art_node_test.go |
The chunk comparison returns the matched length when the final eight-byte chunk is consumed. Table-driven tests cover empty keys, exhausted and nonzero depths, aligned and unaligned lengths, matching and mismatching data, and both argument orders. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- tikv/client-go#2119: This PR applies the same fix and adds the same heap-allocation regression test on the master branch.
Suggested reviewers: you06, ekexium
Merge Risk: 
Minimal · up to d406e
-
No merge-blocking risk was identified.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfzjywxk, ekexium The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Backport of #2119 to
tidb-8.5, on top of the merged Go 1.27 upgrade #2122.Go 1.27 race/checkptr testing aborts when ART prefix comparison advances a pointer past the final matching 8-byte chunk. This currently blocks pingcap/tidb#72435 in both unit-test variants and the real-TiKV import tests. Return before advancing beyond the allocation; retain the original heap-allocation regression tests for chunk boundaries, prefixes, nonzero depths and trailing bytes. Public APIs are unchanged.
Validation on Linux/amd64 with Go 1.27.3:
go test -race -tags=intest ./internal/unionstore/art -count=1passed.git diff --check HEAD^ HEADpassed.The branch and dependencies remain based on
tidb-8.5; this does not pull the master dependency graph into the release branch.Summary by CodeRabbit