Originally from the User Slack
@Mahdi_Kamali: How much free disk space is required for resharding?
@avi: Good question. We have this commit:
commit 27fb8ec5125a564bd3b7517c6f0eedce25d79697
Author: Raphael S. Carvalho <raphaelsc@scylladb.com>
Date: Wed Dec 21 15:53:21 2016 -0200
db: avoid excessive disk usage during sstable resharding
Shared sstables will now be resharded in the same order to guarantee
that all shards owning a sstable will agree on its deletion nearly
the same time, therefore, reducing disk space requirement.
That's done by picking which column family to reshard in UUID order,
and each individual column family will reshard its shared sstables
in generation order.
Fixes #1952.
Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
Message-Id: <87ff649ed24590c55c00cbb32bffd8fa2743e36e.1482342754.git.raphaelsc@scylladb.com>
~
To be safe, pick the largest sstable, multiple by the number of shards, and again by a factor of 2.
@raphaelsc may know better
@raphaelsc: A small correction on free space required: size of largest table * 2. That’s because in the worst case, all the sstables may be resharded in parallel, across all the shards. To reduce the space requirement, schema’s max_threshold can be tweaked temporarily to something like 2, so each shard will work on, at most 2 sstables at a time.
@Mahdi_Kamali: Thanks @raphaelsc
You mean the max_threshold property of STCS?
Does it impact major compaction?
@raphaelsc: all compaction strategies inherit that property.
no, major ignores max_threshold.
@Mahdi_Kamali: Thank you very much!
I think that will be good if major compaction considers max_threshold
Is there anyway to decrease required storage for major compaction?
@raphaelsc: the idea of major is to compact everything.
major space requirement is fixed in enterprise with ICS.
in OSS, the only strategy that has low space req during major is LCS.
but it has high write amplification, so might not fit your use case.