flush_job: do not roll back memtable flush on CF drop and DB shutdown (#126) #127
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.
Rolling back in these cases is meaningless because the memtables will be
freed shortly afterwards, so making them available for flush again is useless
at best.
Additionally, in atomic flush, memtables that were successfully flushed
aren't rolled back if a CF is dropped or a DB shutdown was requested (the
shutdown case is the more relevant one for the comparison here because it
aborts the flush, whereas the in the CF drop case it's simply ignored at
flush result installation time). In this regard this change simply matches
the behaviour there.
Lastly, this might be needed for the WriteBufferManager changes in #113,
since we plan to use the information about memory that can be flushed in
the future for triggering flushes based on immutable memory as well, and
rolling back flushes causes the memtable memory to become ready for flush
again for a brief period of time until it is dropped, which might wrongly
affect the WBM decisions.
Test plan: run
make check
as well asmake crash_test
.