I am planning to upgrade cassandra version from 2.2 to 3.11. At the same time I want to change the existing table compaction strategy from SizeTieredCompactionStrategy to TimeWindow. I want to automate these two tasks. How do I change the compaction strategy while upgrading the cassandra version from 2.2x to 3.11x effectively?
I am running 3-node apache cassandra cluster as docker container holding timeseries data with 45 days TTL.
Consideration -
- Altering the compaction strategy for the table will trigger the compaction all across the nodes rewriting the SSTables.
- Major upgrade using "upgradesstables" command will lead to rewriting the SSTables due to storage engine change in cassandra 3.0
Is there any way to optimise this process by avoiding the rewriting of SSTables again and again.
Here is what I am thinking -
- Disable Compaction
- Alter the table to change the compaction
- Upgrade the Cassandra to 3.x
- Enable compaction
I am expecting upgradesstables will respect the new compaction and avoid one SSTable write.
Is this a correct approach?