orientechnologies / orientdb

OrientDB is the most versatile DBMS supporting Graph, Document, Reactive, Full-Text and Geospatial models in one Multi-Model product. OrientDB can run distributed (Multi-Master), supports SQL, ACID Transactions, Full-Text indexing and Reactive Queries.
https://orientdb.dev
Apache License 2.0
4.73k stars 871 forks source link

Duplicate Vertex rows getting created in distributed setup #3086

Closed sajalgupta1976 closed 9 years ago

sajalgupta1976 commented 9 years ago

Version:orientdb-community-2.0-M3 Setup : Distributed mode with 2 nodes running (only modified "writeQuorum": 1 rest are all defaults) Using Java client opening connection in remote mode.using Tx Graph Creating Vertex1 -> This is getting created properly in both nodes Creating Vertex2 and edge between Vertex1 and Vertex2 -> There are 2 entries of Vertex2 getting created in both nodes instead of 1.(The entries are exactly same except @version is 1 and 2) This is working fine in non-distributed mode. main method: OrientGraphFactory factory = new OrientGraphFactory("remote:localhost/test","admin","admin"); graph = factory.getTx(); testVertex1Create(graph); testVertex2Create(graph); graph.commit();

private static void testVertex1Create(OrientGraph graph) throws Exception { Map props = new HashMap(); props.put("prop1","test1"); props.put("prop2","test2"); graph.addVertex("class:TestVertex1",props);
}
private static void testVertex2Create(OrientGraph graph) throws Exception { Iterable vertices = graph.getVerticesOfClass("TestVertex1"); Iterator vIter = vertices.iterator(); Vertex v1 = vIter.next(); Map props = new HashMap(); props.put("prop1","test3"); props.put("prop2","test4"); Vertex v2 = graph.addVertex("class:TestVertex2",props); graph.addEdge("class:TestEdge1",v1,v2,"V1toV2"); }

lvca commented 9 years ago

Fixed with #3228