-
Notifications
You must be signed in to change notification settings - Fork 871
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
Cannot update the record because the version is not the latest #1312
Comments
Fixed in commit 009dd87 |
Hi Luca, I am using 2.M1 and I have started getting the above mentioned error. I was not getting this error when I was using version 1.7.7 Please let me know if you are going to fix it .. |
Hi Luca, |
I am getting the same error in orientdb-community-2.1.5. Please try to fix it as soon as possible because we have planned to use it in production. |
Sometimes I got the same error in Studio but I can't reproduce it. |
Hi, OrientDB supports optimistic transactions. Look at: http://orientdb.com/docs/last/Concurrency.html#atomic-operations |
Closed in 2.1.9. |
Hello Guys, We are using version orientdb-community-2.1.10 and facing the similar issue . Please let us know in which version this bug is fixed or is still existing. |
@varuntahin001 why do you think that that is a bug ? |
While deleting and adding edge we are having similar issue as the graph is taking previous vertex in cache and it is throwing Cannot update the record because the version is not the latest. We have also tried with global setting OGlobalConfiguration.CACHE_LOCAL_ENABLED.setValue(false); As above discussions are happening I was curious as this might be issue with the previous versions , as comment states hotfix for this in 2.1.10 |
@varuntahin001 sorry for asking but did you try to use latest version , a lot of issues were fixed since 2.1.10 ? |
Hi @Laa
when i try some update on a record i got this error ! |
Hi @saeedtabrizi , why do you think that this error is incorrect ? |
@Laa this error is correct but i need to remove all async update operation from my app to handle this issue . i think all users confused because there is lack of documentation about CRUD operation (such as our scenario for parallel updating ) in ODB. |
@saeedtabrizi @Laa I think the problem is that orientdb use OCC instead MVCC or a MIX of both.
I think I speak to lots of developers when I say thats some of a reason why I use a database is because I dont want to care about such issues. MVCC was created to prevent locking. If orientdb throws an excepction and breaks my operation it shows that MVCC is not implemented correctly. Use of retry, locking or other mechanism is just "plug holes". In my opinion the whole strategy of concurrency should be reviewed and standardized. Very good paper: http://guide.couchdb.org/draft/consistency.html |
Do you mean
?? That is what I understood MVCC was too. Scott |
For better understanding http://guide.couchdb.org/draft/consistency.html#locking |
Which part of that document is ODB not following? Scott |
In fact, that doc explains the "recovering from the (stale data) error is easy from an applicatin perspective", which is normal for such a system.
Like I said. 😄
Scott |
@smolinari What's your point? |
That ODB works just like Couchdb in terms of concurrency. If an update to a record happens before another, then the later update will fail, because that version is old/ stale. At that point, the newer record must be retrieved and it must be changed and attempted to update again. That is how MVCC works. It doesn't ensure a proper is update is made between to updating clients. It ensures an improper update won't be made (i.e with stale data). Scott |
Yes, that's correct like GIT. But its not up to the developer to solve this conflict. This issue should be solved by setting the "conflict strategy" to e.g
but I don't understand the part
when orientdb use MVCC under the hood. Update: Orientdb use optimistic concurrency when transactions are commited. This is correct and the case where the developer has to handle concurrency errors. |
What conflict strategy are you looking for? Scott |
Its off topic but a way where I dont have to care about transactions conficts. Setting a default conflict strategy like in MVCC I only know the retry statement |
@smolinari Imagine you use orientdb with lots of clients and high-traffic. All clients starts transactions in any kind of size (orientdb recommend small transactions because of concurrency issues) what happens? You will run into lots of concurrency issues which you have to solve with a retry logic but the end is not in sight because you need a magical retry number??? I dont get the picture of that concept and I can't imagine that all other database vendors goes with the same approach. |
After some research I came to this. I think this is what orientdb needs. Transaction priorities BEGIN PRIORITY <LOW | NORMAL | HIGH>;
https://www.cockroachlabs.com/docs/transactions.html#transaction-priorities BEGIN ISOLATION LEVEL <SERIALIZABLE | SNAPSHOT>;
Orientdb use SERIALIZABLE |
As far as I can tell, ODB offers serializable isolation and they want to switch to something more like snapshotting (possibly). I have no idea how transaction contention priority should work and seems like it isn't needed, with ODBs OCC system. There are no locks in ODB's transaction system. I also think the ODB docs on the transaction system is a bit misleading. This sentence is correct:
So, this part of the code with the retries is basically incorrect.
There can be no retry, because every retry will fail. The data is stale. As the sentence above states "retire the transaction", you'd have to go to the user and let them know their update failed, ask them to refresh the page and try again (in a web app) i.e. the conflict is resolved by the user. So, if there are scenarios where retries will work and will get the transaction to commit, those scenarios aren't clarified in the docs. From what I am reading, only stale data (version conflicts) would be the reason for transactions or non-transactional updates to fail, which means you must resolve the conflict and that means getting the fresh version, making the changes again and saving. Scott |
2.2.17 also got this error Failed to update an entity: Cannot UPDATE the record #7:1 because the version is not the latest. Probably you are updating an old record or it has been modified by another user (db=v2 your=v1) |
Got the same error in 2.2.19.
|
@easy2coderep why do you think this is an error ? |
I mean that is typical behaviour if the same record is updated from two different clients |
@Laa I am quite sure that there is single instance is performing the update operations sequentially. So if there is any such instance where the record which is accessed by first client, is been modified by another client then better to print the stacktrace of first client with warning message. It would be more meaningful and users may need not be scaring of this exception. |
@easy2coderep sorry I do not understand you. You are quite sure that you make only sequential requests? According to your question update from the first client is already happened so we can not print a stack trace from the first client. |
@Laa : i came across the same issue and found i this thread. |
@zeeshan2709 what do you mean? Sorry, I do not understand a question, could you provide an example or make question more clear? |
I'm getting this same error in 2.2.25. Using the Apparently, every time I create a vertex I have to code my application to catch these errors and retry. That's a really dumb burden to place on the developers, and reflects very poorly on the maturity and sophistication of OrientDB. |
Hi @subwindow it can not be thrown during creation of vertexes only during an update, are you sure that you do not create any edges along with vertexes for example? |
@subwindow could you provide SQL which you use to create records together with retry? |
Hi @Laa ,I have this same question.
Here is my request
The data were desensitized This problem is difficult to reproduce, and can I use |
Was also experiencing this it seems because of an embedded doc with the I am able to reproduce this reliably |
I get the same error on OrientDB 2.2.0 There's no concurrency in my case. Only 1 client performing the update. (through postman) At first I thought the record got locked for some reason, so to be sure, I recreated the whole DB. So I performed a new test, Insert record then update it. Same thing happened. It was happening randomly at first, but now, it does happen on every update.
In which version has this been fixed? Thanks. |
There is nothing to fix. ODB works correctly. Check your setup and what you are doing. You more then likely have some sort of error in your thinking, data or logic. Scott |
I am having a similar error. I am using Right now I am testing with 3 vertices and 2 edges creation. I successfully create the 3 vertices and am able to create the first edge. The second edge creation throws the error : I also get a similar error when I try to drop the graph. |
Hi @Tushavi see this. orientechnologies/orientdb-gremlin#148 It should be solved in the next OrientDB 3.04 release |
Hi @maggiolo00 , |
Hi,
This is probably a very old question, but slightly different in my case and haven't found answer in group, so post it again.
Following is my code snippet.
Both versions I will get exception when committing the third transaction like: om.orientechnologies.orient.core.exception.OConcurrentModificationException: Cannot UPDATE the record
#7:4
because the version is not the latest. Probably you are updating an old record or it has been modified by another user (db=v2 your=v1)The problem here is "a" actually, when I create the edge, if I try to "save" it again, then I will get the above exception; while if not, everything is fine.
But in blueprints, "a" will always be saved:
I've tried to disable level1 and level2 cache, and disable mvcc, but nothing works.
How can I solve this problem? Or is it not expected to use a vertex/edge created in another transaction?
The text was updated successfully, but these errors were encountered: