GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Graph Analytical View (GAV) — CSR-based OLAP acceleration by lvca · Pull Request #3618 · ArcadeData/arcadedb Conversation
|
|
Warning Gemini is experiencing higher than usual traffic and was unable to create the summary. Please try again in a few hours by commenting |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Code Review: Graph Analytical View (GAV) Impressive and ambitious feature. The SPI abstraction is clean, the delta overlay design is clever, and the test coverage is thorough. Issues found, by severity: HIGH SEVERITY 1. compacting flag never reset on RejectedExecutionException - GraphAnalyticalView.applyDelta() After compacting.compareAndSet(false, true), if the executor submit throws RejectedExecutionException (executor shut down concurrently), the exception is likely swallowed in the post-commit callback. The compacting flag stays true permanently, silently disabling all future compaction for this view instance. Fix: wrap the submit in try/catch and call compacting.set(false) in the catch. 2. O(N^2) compaction cost per commit - DeltaOverlay.merge() merge() deep-copies the entire overlay state on every SYNCHRONOUS commit, even for single-edge transactions. For N commits before the 10000-edge compaction threshold, total work is O(N^2). Under sustained write rates this causes progressive latency and GC pressure. Consider a lazy-fold structure or a lower compaction threshold. MEDIUM SEVERITY 3. closeExecutor() holds class lock for 30 seconds - GraphAnalyticalView The synchronized(GraphAnalyticalView.class) block includes awaitTermination(30, SECONDS), blocking buildAsync() and onRelevantCommit() callers for up to 30 seconds during shutdown. Null the static field inside the lock and drain outside it. 4. GAV disabled for all multi-hop anonymous patterns - MatchRelationshipStep.canUseFastPath() Removing isInternalAnonymousVar blocks GAV for MATCH (a)-[*2..4]->(b) patterns. Space-prefixed anonymous variables do not capture edge data; they only track uniqueness. Consider whether uniqueness tracking can use internal dense IDs instead of full edge objects to re-enable CSR acceleration. 5. HashMap autoboxes int on every edge in NodeIdMapping.getGlobalId() bucketIdToIdx.get(rid.getBucketId()) autoboxes int on every call - O(E) boxing during CSRBuilder Phase B. Since ArcadeDB bucket IDs are small contiguous integers, a plain int array lookup table would eliminate all boxing and align with the zero-GC goal. 6. One RID allocation per neighbor in the hot query loop - NodeIdMapping.getRID() provider.getRID(neighbors) allocates one RID per result row. For analytics returning millions of neighbors this contradicts the zero-GC design goal. Lazy materialization (allocate RID only when it escapes the step) would help significantly. LOW SEVERITY 7. propertySampleSize not volatile but read from background threads Safe today (written before async work starts) but JMM does not formally guarantee visibility. Making it final (injected via constructor) would make the guarantee explicit. 8. Subtle JMM ordering not documented - MatchRelationshipStep.resolveGavProvider() The two separate volatile writes (gavProvider then gavProviderResolved) are correct per JMM: a reader seeing gavProviderResolved == true is guaranteed to see the preceding write to gavProvider. This reasoning is non-obvious; a comment explaining the happens-before chain would prevent a future regression. 9. ConcurrentHashMap inside GraphAnalyticalViewRegistry adds no value All access is guarded by synchronized(REGISTRY). The inner ConcurrentHashMap could be a plain HashMap. 10. Self-loop dedup relies on undocumented OLTP invariant - MatchRelationshipStep.getVertices() The invariant that each self-loop produces exactly 2 entries is not asserted or referenced. If the OLTP storage layer changes, selfLoopSeen % 2 == 0 silently produces wrong results. 11. WeakHashMap safety-net claim misleading - GraphTraversalProviderRegistry Providers hold strong references back to the database key so the WeakHashMap behaves as a regular HashMap during normal operation. The Javadoc should clarify the safety net only activates after all providers are unregistered. MINOR
Overall this is high-quality work. Main concerns before merging: compaction flag stuck-state bug (1), quadratic merge cost (2), and per-neighbor RID allocation (6) which causes GC pressure contradicting the zero-GC design principle. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
PR Review: Graph Analytical View (GAV) — CSR-based OLAP accelerationThis is an impressive and well-designed feature. The CSR-backed OLAP overlay is a solid approach to bridging OLTP and analytical workloads. The architecture, documentation, and test coverage are all notably thorough. Below are observations across correctness, performance, and style. ✅ Strengths
🐛 Potential Bugs1.
private boolean useWhenStale; This field is read by the query planner thread via 2. Import ordering in Lines 56–59 insert GAV-related imports out of alphabetical order within the import com.arcadedb.graph.Vertex; import com.arcadedb.graph.VertexInternal; import com.arcadedb.graph.GraphTraversalProviderRegistry; // ← out of order import com.arcadedb.graph.olap.GraphAnalyticalView; ... These should be sorted alphabetically with the other 3.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GAV Code Review test |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Graph Analytical View (GAV) - Code ReviewThis is a substantial and well-engineered feature addition. The architecture is sound and the implementation shows deep understanding of both graph OLAP patterns and ArcadeDB internals. Note: Replacing the test comment above with this full review. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Graph Analytical View (GAV) Code Review (1/4 - Architecture) STRENGTHS: CSR double-indexed layout ideal for OLAP. Snapshot atomic-swap gives lock-free reads. hasAnyProviders fast-path avoids sync cost. DeltaCollector thread-ID-keyed ConcurrentHashMap avoids ThreadLocal leaks. Schema extension persistence is clean. CONCERNS: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Graph Analytical View (GAV) Code Review (2/4 - Thread Safety and Performance) THREAD SAFETY: PERFORMANCE: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Graph Analytical View (GAV) Code Review (3/4 - Correctness and Code Style) CORRECTNESS: CODE STYLE (per CLAUDE.md): |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Graph Analytical View (GAV) Code Review (4/4 - Tests, Security, Summary) TEST COVERAGE: SECURITY: No concerns identified. HTTP endpoints for GAV CRUD will be protected by the existing DatabaseAbstractHandler authentication/authorization layer. SUMMARY - Key action items before merge:
Overall: very well done. The CSR + delta-overlay design and query planner integration are particularly impressive pieces of work. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Code Review — Graph Analytical View (GAV) CSR-based OLAP AccelerationThis is a substantial and architecturally sound feature. The core design — immutable 🔴 Bug —
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Code Review: Graph Analytical View (GAV) — CSR-based OLAP accelerationThis is a large and impressive feature adding a CSR-based OLAP overlay to ArcadeDB. The architecture is well-thought-out, with clean separation between the OLTP graph, the analytical layer, and the query planner integration. Below are observations grouped by severity. Critical / Correctness Issues1. Silent delta loss on buffer overflow (GraphAnalyticalView.applyDelta()) When pendingDeltas exceeds MAX_PENDING_DELTAS, the buffer is set to null. Subsequent calls to applyDelta() skip buffering entirely due to the if (pendingDeltas != null) guard, silently discarding committed transaction changes without any warning. A stale view is expected in OFF mode, but in SYNCHRONOUS mode this means the overlay diverges silently from reality. Consider logging a warning when deltas are dropped, and explicitly transitioning to STALE state in this scenario. 2. Mutable collections in DeltaOverlay private constructor The private constructor accepts HashMap, HashSet, ArrayList etc. and stores them without defensive copying. The merge() method constructs new collections from the old ones — if the caller retains a reference and mutates after construction, overlay state can be corrupted. Since the class is package-private this is manageable, but worth an explicit comment or assertion that the inputs are not retained by the caller post-construction. 3. NodeIdMapping.addNode() vs compact() race addNode() checks if (positionsBuilder == null) without synchronization. If compact() is called concurrently from another thread, positionsBuilder can become null between the null-check and the array access, causing a NullPointerException or data corruption. This is only relevant during the build phase if builds can run concurrently — likely safe today, but fragile for future changes. 4. CSRAdjacencyIndex — no bounds validation on degree/offset accessors outDegree(nodeId), inDegree(nodeId), outOffset(nodeId), etc. access fwdOffsets[nodeId + 1] and bwdOffsets[nodeId + 1] without checking that nodeId < nodeCount. An invalid nodeId will throw ArrayIndexOutOfBoundsException with no useful message. A precondition check would improve debuggability significantly. Concurrency / Threading Issues5. GraphAnalyticalView.setUpdateMode() — listener registration gap setUpdateMode() synchronizes on this, but the interleaved sequence of unregisterChangeListeners() -> async build -> registerChangeListeners() creates a window where committed transactions are not captured. Transactions during the build period could produce TxDeltas that arrive after unregister but before register, causing those changes to be missed in SYNCHRONOUS mode. 6. Global executor shutdown timeout closeExecutor() uses a 30-second drain timeout that applies across all databases. If one database closes with a long-running build in progress, another database closing simultaneously may have its builds forcibly terminated. Consider per-database executor instances, or at minimum document this shared-pool behavior. 7. hasAnyProviders flag in GraphTraversalProviderRegistry The fast-path volatile flag is read without holding synchronized(REGISTRY). While the volatile guarantees visibility, the flag can be transiently stale. This will not cause correctness issues (an empty list just means no CSR acceleration), but a comment explaining why the TOCTOU is acceptable would help future maintainers. Performance Considerations8. NodeIdMapping — binary search for bucket index on every lookup bucketIdxForNaturalId() does a binary search on bucketBase for every call to getGlobalId(). For queries doing millions of vertex lookups this adds O(log m) per lookup where m is the number of buckets. The bucketIdToIdx[] array already exists for O(1) lookup — verify it is used on the hot path and the binary search is only a fallback. 9. Unbounded bucketIdToIdx growth for sparse bucket IDs If a database uses sparse bucket IDs (e.g., bucket ID = 1,000,000), bucketIdToIdx is allocated as a 1M-entry array of mostly -1 values (~4 MB per view). With multiple GAVs this could add up. A HashMap fallback for sparse bucket ranges would be safer. 10. DeltaOverlay.buildNeighborIndex() — unbounded array growth Neighbor arrays in the delta index start at size 5 and double on overflow. For a node with many new edges in a single transaction, repeated doubling can cause significant temporary allocations. Consider using an initial capacity hint based on the degree observed during the TxDelta scan. Design / Code Quality11. GraphAnalyticalView.closeExecutor() is static with global state The shared executor EXECUTOR is a static field. If users embed multiple ArcadeDB instances in the same JVM, all databases share one executor pool, and closeExecutor() shuts it down for everyone. A reference-counted or per-isolate design would be safer. 12. DeltaOverlay — packEdge() magic constant ((long) src << 32) | (tgt & 0xFFFFFFFFL) — the 0xFFFFFFFFL mask is correct but unexplained. A named constant like UNSIGNED_INT_MASK with a comment explaining why it is needed (tgt can be negative as a signed int) would improve maintainability. 13. NodeIdMapping.applyReordering() — no permutation validation If oldToNewMapping has duplicates or is otherwise invalid, newToOld[oldToNewMapping[i]] = i silently produces an inconsistent state. An assertion in debug/test builds would catch bugs early. 14. DB_AFTER_OPEN callback error handling In LocalDatabase.open(), the DB_AFTER_OPEN callback failure is caught and logged at SEVERE, but execution continues. For a failure during open, this could leave the database in an inconsistent state. Document why continuing is safe, or propagate the exception to abort the open. 15. Grammar: new keywords not added to identifier rule VERTEX, EDGE, REBUILD, and ANALYTICAL are used in the new DDL grammar but not added to the identifier fallback rule (only MODE, GRAPH, AUTO, PROPERTIES, COMPACTION, THRESHOLD were added). If any of these strings appear as user identifiers in queries (e.g., a property or type named vertex or edge), the parser will fail on existing queries. Each new keyword should either be added to identifier or confirmed safe to not appear in identifier positions. Test CoverageThe test suite is thorough — GraphAnalyticalViewTest at 2,445 lines is excellent. A few additional scenarios worth covering:
SummaryHigh-quality, well-architected feature with good test coverage. Priority items to address:
The SPI design via GraphTraversalProvider, the builder pattern for GraphAnalyticalView, and the query planner integration (both optimizer and traditional paths) are all well-structured. The 50-70x traversal speedup claim is credible given the CSR architecture. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* 1st basic version of graph olap * Support for multiple vertex and edge types * Phase 2 completed * Cypher planner now uses the GraphAnalyticalView if available * GraphAnalyticalView are now persisted like materialized views + graph algos can use now graph olap * Added graph analytics in OLAP studio panel * Implemented fast olap graph operations against scalar and SIMD * move graph-olap inside engine module + new SQL commands * new button to create graph anal. view from studio * Added new materialized view button in studio * gav: incremental update * Refactoring of package + added stats to GAV * Fixed concurrency issues * update modes * Supported rebuild and alter of a GAV * GAV: fixed bugs * GAV fixed usage from server * Added test case * Fixed GAV usage for common queries * fixed select count(*) optimization * perf: review usage policy for GAV * chore: added governance.md and why we don't ask for a CLA * fix gac usage in planner * Implemented all recommendation from PR comments * fix: class cast exception * Update GraphOLAPBenchmark.java * Addressed all issues in latest comment * perf: implemented NeighborView to access to the underlying int[] * Implemented all recommendations * Last changes from Google Code review * Implemented all the latest recommendation from Claude Code review * Fixed last issues from Claude Code Review * Checked all Claude Code review, and implemented only what made sense * Fixed latest issues reported by Claude Code review * fix: graph algos * Implemented the issues that made sense from Claude Code Review - discarded others * Fixed last issue from Claude Code review * Fixed minor issues * feat: Edge Properties in GAV * feat: added edge properties in GAV * studio: improved GAV creation popup * Improved performance after LDBC benchmark * Improved CSR building Uses an index-based approach: sort indices by key values, then apply the permutation. Zero GC pressure: encodes key|index into a primitive long[], sorts, then unpacks. * Improved performance by lazy loading edge properties * Further optimization especially for SSSP algo * Implemented code review * perf: improved GAV * Final fix for perrormance * Fixed small issues * Introduced parallelism in some graph algos * Merged * chore: added javadoc * More optimizations * perf: improved performance of graph olap * Final optimization * Implemented all optimization and fixed issues reported in the latest claude code review * chore: made skipPersistence method public (called by LDBC benchmark) * Minor optimizations * chore: fixed tests * Implemented latest recommendation from claude code review (cherry picked from commit 19f5635)
Bumps [pg](https://github.com/brianc/node-postgres/tree/HEAD/packages/pg) from 8.19.0 to 8.20.0. Changelog *Sourced from [pg's changelog](https://github.com/brianc/node-postgres/blob/master/CHANGELOG.md).* > [email protected] > --------- > > * Add [onConnect](https://redirect.github.com/brianc/node-postgres/pull/3620) callback to pg.Pool constructor options allowing for async initialization of newly created & connected pooled clients. Commits * [`c9070cc`](brianc/node-postgres@c9070cc) Publish * [`ad36e3c`](brianc/node-postgres@ad36e3c) fix: typo in deprecation notice for `client.query()` ([ArcadeData#3618](https://github.com/brianc/node-postgres/tree/HEAD/packages/pg/issues/3618)) * See full diff in [compare view](https://github.com/brianc/node-postgres/commits/[email protected]/packages/pg) [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
…#3618) * 1st basic version of graph olap * Support for multiple vertex and edge types * Phase 2 completed * Cypher planner now uses the GraphAnalyticalView if available * GraphAnalyticalView are now persisted like materialized views + graph algos can use now graph olap * Added graph analytics in OLAP studio panel * Implemented fast olap graph operations against scalar and SIMD * move graph-olap inside engine module + new SQL commands * new button to create graph anal. view from studio * Added new materialized view button in studio * gav: incremental update * Refactoring of package + added stats to GAV * Fixed concurrency issues * update modes * Supported rebuild and alter of a GAV * GAV: fixed bugs * GAV fixed usage from server * Added test case * Fixed GAV usage for common queries * fixed select count(*) optimization * perf: review usage policy for GAV * chore: added governance.md and why we don't ask for a CLA * fix gac usage in planner * Implemented all recommendation from PR comments * fix: class cast exception * Update GraphOLAPBenchmark.java * Addressed all issues in latest comment * perf: implemented NeighborView to access to the underlying int[] * Implemented all recommendations * Last changes from Google Code review * Implemented all the latest recommendation from Claude Code review * Fixed last issues from Claude Code Review * Checked all Claude Code review, and implemented only what made sense * Fixed latest issues reported by Claude Code review * fix: graph algos * Implemented the issues that made sense from Claude Code Review - discarded others * Fixed last issue from Claude Code review * Fixed minor issues * feat: Edge Properties in GAV * feat: added edge properties in GAV * studio: improved GAV creation popup * Improved performance after LDBC benchmark * Improved CSR building Uses an index-based approach: sort indices by key values, then apply the permutation. Zero GC pressure: encodes key|index into a primitive long[], sorts, then unpacks. * Improved performance by lazy loading edge properties * Further optimization especially for SSSP algo * Implemented code review * perf: improved GAV * Final fix for perrormance * Fixed small issues * Introduced parallelism in some graph algos * Merged * chore: added javadoc * More optimizations * perf: improved performance of graph olap * Final optimization * Implemented all optimization and fixed issues reported in the latest claude code review * chore: made skipPersistence method public (called by LDBC benchmark) * Minor optimizations * chore: fixed tests * Implemented latest recommendation from claude code review
…er (#6050) * fix(#6049): document that GAV neighbor order is unrelated to OLTP order #6049 reported that a GraphAnalyticalView returns a promoted super-node's neighbors in "concatenated stripe order", diverging from the interleaved approximate-newest-first order #6044/#6047 restored on the OLTP read walks. That diagnosis does not match the code. CSRBuilder never preserves the order it consumes outList.entryIterator() in: every node's forward/backward neighbor slice is unconditionally sorted ascending by dense node ID in Phase C, then permuted again by the BFS/RCM cache-locality pass in Phase D. This has been true since the CSR/GAV feature was first merged (#3618), independent of whether the underlying vertex is a classic or promoted (striped) super-node, and is already covered by the pre-existing sortedNeighbors test. Rewiring CSRBuilder onto the interleaved iterator from #6047, as the issue proposed, would therefore change nothing about the CSR's output - the sort erases it regardless. The real, pre-existing property is broader than the issue framed it: GAV order has never had any relationship to OLTP order for ANY vertex, not just super-nodes, and matching OLTP's approximate-recency order would break the ascending-adjacency invariant that isConnectedTo, countEdgesBetween, getMeanEdgesPerConnectedPair and triangle counting rely on for binary search / merge-join. So this documents the actual contract instead: GraphAnalyticalView's class Javadoc now states the order guarantee explicitly and notes that the query planner (GAVExpandAll/ GAVExpandInto) can silently route a query through either path, and StripedEdgeList cross-references it so the two Javadocs stay consistent. Also verified the issue's follow-up notes on toJSON() and edgeIteratorConnectedTo(): both are accurate as filed (toJSON is a debug/export dump with a single caller, edgeIteratorConnectedTo is unaffected by concatenation because a neighbor hashes to at most one stripe per generation) and need no change. Issue6049GAVSupernodeOrderTest pins the actual behavior: (1) a promoted super-node's GAV neighbor order stays strictly ascending by node ID, and (2) that order genuinely differs from the OLTP order while losing or duplicating nothing relative to it. * test(#6049): simplify dedup check per code review Code review on #6050 flagged the hand-rolled int[]->List<Integer> boxed() helper as unnecessary: Arrays.stream(...).boxed().collect(Collectors.toSet()) does the same dedup check directly, so the helper method is removed along with the now-unused HashSet import. The review's other points needed no code change: - The FQN-in-Javadoc @link on StripedEdgeList (vs. an import) is correct as is - the review itself noted an import used only inside a Javadoc @link tag can trigger unused-import warnings under some checkstyle configs, so the FQN is the safer choice here despite CLAUDE.md's general import preference (which targets executable code). - The note that gavOrder.isNotEqualTo(oltpOrder) is a probabilistic (not logically guaranteed) assertion is accurate but not something to change: for 500 distinct vertices after BFS/RCM renumbering colliding with insertion order is astronomically unlikely, and the test already fails loudly and rebuilds cleanly if it ever does. - No bugs, performance, or security issues were raised.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.