Repository navigation
Description
Raised in review of PR #6714 (issues #6316/#6265/#6318/#6705) and deliberately not folded into it: it names a real, pre-existing architectural gap that predates that PR and would need an SPI-level change larger than a review-response round should attempt.
The gap
AbstractAlgoProcedure.GraphData.weightedAdjacencyFromColumns throttles its WorkGuard per node:
for (int i = 0; i < nodeCount; i++) {
guard.checkPeriodically(i);
final NodeEdgeWeights edges = provider.edgeWeightsOf(i, dir, weightProperty, 1.0, types);
...
}GraphTraversalProvider#edgeWeightsOf's default implementation (the only one; GraphAnalyticalView does not override it) is O(degree) with no checkpoint of its own:
default NodeEdgeWeights edgeWeightsOf(...) {
...
for (final String type : types)
for (final Vertex.DIRECTION d : directions) {
final int[] slice = getNeighborIds(nodeId, d, type);
...
for (int j = 0; j < slice.length; j++) {
// no interrupt/timeout check anywhere in this loop
}
}
}So a single call for a supernode (a vertex with a very large fan-out) is one unabortable unit of work: once entered, nothing can stop it until it returns, regardless of arcadedb.command.timeout or a thread interrupt.
Why it's newly relevant
The helper itself is not new - algo.steinerTree and algo.bellmanFord already read weights through it. What #6316 changed is that four more procedures (algo.mst, algo.msa, algo.maxFlow, algo.kShortestPaths) can now reach this same columnar path when a Graph Analytical View has the weight property materialized as a column, where previously they always used a hand-rolled OLTP walk with genuinely per-edge WorkGuard throttling (guard.checkPeriodically(edgeStep++), one increment per edge - visible in the pre-#6316 version of e.g. AlgoMST, which had a comment specifically about this: "Throttled by EDGE rather than by vertex: a near-star graph puts millions of edges inside a single vertex iteration, and a per-vertex checkpoint would leave that whole node unabortable"). That protection is preserved in weightedAdjacencyFromRecords (the record-based fallback, still per-edge) but not in the columnar path six procedures now share.
Why not fixed in #6714
A correct fix needs a checkpoint hook inside provider.edgeWeightsOf's own O(degree) loop, which means either:
- widening
GraphTraversalProvider's SPI to accept aWorkCheckpoint/similar and pushing the per-edge check into every implementer (the interface's only implementation today is the default method, but it's still an SPI contract change), or - restructuring the columnar build to pull neighbour/weight slices in bounded chunks rather than one array-returning call per node.
Either is a real design decision (chunk size, whether the check belongs in the SPI vs. the caller, whether it costs anything on the hot path for the common non-supernode case) that deserves its own review, not a fix bundled into an already-large PR whose own scope is CSR routing and buffer reuse.
Suggested shape
Mirror what issue #6318 did for GraphAlgorithms.localClusteringCoefficient's two parallel phases: give edgeWeightsOf (or a new bulk variant of it) a WorkCheckpoint-shaped hook, called at a bounded stride inside its per-edge loop, and thread a checkpoint from weightedAdjacencyFromColumns through it. That keeps the "checkpoint stays on a single logical thread of control, called between chunks" contract #6318 established, applied one level deeper.
Activity
docs: document weightedAdjacencyFromColumns's per-node checkpoint gra…
lvca commentedon Aug 25, 2026
PR #6714 review round 9 added a sharper angle on this same gap: it's not only an abort-latency issue but a memory-budget one too.
provider.edgeWeightsOf(i, ...)fully materializesneighbors[i]/weights[i]for nodeibeforeweightedAdjacencyFromColumns'sreserveWeightedAdjacencygets a chance to check the accumulatedentriescount againstCYPHER_ALGO_MAX_WORKING_MEMORY- so a single supernode's arrays can already exceed the configured budget before the next checkpoint/reservation fires. Same root cause (no hook insideedgeWeightsOf's own O(degree) loop), same fix (a checkpoint/reservation hook inside that loop) - just a second, and arguably sharper (OOM risk, not only slow abort), consequence worth keeping in mind when this gets picked up.fix: bound checkpoint batch size, revert labelPropagation ThreadLocal…
fix: reserve before allocating row-header arrays; test comment/robust…
Merge pull request #6717 from ArcadeData/fix/6715-6716-edgeweights-ch…
lvca commentedon Aug 25, 2026
Fixed in #6717 (merged).
When a graph algorithm query ran over a Graph Analytical View and hit a "supernode" (a vertex with a very large number of edges), the query could not be aborted or timed out while processing that one node, and its memory usage wasn't checked against the configured working-memory limit either. Both are now fixed: the query can be interrupted or hit its timeout mid-node instead of only between nodes, and memory usage is checked as it accumulates.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
Merge branch 'main' into fix/6316-6265-6318-6705-algo-and-avg-empty-g…
fix(ArcadeData#6715, ArcadeData#6716): per-edge checkpoint in edgeWei…
style: rewrap an over-long javadoc line in the #6715 checkpoint test
test: consolidate the Issue*Test classes of the other openCypher sub-…
test: consolidate the Issue*Test classes of the other openCypher sub-…