Repository navigation
fix(#12519): a gRPC projection row with a @type column stays a projection - #13203
Conversation
…tion, only the rows a follower rebuilt from its leader's JSON are typed The gRPC service recovered the record type of any non-element row from its @type property, because a row forwarded from the Raft leader is rebuilt on the follower as a plain ResultInternal made of a map (#4688). A local projection such as SELECT @type, name FROM P has the same shape, so the client read it as a record of that type and the row lost its columns. The follower now marks the rows it builds from the leader's JSON (ResultInternal.FORWARDED_ROW_METADATA) and the service recovers the type only for a marked row, which also makes the holdsRecordColumn guess of #12196 unnecessary.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 30 minutes. View limit details
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. |
|
This pull request is merged. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
🟢 Coverage 100.00% diff coverage · -4.09% coverage variation
Metric Results Coverage variation ✅ -4.09% coverage variation Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (28140cb) 302634 267117 88.26% Head commit (064af07) 336240 (+33606) 283030 (+15913) 84.17% (-4.09%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#13203) 7 7 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Triage: LGTM. The fix replaces the
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13203 +/- ##
=========================================
Coverage 80.44% 80.44%
Complexity 582 582
=========================================
Files 2629 2629
Lines 302634 302632 -2
Branches 67070 67069 -1
=========================================
- Hits 243458 243457 -1
+ Misses 35557 35544 -13
- Partials 23619 23631 +12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes #12519
Problem
Over gRPC,
SELECT @type, name FROM Preached the client as aRemoteImmutableVertexof typePwithout the@typecolumn.ArcadeDbGrpcService.convertResultToGrpcRecordrecovers the record type of any non-element row from a String@typeproperty, because a row forwarded from the Raft leader is rebuilt on the follower as a plainResultInternalmade of a map (#4688). A local projection with a column of that name has the same shape and took the same path. #12226 only narrowed the guess for rows holding a record column.Fix
ResultInternal.FORWARDED_ROW_METADATAis a metadata key in the engine, which grpcw already sees (grpcw must not depend on ha-raft).RaftReplicatedDatabase.parseResultSetFromJsonmarks every row it builds from the leader's JSON.convertResultToGrpcRecordrecovers the type only for a marked row.holdsRecordColumnis gone: it was a guess for the same problem.The key starts with
@, so noLETvariable or$depth-style metadata can read or shadow it.Limitation, same as before: a projection forwarded from the leader whose JSON has an
@typecolumn is indistinguishable from a forwarded record and stays typed.Tests
Issue12519GrpcProjectionTypeColumnTest(grpcw, unit): the converter on a plain projection row with an@typecolumn (no mark: stays a projection, column kept, also with a list column) and on a marked row (typed).RaftReplicatedDatabaseTest.parseResultSetFromJsonMarksEveryRowItBuilds(ha-raft, unit).Issue12519GrpcProjectionTypeColumnIT(grpc-client):SELECT @type, name,SELECT @type, out() AS friends, CypherRETURN 'P' AS@type, collect(n), the streamed form, and a whole record still a record.Issue12519GrpcFollowerRowTypeIT(grpcw, 2-node Raft): an INSERT forwarded by a follower answers a typed record, a localSELECT @type, nameon the follower stays a projection. Without the mark the forwarded half fails.Also run:
TimeSeriesGrpcForwardedInsertTypeIT,TimeSeriesGrpcInsertResultTypeIT,Issue12196GrpcRecordRowsIT, all grpc-client ITs, the grpcw unit tests and a set of grpcw ITs (including the follower forwarding ones).