Anuj Wadehra created CASSANDRA-12048:
----------------------------------------
Summary: Bucket_low property has no effect in STCS Algo
Key: CASSANDRA-12048
URL: https://issues.apache.org/jira/browse/CASSANDRA-12048
Project: Cassandra
Issue Type: Bug
Components: Compaction
Reporter: Anuj Wadehra
Fix For: 2.2.x
It seems that the STCS algorithm is not impacted by setting the Bucket_low
Compaction property. Also,I see some optimization in STCS algo.
Problems:
1. getBuckets() method of SizeTieredCompactionStrategy sorts sstables by size
in ascending order and then iterates over them one by one to associate them to
an existing/new bucket. When, iterating sstables in ascending order of size, I
can't find ANY single scenario where the current sstable in the outer loop
iteration is below the oldAverageSize of any existing bucket. Current sstable
being iterated will ALWAYS be greater than/equal to the oldAverageSize of ALL
existing buckets as ALL previous sstables in existing buckets were
smaller/equal in size to the sstable being iterated.
So, there is NO scenario when size > (oldAverageSize * bucketLow) and size <
oldAverageSize, so bucket_low property never comes into play no matter what
value you set for it.
2. While iteraitng over sstables (sortedfiles) by size in ascending order,
there is no point iterating over all existing buckets. We could just start from
the LAST bucket where previous sstable was associated. oldAverageSize of ALL
other buckets will NEVER allow the sstable being iterated.
for (Entry<Long, List<T>> entry : buckets.entrySet())
{...}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)