Repository navigation
Conversation
…before the call buffers anything GraphBatch.newEdge() takes its endpoints on trust. A RID of no record, or of a document, failed only at flush or close, after the edge records were written, and then no vertex led to the edges of the load. Both builds now check every endpoint before the first edge of a call is buffered: EdgeBatcher on the JVM build, NativeExtras (and a check_endpoints op) on the native one. The check is the one the engine's requireVertex makes; it is written here because the native build also links 26.11.1, which does not have that method.
Collaborator
Author
|
Decided on 2026-11-30, as the current decision and open to change: this stays out of 26.12.1 and moves to 27.1.1, with #506. I set the milestone. It rests on what the change does to callers: a bad endpoint raises at the call instead of at |
This branch has not been deployed
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 does this PR do?
graph_batch()in both packages now refuses an edge endpoint that is not an existing vertex, before it buffers any edge of the call, and names the RID. A refused call buffers nothing and the batch stays usable. A RID of no record raisesRecordNotFoundError, and a RID of a document or an edge raisesArcadeDBError.Please do not merge yet. I still have to decide whether this goes into 26.12.1.
I reproduced the failure on
main(CI-builtarcadedb-jvmwheel): one batch of 9 edges between 10 new vertices, one of them with a bad endpoint.new_edgeandnew_edgesgave the same result, nothing was refused when the edge was buffered, andclose()raised:out()in()close()RecordNotFoundErrorRecordNotFoundErrorRecordNotFoundErrorClassCastExceptionClassCastExceptionWhat changes for a caller: a call with a bad endpoint raises at once instead of at
flush()orclose(). An endpoint that does not exist yet when the edge is buffered (for example one that another thread has not committed) is now refused too. A vertex deleted between the call and the flush is still not caught.The check is the one
GraphBatch.requireVertexmakes in engine 26.12.1. It is written in the bindings because pull request builds of the native package link 26.11.1, which does not have that method.Related issues
Closes #506
Performance changes
The check adds one record lookup and one type lookup for each endpoint of each edge, with no cache. I will add the timed A/B result as a comment once CI has built the wheels, and it should be read before any merge.
Docs
how-to/bulk-loads.adoc(new section "Edge endpoints in a graph batch") and the docstrings ofnew_edgeandnew_edges.Checklist
tests/test_graph_batch_bad_endpoints.py, runs on both packages)uvx pre-commit run --files <changed files>passes