Repository navigation
fix(core): keep later ranges local after barrier - #3483
Conversation
- push only the first range step into the backend query - keep later ranges after a barrier as local steps - fix Invalid range and wrong counts for g.V() ranges - fix empty results for out() ranges after a barrier - add regression tests in VertexCoreTest and EdgeCoreTest Fixes apache#2216
Codecov Report❌ Patch coverage is
Additional details and impacted files
*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: 9/10. Summary: extractRange() pushes only the first range into the backend query and keeps later ranges after a barrier as local steps, which fixes Invalid range and the wrong counts from #2216; the new VertexCoreTest and EdgeCoreTest cases fail on master and pass at this head on memory and RocksDB.
imbajin
left a comment
There was a problem hiding this comment.
Score: 9.0/10 · Confidence: medium
Blocking: no
Summary
The first range is pushed down while later ranges remain local, preserving their stream-relative coordinates.
Evidence
Reviewed extractRange and both GraphStep and VertexStep callers. The added vertex and edge tests cover separated ranges. GitHub reports memory and RocksDB jobs successful.
Validation notes
I did not run the tests independently or exercise other storage backends.
Purpose of the PR
g.V().range(2, 3).barrier().range(0, 1)throwsInvalid range: [2, 1)instead of returning 1 vertex.extractRange() walks past the barrier and pushes both ranges into the same Query, so Query.range() treats the second range as if it was on the original stream. Only the first range should go to the backend, the second one applies to what's left after the first.
While testing I found two more cases with the same cause that don't throw but return wrong results:
g.V().range(1, 6).barrier().range(3, 8)returns 3 vertices instead of 2g.V(id).out().range(2, 3).barrier().range(0, 1)returns 0 instead of 1Main Changes
Adjacent ranges like
range(1, 6).range(4, 8)aren't affected, TinkerPop merges them before our strategy runs.Verifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODO: required documentation is pending; complete it before merging.Doc - Done: documentation is included here or linked below.Doc - No Need: no user-visible documentation is affected.Documentation files in this PR or paired hugegraph-doc PR: