core/rawdb: avoid exiting geth from freezer on fsync failure (ref #22112) #22118
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.
This is a partial fix for #22112 .
In that ticket, an
fsync
operation failed -- unclear why. When that happens, the current code hard-exits, without any kind of recovery.The current behaviour is wrong, and is prone to corrupt the database since we don't properly close anything. In the particular case where the error occurs, it's actually possible to just un-write the data that we just wrote (truncate), back off and try again later. That would probably have a higher chance of working.
If the error persists, it will just lead to the move-data-from-leveldb-to-ancient becomes a no-op, but it won't cause corruption.