Skip to content

Inconsistent transaction beheviour w/remote: #169

@MartinBrugnara

Description

@MartinBrugnara

Version: 3.0.27
Java-gremlin api
Connection mode: remote

Goal

  • 3 threads deleting 3 different nodes.

Context

  • Each threads has its own GraphTraversalSource generated as
OrientGraph g = ogFactory.getTx();
g.makeActive()
GraphTraversalSource gts = g.traversal()
  • Code (simplified)
Transaction t;
for (int retry=5; retry>=0; retry--) { 
    try {
        gts.tx().open();
        gts.V(object_id).drop().iterate();
        gts.tx().commit()
        break;
   } catch (OConcurrentModificationException ocm) {
        gts.tx().rollback();
   }  catch (Exception e) {
       // ...
   }
}

What happens

  • one thread completes
  • the other 2 raise OConcurrentModificationException
  • one of the remaining completes
  • the other raises ORecordNotFoundException

What should happen

Once the last thread tries to commit, either it succeed or it should fail with an OConcurrentModificationException.

The ORecordNotFoundException suggests that the rollback operation had not any effect, and instead the node was previously removed even tough we had an OConcurrentModificationException.

P.S.

Using plocal: the correct sequence of Exceptions is raised

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions