Skip to content

A Graph Analytical View's dense node ids can exceed getNodeCount() once a base vertex is deleted, so algo.* silently drops nodes #6792

Closed

Description

@lvca

Raised in review of PR #6788 (issue #6315), verified to be independent of it.

What happens

GraphAnalyticalView.getNodeCount() answers DeltaOverlay.getTotalNodeCount() while an overlay is active:
baseNodeCount - deletedBase + overflowCount - deletedOverflow. The dense id space is not renumbered to
match. Delete one base vertex and the surviving vertices keep the ids they had, so the largest live id is now
nodeCount or more.

AbstractAlgoProcedure.GraphData sizes every array from that count and iterates 0..nodeCount-1, so:

  • a live vertex whose id landed above the count is never visited - it is silently absent from the answer
    of every algo.* procedure, which is a wrong result with no exception;
  • a neighbour id above the count indexes out of the arrays - AlgoAPSP's dist[i][j] and AlgoMaxFlow's
    capacity[i][j] are the two that index by neighbour rather than only iterating, so an
    ArrayIndexOutOfBoundsException is reachable in principle.

Reproduced on fix/6315-edge-property-overlay-resolution with a three-vertex graph (A, B, SPARE), a
SYNCHRONOUS view with compaction disabled, SPARE deleted and one vertex added:

nodeCount=2
  A=2  out=[1]  in=[]      <- id 2 with a node count of 2: A is never iterated
  B=1  out=[0]  in=[2]     <- and B reports a neighbour that indexes past every array
  FRESH=0

Not caused by #6315

Checked deliberately, because that PR gave the weighted columnar path a new way to produce these ids. It is
not the source: the same run with the view materialising no edge property columns - which sends the same
procedure down weightedAdjacencyFromRecords instead, the path that existed before - produces byte-identical
ids and the same answer. getNeighborIds has always served overlay ids, and getNodeId has always resolved
them, so every path into GraphData could already carry one.

What it would take

Either the id space or the count has to move, and they are not equally cheap:

  • renumber on every overlay change - correct, and defeats the point of an overlay;
  • make getNodeCount() the id-space bound rather than the live-vertex count, i.e. answer
    baseNodeCount + overflowCount, and let the deleted ids be holes the callers already have to tolerate
    (getRID answers null for them, and GraphData.getVertex already skips a null). This looks closest to
    what the callers assume, but getNodeCount() is public API and its current answer is the honest one for
    anyone asking "how many vertices are in this view";
  • have GraphData size itself from the id space and keep getNodeCount() meaning what it says, which
    needs a second accessor for the bound.

The third is the one that changes no existing meaning. Worth a regression test that walks every algo.*
procedure over a view with both a deleted base vertex and an added one.

Activity

  1. added this to the 26.9.1 milestone on Aug 27, 2026
  2. self-assigned this
    on Aug 27, 2026
  3. added 2 commits that reference this issue on Aug 29, 2026
  4. added a commit that references this issue on Aug 29, 2026
  5. added a commit that references this issue on Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions