refactor: increment sync_seqn
after meta update
#809
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Incrementing
sync_seqn
right away within the sync function lead to a scenarion where if an error occurred whithin thesync
process the nomt instance would get poisoned, but the same instance if queried would return the followingsync_seqn
which was never applied.What did in this pr I'm not sure if solves entirely the problem, maybe it just moves it in a less painful place (that makes torture to work fine).
Updating it after having update the Meta means that we reflect the state on disk, but if a failure occur during the write of the ht the instance get poisoned, the sync_seqn fetch from the same instance would be correct but it would not be able to read a correct state because there would be a pending WAL batch to be applied to the ht.