Repository navigation
feat(bolt): work with the official Neo4j drivers (KG-15) - #51
Merged
Merged
Conversation
The handshake accepted only the exact proposal 0x00000404, while drivers offer 4.4 as a range (4.4..4.2), so no official driver could connect. It now accepts the first proposal whose range includes 4.4. The SUCCESS after PULL carries type and the update counters. query.ResultSet gets Stats (nodes-created, nodes-deleted, relationships-created, relationships-deleted, properties-set, labels-added), set by CREATE, MERGE, SET and DELETE and kept through WHERE/RETURN/ORDER BY/LIMIT. The cluster RPC carries them and the router adds them up across shards. Nodes and edges go over Bolt as Node (0x4E) and Relationship (0x52) structures instead of maps, with an integer id hashed from the KafGraph id (Bolt 4.4 needs integers). HTTP is unchanged. GOODBYE closes the connection without a FAILURE. Smoke cases COMP-kafgraph-03, -05, -06 and -11 now pass with neo4j-go-driver/v5 and are no longer pending. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
KafGraph's Bolt server works with the official Neo4j driver (
neo4j-go-driver/v5). Smoke cases COMP-kafgraph-03, -05, -06 and -11 now run and pass; they are removed frompendingintest/smoke, and KG-15 is no longer named for cases 04 and 12.internal/server/bolt.go): accepts the first proposal whose version range includes 4.4. Drivers send[0, range, minor, major], e.g. 4.4 down to 4.2. Before, only the exact value0x00000404was accepted, so no driver could connect.query.ResultSethasStats(nodes-created,nodes-deleted,relationships-created,relationships-deleted,properties-set,labels-added). They are set by CREATE (node and edge), MERGE (only when it creates), SET and DELETE, and passed through WHERE/RETURN/ORDER BY/LIMIT. The SUCCESS after PULL carriestype(w/r) andstats. In a cluster, the RPC carries the counters and the router adds them up.docs/query-engine.md(handshake, summary, graph values),docs/architecture.md.HTTP is unchanged:
/api/v1/querybuilds its own output and keeps returning maps.Checks
make lint(golangci-lint v2.15.0, 0 issues), gosec,make fmt-check,make vet,make test-race,make cover-check,hack/license-header.sh,make docs-sync-checkandmake test-smokepassed.make test-smoke: cases 03, 05, 06, 11 and 14 pass with the official driver, and the other 9 are skipped with their KG entries.Review
A reviewer with fresh context read the diff. Fixed in this PR:
nodes-deletedcounted delete attempts. Now each existing node is counted once, and the edges removed with it count asrelationships-deleted.properties-set.Open, for a decision
id. KafGraph'sCREATE (a)-[:R]->(b)takes node IDs, so a client that uses only Bolt cannot link the nodes it creates. Bolt 5.0 haselement_id, which could carry the KafGraph ID. That would be a new roadmap row.typefollows the counters, not the statement. A MERGE that only finds a node reportsr; Neo4j reportsrw.disableLosslessIntegersis on. They are fine with the default (lossless).id,label,properties,createdAt) is sent back as a Node.nodes-created: N.MATCH (n {trace_id:…}) DETACH DELETE n) does not parse, so smoke nodes stay on an external target.Decision.immutable=true(from the plan's implementation note) is still not covered.Ref: KG-15
🤖 Generated with Claude Code