mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 19:20:44 +00:00
2ac239a4cb793f73518460c21b3eb2af78efe240
So far we were only able to add items to the segments. To support deletion we have to insert deletion items and then remove them and the item they reference when their segments are compacted. As callers attempt to delete items from the item cache we replace the existing item with a deletion marker with the key but no value. Now that there are deletion items in the cache we have to teach the other item cache operations to skip them. There's some noise in the patch from moving functions around so that item insertion can free a deletion item it finds. The deletion items are written out to the segment as usual except now the in-segment item struct has a flag to mark a deletion item and the deletion item is removed from the cache once its written to the segment. Item reading knows to skip deletion items and not add them back into the cache. Compaction proceeds as usual for most of the levels with the deletion item clobbering any older higher level items with the same key. Eventually the deletion item itself is removed by skipping over it when compacting to the largest final level. We support this by adding a little call that describes the max level of the tree at the time the compaction starts so that compaction can tell when it should skip copying the deletion item to the final lower level. All of this is for deletion of items with a precise key. In the future we'll expand the deletion items so that they can reference a contiguous range of keys. Signed-off-by: Zach Brown <zab@versity.com>
Description
No description provided
Languages
C
87%
Shell
9.3%
Roff
2.5%
TeX
0.8%
Makefile
0.4%