You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actual behavior: Edge is successfully created twice. Expected behavior: Edge should not be created the second time because it violates unique constraint [from_id,to_id]
P.S.
Also worth to mention that RemoteGraphBatch doesn't support RemoteDatabase transactions. I'm not sure if it should support it, but there might be some confusions since RemoteGraphBatch is created out of RemoteDatabase.
Root cause: GraphBatch.createEdgeRecordsBulk writes edge records straight to pages via LocalBucket.createRecordsBulk, bypassing LocalDatabase.createRecord and therefore DocumentIndexer.createDocument. Since indexes were never updated, unique constraints on edge types were silently ignored. RemoteGraphBatch is just the HTTP front-end for the same code path, so the bug surfaced through both APIs.
After the bulk write, iterate the indexes registered for the edge bucket (getPolymorphicBucketIndexByBucketId) and call index.put for each new edge, mirroring the DocumentIndexer.createDocument logic with @out/@in pseudo-property handling.
Wrapped flush() in try/catch: on RuntimeException, roll back the transaction (only if started by this flush), discard the buffered edges and rethrow so the caller sees the duplicate-key error and the database is left clean.
Updated close() to capture the trailing flush() failure but still drain the deferred IN buffer for already-persisted edges, otherwise the integrity checker would flag missing back-pointers.
Activity
fix: RemoteGraphBatch ignores unique edge constraint
lvca commentedon May 6, 2026
Fixed.
Root cause: GraphBatch.createEdgeRecordsBulk writes edge records straight to pages via LocalBucket.createRecordsBulk, bypassing LocalDatabase.createRecord and therefore DocumentIndexer.createDocument. Since indexes were never updated, unique constraints on edge types were silently ignored. RemoteGraphBatch is just the HTTP front-end for the same code path, so the bug surfaced through both APIs.
Fix (engine/src/main/java/com/arcadedb/graph/GraphBatch.java):
fix: RemoteGraphBatch ignores unique edge constraint
fix: RemoteGraphBatch ignores unique edge constraint
fix: RemoteGraphBatch ignores unique edge constraint
chore(deps): bump org.postgresql:postgresql from 42.7.12 to 42.7.13 […
refactor(engine) #5470: drop the duplicate deferred-edge log, GraphBa…
#5470 A failed batch load answers at once, instead of after the rest …
* fix(server) #5470: answer a failed batch load at once, instead of a…
fix(#7357): third-review follow-ups - an Error out of flush() no long…
fix(#7357): pin "every way out of a batch lifts the suspension", and …