Zach BrownandZach Brown 9c80f109d5 scoutfs: don't always write deletion items
Items deleted from the item cache would always write deletion items to
segments.  We need to write deletion items so that compaction can
eventually combine them with the existing item and remove both.  We
don't need them for items that were only created in the current
transaction.  Writing a deletion item for them only results in a lot of
extra work compacting the item down to the final segment level so that
it can be removed.

The upcoming extent code really demonstrated the cost of this overhead.
It happens to create and delete quite a lot of temporary extent items
during the transaction as all the different kinds of indexed extents
change.

This change tracks whether a given item in the cache reflects an item
that is present in the persistent storage.  This lets us free items
that have only existed in the current transaction.

This made a meaningful difference when writing a 4MB file with the
current block mapping items, but it made an enormous difference when
writing that same file with the extent items.  It went from writing 1024
deletion items for 11 real items to only writing those real items.

                        items  deletions
block mappings before:     25          5
block mappings after:      25          0
extents before:            11       1024
extents after:             11          0

Signed-off-by: Zach Brown <zab@versity.com>
2018-06-29 14:42:06 -07:00
S
Description
No description provided
7.5 MiB
Languages
C 86.4%
Shell 9.9%
Roff 2.5%
TeX 0.8%
Makefile 0.4%