sstables: Fix major compaction's space amplification with incremental compaction
sstables: Fix major compaction's space amplification with incremental compaction

Incremental compaction efficiency depends on the reference of sstables
compacted being all released because the file descriptors of sstable
components are only closed once the sstable object is destructed.
Incremental compaction is not working for major compaction because a reference
to released sstables are being kept in the compaction manager, which prevents
their disk usage from being released. So the space amplification would be
the same as with a non-incremental approach, i.e. needs twice the amount of
used disk space for the table(s). With this issue fixed, the database now
becomes very major compaction friendly, the space requirement becoming very
low, a constant which is roughly number of fragments being currently compacted
multiplied by fragment size (1GB by default), for each table involved.

Fixes #5140.

Signed-off-by: Raphael S. Carvalho <1e2942cea40e3b4d2162dfcd9e53e41c05a84d22@scylladb.com>
Message-Id: <20191003211927.24153-1-1e2942cea40e3b4d2162dfcd9e53e41c05a84d22@scylladb.com>

avikivity/scylla,avikivity/scylla,scylladb/scylla,scylladb/scylla,scylladb/scylla,avikivity/scylla,scylladb/scylla