Write synchronously in LevelDBSnapshot.Commit and prevent data loss.#680
Write synchronously in LevelDBSnapshot.Commit and prevent data loss.#680
Conversation
|
I’m not entirely sure this has eliminated the issue I have been seeing yet. Testing is still ongoing. |
|
I think The updated |
|
Actually, I believe using the |
|
Doing so will significantly reduce performance and is not necessary. |
|
I agree, I will close this and re-open another one with the |
|
What is the reason for using |
|
It seems if the |
|
The |
|
The actor’s state itself should be guaranteed to have memory visibility if the thread changes, but things outside the actor like in LevelDB may not have consistent memory visibility if the thread has changed. |
I have been puzzled for a while on an issue where syncing MainNet continued to throw exceptions when I sync the chain using machines with high performance cpu and lower disk performance. I discovered the batch write in commit was not being performed synchronously, which seems to lead to the LevelDB current snapshot for the block being created with missing data, which potentially leads to data loss upon persisting the next block. Usually this surfaces as some exception when trying to persist the block.
Update: I believe the root cause now also includes the
BlockchainrunningImportmessages on different OS threads.This fixes part of the problem to fix to the root cause issue I reported way back here as what I thought was a
neo-vmissue at the time: neo-project/neo-vm/issues/53