Skip to content

graph_batch accepts an edge to a RID that does not exist or is not a vertex, which can leave the whole load unreachable #506

In review

Description

@tae898

GraphBatch.new_edge and new_edges accept RID strings in both packages and pass them to the engine without checking them. The engine's newEdge trusts its endpoints. According to the engine change that documents this (engine PR 12912), a RID that does not exist, or that belongs to a document, fails only when the batch closes, after the edge records are written, and then no vertex leads to any edge of the load, the valid ones included. I want the bindings to refuse such an endpoint, or to say clearly that the caller must.

Endpoint given as a RID Engine HTTP and gRPC batch loaders in 26.12.1 graph_batch() in both packages
does not exist refused when read, naming the RID passed to the engine
is a document, not a vertex refused when read, naming the RID passed to the engine

The engine added GraphBatch.requireVertex(RID) for its loaders and left newEdge unchanged, because one record lookup per endpoint is wasted when the batch created the vertices itself. The bindings take RIDs from the caller, so the same question applies to them. The behaviour is older than 26.12.1, so this is not a release blocker.

Done when:

  • Either both packages refuse a bad RID endpoint when the edge is buffered, naming the RID, with the added cost measured on a large batch, or the docstrings and how-to/bulk-loads.adoc state the contract and what a bad endpoint does.
  • A test on both packages covers a RID that does not exist and a RID of a document.

Found while reviewing #503. From reading graph_batch.py, EdgeBatcher.java, NativeExtras.java, and the engine source; I have not reproduced the failure from Python.

Activity

  1. added this to the 27.1.1 milestone on Nov 27, 2026
  2. self-assigned this
    on Nov 27, 2026
  3. added
    bug
    native
    jvm
    on Nov 27, 2026
  4. added
    python
    in progress
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugin progressjvmnativepython

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions