Repository navigation
fix: preserve traversal and PD client contracts - #3395
Conversation
- retain encoded algorithm values and scan failure causes - stabilize filtered iteration and spilled group matching - preserve PD lock interruption and discovered leader routing - document lifecycle contracts and cover public call paths
- retain callback order after individual listener failures - preserve cache failures and fatal error propagation - cover public watch dispatch with deterministic channels - document failure isolation without automatic replay
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3395 +/- ##
============================================
+ Coverage 55.93% 57.18% +1.25%
- Complexity 2277 2778 +501
============================================
Files 774 776 +2
Lines 68534 68907 +373
Branches 9333 9425 +92
============================================
+ Hits 38334 39406 +1072
+ Misses 26634 25875 -759
- Partials 3566 3626 +60
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bitflicker64
left a comment
There was a problem hiding this comment.
Blocking: no. Score: 10/10. Covers 5f70abe.
The fixes match the PR description and the new tests cover them. The new store and server tests pass locally. CI is green; an earlier docker-build failure was a Maven Central 502 and passed on rerun.
Two older wrong-result bugs sit in these iterators. Neither is in the changed lines or made worse here:
- Important: BackendColumn has no hashCode, so in-memory counts never merge equal rows from real scans (see inline).
- Important: once a union spills (over 10000 candidate rows), NoRepeatValueIterator (UnionFilterIterator.java:182-238) drops every key seen more than once, which is every key the wrapper sends there. The in-memory path and MapUnionIterator (BusinessHandlerImpl.java:624) return each key once. A probe with 20000 keys read twice returns 0 rows. Worth a follow-up issue or a TODO.
- Note: the RecordFactory switch expression and instanceof patterns are unrelated refactors that make backports a little harder.
| BackendColumn second = BackendColumn.of(new byte[]{2}, new byte[]{12}); | ||
| BackendColumn third = BackendColumn.of(new byte[]{3}, new byte[]{13}); | ||
| List<BackendColumn> rows = kind == FilterKind.UNION_UNIQUE ? List.of(first, second, third) : | ||
| Arrays.asList(first, second, third, first, second, third); |
There was a problem hiding this comment.
Important: these fixtures reuse three BackendColumn objects, so the counts here merge rows by identity. BackendColumn overrides equals but not hashCode (RocksDBSession.java:1075), and real scans build a new object per row (RocksDBScanIterator.java:179).
With a new object per row, IntersectionFilterIterator (size 2) over 100 keys read twice returns 0 rows instead of 100, and UnionFilterIterator returns 200 instead of 100. Only the in-memory paths are affected (below 100000 intersection or up to 10000 union candidates); the intersection spill path compares by name and is correct.
Older than this PR and not blocking. Could the fixtures build a new BackendColumn.of(...) per row, with hashCode from name and value added here or in a follow-up issue?
Purpose of the PR
Counterpart: hugegraph#331. Both PRs use the same source branch.
Algorithm results and filtered queries can lose data or leave scans open. PD lock initialization and leader discovery can use the wrong failure or routing path, and one failing watch listener can stop notifications for every listener. This cleanup preserves API signatures, configuration, retry budgets and stored formats.
Main Changes
Watch cache updates and fatal errors retain their existing propagation; failed business-listener work is not retried automatically.
Shared counting logic removes duplication. Small switch-expression and instanceof cleanups use stable Java 17 syntax.
Verifying these changes
An existing local PD discovery test showed intermittent connection failures before the final selected suite passed. Multi-node cluster validation is not included.
Does this PR potentially affect the following parts?
Documentation Status
Doc - Done: in-repository lifecycle contracts are updated.See storage lifecycle contracts. No website configuration or API-reference changes are required.
设计图解
以下图片说明本次状态、资源关闭和 PD 通知契约,不代表运行、性能或集群验收结果。
遍历消费与资源收尾
PD 路由与监听器隔离