question

kajarvine_115939 avatar image
kajarvine_115939 asked Cedrick Lunven answered

What will happen when we switch from STCS to TWCS on-the-fly?

What will happen, if we on-the-fly switch the Table's compaction strategy from STCS to TWCS?

Tables on 10 nodes are quite large at this time.
I am not worried over what will happen to TWCS, we know that.

But, will cassandra start to repair/compress the OLD STCS data?

compactiontwcsstcsstrategyswitch
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image
Erick Ramirez answered

@kajarvine_115939 As you may already know, TimeWindowCompactionStrategy (TWCS) uses SizeTieredCompactionStrategy (STCS) to compact SSTables which belong to the same time window.

All the old (or existing) SSTables is considered to belong to "window zero". If there are SSTables which fit into the current time window, they will be compacted as part of that window. Anything older than the current window will no longer get compacted.

For example, consider the scenario where the configured time window is 7 days. Any existing STCS SSTables which fit into the "last 7 days" will be included as candidates for compaction in the current time window. SSTables older than 7 days won't be compacted anymore. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Cedrick Lunven avatar image
Cedrick Lunven answered

Some video related to the topic on the academy. You are covered only data on the time-window will be compacted

https://academy.datastax.com/units/21017-time-window-compaction-dse-operations-apache-cassandra?resource=ds210-datastax-enterprise-6-operations-with-apache-cassandra


Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.