-
Notifications
You must be signed in to change notification settings - Fork 872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distributed: Edges do not replicate #5249
Comments
Which OrientDB release? |
2.1.3, 2.1.4 & 2.1.x branch |
I just created this test case (c5250ca) and everything seems fine. Please could you take a look at the differences with your use case? |
The difference lies in executionMode asynchronous. When in asynchronous mode, it does not work. |
Are you able to reproduce in asynchronous mode? |
Reproduced the error in async mode. Working on it. |
Updated also docs: https://github.com/orientechnologies/orientdb-docs/blob/master/Distribut ed-Configuration.md#asynchronous-replication-mode
This problem was the class OConcurrentModificationException happened during the async call, so not possible to caught. Starting from last v2.1.6-SNAPSHOT is possible to catch events of command during asynchronous replication, thanks to the following method of OCommandSQL:
Example retrying up to 3 times in case of concurrent modification exception on creation of edges: g.command( new OCommandSQL("create edge Own from (select from User) to (select from Post)")
.onAsyncReplicationError(new OAsyncReplicationError() {
@Override
public ACTION onAsyncReplicationError(Throwable iException, int iRetry) {
System.err.println("Error, retrying...");
return iException instanceof ONeedRetryException && iRetry<=3 ? ACTION.RETRY : ACTION.IGNORE;
}
})
.onAsyncReplicationError(new OAsyncReplicationOk() {
System.out.println("OK");
}
).execute(); For more information: https://github.com/orientechnologies/orientdb-docs/blob/master/Distributed-Configuration.md#asynchronous-replication-mode. |
This still doesn't work reliably. Edges are created and replicated, but the links are not created/updated. |
@nethertek what do you mean? It's normal in an optimistic database that you can have concurrent modification exception. All you need to do is handle them correctly. While with synchronous distributed tx it's easier, with asynchronous you can do that with this API. |
I mean that the current distributed implementation is flawed and it doesn't work. The binary interface does not throw any exception, so to our application it has been accepted and executed, but in reality it was not. Running the query again does not solve anything. Instead all replication seems to stop. |
This isn't supported through binary protocol yet but works in embedded mode. We could support this new api quickly in sql batch execution in case of async replication. Is using sql batch ok for your case? |
IMHO, this process should not be delegated to the application, but rather handled by the database itself. |
Look at: https://github.com/orientechnologies/orientdb-docs/blob/master/Concurrency.md#how-does-it-work why in those cases it's up to the application to manage this situation. |
We removed OrientDB from our project because of such issues. |
Edges do not replicate in distributed mode. The following works only with only one node online. When other nodes are online, edges to not replicate and the local vertex table does not get updated.
The text was updated successfully, but these errors were encountered: