Repository navigation
fix(merge): handle objects without sort-key zonemaps - #25653
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
最新 head 看下来这个修复方向是对的,我这里没有剩余 blocker,可以 approve。
关键点已经收住了:
- all-uninitialized sort-key zonemap 不再报内部错误,而是明确落到“无 overlap interval / 无 merge task”;
CalculateOverlapStats和GatherOverlapMergeTasks的 nil/empty 分支都补齐了;processed <= 0的 further-stat 防护也到位了,避免再掉到除零。
非阻塞建议:后面可以再顺手补两组小覆盖——多对象 all-uninitialized,以及 constant + uninitialized 命中 processed <= 0 的路径。但这些我不作为 blocker。
Merge Queue Status
This pull request spent 29 minutes 20 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #25653 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
) ## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes: Related to matrixorigin#22258 ## What this PR does / why we need it: Tables without an explicit primary key use a fake primary key that is not a sort key. After flush, their object stats therefore have no initialized sort-key zonemap. This is valid: L0 compaction still merges these objects by size/count, but overlap statistics previously returned the misleading internal error `no valid intervals with initialized zonemaps`. Treat an all-uninitialized sort-key-zonemap input as having no overlap intervals: retain the scan/uninitialized counts, return no overlap merge tasks, and avoid division by zero when detailed statistics are requested. This does not alter L0 compaction or overlap scheduling for objects with initialized zonemaps. ## Tests - `go test ./pkg/vm/engine/tae/db/merge -count=1` - `go test -race ./pkg/vm/engine/tae/db/merge -run TestOverlapStatsWithoutInitializedZoneMap -count=1` Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
) ## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes: Related to matrixorigin#22258 ## What this PR does / why we need it: Tables without an explicit primary key use a fake primary key that is not a sort key. After flush, their object stats therefore have no initialized sort-key zonemap. This is valid: L0 compaction still merges these objects by size/count, but overlap statistics previously returned the misleading internal error `no valid intervals with initialized zonemaps`. Treat an all-uninitialized sort-key-zonemap input as having no overlap intervals: retain the scan/uninitialized counts, return no overlap merge tasks, and avoid division by zero when detailed statistics are requested. This does not alter L0 compaction or overlap scheduling for objects with initialized zonemaps. ## Tests - `go test ./pkg/vm/engine/tae/db/merge -count=1` - `go test -race ./pkg/vm/engine/tae/db/merge -run TestOverlapStatsWithoutInitializedZoneMap -count=1` Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
) ## What type of PR is this? - [x] BUG ## Which issue(s) this PR fixes: Related to matrixorigin#22258 ## What this PR does / why we need it: Tables without an explicit primary key use a fake primary key that is not a sort key. After flush, their object stats therefore have no initialized sort-key zonemap. This is valid: L0 compaction still merges these objects by size/count, but overlap statistics previously returned the misleading internal error `no valid intervals with initialized zonemaps`. Treat an all-uninitialized sort-key-zonemap input as having no overlap intervals: retain the scan/uninitialized counts, return no overlap merge tasks, and avoid division by zero when detailed statistics are requested. This does not alter L0 compaction or overlap scheduling for objects with initialized zonemaps. ## Tests - `go test ./pkg/vm/engine/tae/db/merge -count=1` - `go test -race ./pkg/vm/engine/tae/db/merge -run TestOverlapStatsWithoutInitializedZoneMap -count=1` Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
Related to #22258
What this PR does / why we need it:
Tables without an explicit primary key use a fake primary key that is not a sort key. After flush, their object stats therefore have no initialized sort-key zonemap. This is valid: L0 compaction still merges these objects by size/count, but overlap statistics previously returned the misleading internal error
no valid intervals with initialized zonemaps.Treat an all-uninitialized sort-key-zonemap input as having no overlap intervals: retain the scan/uninitialized counts, return no overlap merge tasks, and avoid division by zero when detailed statistics are requested. This does not alter L0 compaction or overlap scheduling for objects with initialized zonemaps.
Tests
go test ./pkg/vm/engine/tae/db/merge -count=1go test -race ./pkg/vm/engine/tae/db/merge -run TestOverlapStatsWithoutInitializedZoneMap -count=1