-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[Neo Store Exception] Add exception to Use after Commit
operation to Snapshots and Cache.
#3405
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good idea. If snapshot isn't disposed
You should still be able to use it. I think it does in ApplicationLogs
you can not use it anymore, cause the value was there before the commit, but will be gone after the commit. you will get unexpected result. if applicationengine or something is using a committed cache, we should fix it. and if you use your experience with snapshot on neo, you should rethink it, cause its different here. |
the problem is, you had newest state, but after you commit it, you lose the latest state but fallback to the point when the snapshot is created, making the snapshot unable to process with correct data anymore. thus you should never use a clmmitted snapahot or datacache. |
Thats not true. Because the Hints my comment for: #3399 (comment) |
@@ -146,6 +148,8 @@ public virtual void Commit() | |||
dictionary.Remove(key); | |||
} | |||
changeSet.Clear(); | |||
|
|||
isCommitted = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this flag must be changed to false when write or delete, isn't it?
Please check my pr on memorystore UTs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, see the #3404 (comment). How this do-not-use-after-commit rule is going to work with blocks processing? I'm probably missing something.
Why can't you on commit. Refresh the |
read my test. You can not assume where the data comes from, when you read the data, its from the snapshot of the db, not the db latest state. |
Description
Store snapshot and datacache are not supposed to be used after they are commited since there will be data inconsistancy and very hard to figure out the exact value. Thus we need to ban any attacmpt of using the snapshot or data cache after they are committed.
Fixes # (issue)
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: