mirror of
https://github.com/versity/scoutfs.git
synced 2026-09-08 09:07:30 +00:00
scoutfs: preserve sticky deletion items
We limit the number of lower segments that a compaction will read. A sticky compaction happens when the upper segment overlaps more lower segments. The remaining items in the upper segment are written back to the upper level -- they're stuck. A future compaction will attempt to compact the remaining items with the next set of overlapping lower segments. Deletion items are rightly discarded as they're compacted to the lowest level -- at that point they have no more matching items in lower segments to destroy and are done. Deletion items were being dropped instead of being written back into the upper level of a sticky compaction. The test for discarding the deletion items only considered the lowest level of the compaction, not the level that the items were being written to. We need to be careful to preserve the deletion items in the case of compaction to the lowest level writing sticky items back to the upper segment. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -250,8 +250,12 @@ retry:
|
||||
* all the duplicate items that they find. When we're
|
||||
* compacting to the last level we can remove them by retrying
|
||||
* the search after we've advanced past them.
|
||||
*
|
||||
* If we're filling the remaining items in a sticky merge into
|
||||
* the upper level then we have to preserve the deletion items.
|
||||
*/
|
||||
if ((curs->lower_level == curs->last_level) &&
|
||||
(!curs->sticky || lower) &&
|
||||
((*item_flags) & SCOUTFS_ITEM_FLAG_DELETION))
|
||||
goto retry;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user