Ensure writes to WAL tail during FlushWAL(true /* sync */)
will be …
#357
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.
…synced (facebook#10560)
Summary:
WAL append and switch can both happen between
FlushWAL(true /* sync */)
's sync operations and its call toMarkLogsSynced()
. We permit this since locks need to be released for the sync operations. Such an appended/switched WAL is both inactive and incompletely synced at the timeMarkLogsSynced()
processes it.Prior to this PR,
MarkLogsSynced()
assumed all inactive WALs were fully synced and removed them from consideration for future syncs. That was wrong in the scenario described above and led to the latest append(s) never being synced. This PR changesMarkLogsSynced()
to only remove inactive WALs from consideration for which all flushed data has been synced.Pull Request resolved: facebook#10560
Test Plan: repro unit test for the scenario described above. Without this PR, it fails on "key2" not found
Reviewed By: riversand963
Differential Revision: D38957391
Pulled By: ajkr
fbshipit-source-id: da77175eba97ff251a4219b227b3bb2d4843ed26