fix(graph): remove local snapshot read fallbacks#176
fix(graph): remove local snapshot read fallbacks#176jonathanhaaswriter wants to merge 2 commits intofix-opencypher-query-result-interfacefrom
Conversation
|
I think Can we return |
1e2097a to
40ddb2c
Compare
40ddb2c to
0a256b7
Compare
| } | ||
| view, err := a.storedSecurityGraphViewWithSnapshotLoader(func(store *graph.GraphPersistenceStore) (*graph.Snapshot, error) { | ||
| snapshot, _, _, err := store.PeekLatestSnapshot() | ||
| return snapshot, err |
There was a problem hiding this comment.
After removing snapshot-backed reads, CurrentSecurityGraph() now falls back to a.currentLiveSecurityGraph() whenever currentConfiguredSecurityGraphView() returns an error or no view. On read-only replicas, initSecurityGraph() still publishes the builder’s empty graph before checking the writer lease (internal/app/app_security_services.go:528-536), so a Neptune outage/unready store now gets surfaced as a zero-node graph instead of ErrStoreUnavailable.
This is user-visible because API read paths prefer CurrentSecurityGraph() over the store (internal/api/graph_view_resolvers.go:9-12), so graph/risk/intelligence endpoints can silently return empty results during Neptune failures.
internal/app/app_graph_backend.go
Outdated
| return nodes > 0 || edges > 0, nil | ||
| _ = nodes | ||
| _ = edges | ||
| return true, nil |
There was a problem hiding this comment.
currentConfiguredSecurityGraphStore() only exposes the configured backend when configuredSecurityGraphReady is true (internal/app/app_graph_store.go:311-316), and syncConfiguredSecurityGraphStore() already flips that flag after all node/edge writes complete (internal/app/app_graph_store_sync.go:12-84).
Returning true for a zero-node backend removes that barrier. On a fresh or cleared Neptune cluster, readers can now observe an empty or partially copied graph while the initial sync is still in progress - which is probably fine, but this is different behavior then previously, where the graph stayed unavailable until sync completion.
Summary
Validation