[ 
https://issues.apache.org/jira/browse/TINKERPOP-3282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18124746#comment-18124746
 ] 

ASF GitHub Bot commented on TINKERPOP-3282:
-------------------------------------------

spmallette commented on code in PR #3639:
URL: https://github.com/apache/tinkerpop/pull/3639#discussion_r4212216635


##########
tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerTransaction.java:
##########
@@ -174,9 +177,36 @@ protected void doCommit() throws TransactionException {
             final TinkerTransactionalIndex edgeIndex = 
(TinkerTransactionalIndex) graph.edgeIndex;
             if (edgeIndex != null) edgeIndex.commit(changedEdges);
 
-            // commit all changes
-            changedVertices.forEach(v -> v.commit(txVersion));
-            changedEdges.forEach(e -> e.commit(txVersion));
+            // write-ahead: durably persist the changeset before applying the 
in-memory commit, so a failure here
+            // aborts the commit (via the catch below) and leaves memory and 
disk consistent. Skipped while the graph

Review Comment:
   A failed persist/flush skipped the rollback, so the failed changes stayed 
visible and in the indices, and the next flush could still write the 
transaction to disk. Fixed in dd8a234703: doCommit now rolls back on any 
failure, and after a log write or flush failure the engine refuses further 
commits until the graph is reopened. A failed compaction no longer fails the 
commit it follows. Writing the tests also turned up an older 
NullPointerException in doRollback, fixed separately in a18db6fa7e.





> TinkerGraph file persistence
> ----------------------------
>
>                 Key: TINKERPOP-3282
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3282
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: tinkergraph
>    Affects Versions: 3.7.6
>            Reporter: Stephen Mallette
>            Assignee: Stephen Mallette
>            Priority: Major
>
> Give TinkerGraph a basic file persistence option tied to its transactional 
> usage so that it can support some more complex use cases.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to