Repository navigation
perf(readutil): preserve early filtering across fallback paths - #25853
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? |
LeftHandCold
left a comment
There was a problem hiding this comment.
Reviewed the OR union iterator, tombstone path, immutable IN/PREFIX_IN lookup, partial-AND compilation, fallback semantics, iterator ownership, and observability changes. The subset compilation remains fail-open/safe because residual expressions still evaluate the full predicate; OR remains all-or-nothing. Child iterators are closed on all owning paths, prefix/disjunct state is bounded by filter input, and the new immutable lookup is race-safe. Owning-package tests, focused race tests (10x), and a 10,000-case PREFIX_IN differential check all passed. No blocking issues found.
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
No blocking or non-blocking correctness findings in b7fa79d relative to origin/main. Focused Go tests could not run because this checkout lacks the required MatrixOne CGo library (cgo/libmo.dylib).
…xorigin#25853) ## What type of PR is this? - [ ] API-change - [ ] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#25588 ## What this PR does / why we need it: This PR preserves early filtering across three safe but expensive fallback paths: - represents OR-ed primary-key filters as atomic specs and heap-merges partition-state iterators, including tombstones, with overlap deduplication; - replaces the `PREFIX_IN > 4` pass-through with an immutable, sorted prefix index and eagerly builds the regular `IN` lookup; - preserves compilable conjuncts in top-level and nested `AND` filters while keeping `OR` compilation all-or-nothing. It also exposes disjunct/key counts for observability and adds BVT coverage for committed partition-state rows, persisted mixed filters, large compound-PK prefix lists, NULLs/duplicates, overlapping OR branches, and workspace rows. ### Testing - owning-package tests: `readutil`, `logtailreplay`, and `disttae` - focused race tests (`-count=10`) and stress tests (`-count=100`) - full owning-package race tests - `go vet` and `go build` for modified packages - `make build` - local mo-tester BVT against the branch-built server: 23/23 passed (100%) - benchmark with 8,192 encoded keys and 1,024 prefixes: about 0.37-0.48 ms/op, 0 alloc/op
…xorigin#25853) ## What type of PR is this? - [ ] API-change - [ ] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#25588 ## What this PR does / why we need it: This PR preserves early filtering across three safe but expensive fallback paths: - represents OR-ed primary-key filters as atomic specs and heap-merges partition-state iterators, including tombstones, with overlap deduplication; - replaces the `PREFIX_IN > 4` pass-through with an immutable, sorted prefix index and eagerly builds the regular `IN` lookup; - preserves compilable conjuncts in top-level and nested `AND` filters while keeping `OR` compilation all-or-nothing. It also exposes disjunct/key counts for observability and adds BVT coverage for committed partition-state rows, persisted mixed filters, large compound-PK prefix lists, NULLs/duplicates, overlapping OR branches, and workspace rows. ### Testing - owning-package tests: `readutil`, `logtailreplay`, and `disttae` - focused race tests (`-count=10`) and stress tests (`-count=100`) - full owning-package race tests - `go vet` and `go build` for modified packages - `make build` - local mo-tester BVT against the branch-built server: 23/23 passed (100%) - benchmark with 8,192 encoded keys and 1,024 prefixes: about 0.37-0.48 ms/op, 0 alloc/op
…xorigin#25853) ## What type of PR is this? - [ ] API-change - [ ] BUG - [x] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#25588 ## What this PR does / why we need it: This PR preserves early filtering across three safe but expensive fallback paths: - represents OR-ed primary-key filters as atomic specs and heap-merges partition-state iterators, including tombstones, with overlap deduplication; - replaces the `PREFIX_IN > 4` pass-through with an immutable, sorted prefix index and eagerly builds the regular `IN` lookup; - preserves compilable conjuncts in top-level and nested `AND` filters while keeping `OR` compilation all-or-nothing. It also exposes disjunct/key counts for observability and adds BVT coverage for committed partition-state rows, persisted mixed filters, large compound-PK prefix lists, NULLs/duplicates, overlapping OR branches, and workspace rows. ### Testing - owning-package tests: `readutil`, `logtailreplay`, and `disttae` - focused race tests (`-count=10`) and stress tests (`-count=100`) - full owning-package race tests - `go vet` and `go build` for modified packages - `make build` - local mo-tester BVT against the branch-built server: 23/23 passed (100%) - benchmark with 8,192 encoded keys and 1,024 prefixes: about 0.37-0.48 ms/op, 0 alloc/op
What type of PR is this?
Which issue(s) this PR fixes:
issue #25588
What this PR does / why we need it:
This PR preserves early filtering across three safe but expensive fallback paths:
PREFIX_IN > 4pass-through with an immutable, sorted prefix index and eagerly builds the regularINlookup;ANDfilters while keepingORcompilation all-or-nothing.It also exposes disjunct/key counts for observability and adds BVT coverage for committed partition-state rows, persisted mixed filters, large compound-PK prefix lists, NULLs/duplicates, overlapping OR branches, and workspace rows.
Testing
readutil,logtailreplay, anddisttae-count=10) and stress tests (-count=100)go vetandgo buildfor modified packagesmake build