I am following upon the course for admin on datastax academy. while going through , I found that leveled comapction switches to STCS at level 0 when compaction is behind ?
what does that mean ?
I am following upon the course for admin on datastax academy. while going through , I found that leveled comapction switches to STCS at level 0 when compaction is behind ?
what does that mean ?
"Lagging behind" in level 0 in the context of LeveledCompactionStrategy
means that a node has not been able to keep up with the required tasks to compact the SSTables and it has fallen behind.
When there are more than 32 SSTables in level 0 because LCS has not been able to keep up with the required compaction tasks, the LeveledManifest.java
class will temporarily switch to STCS:
private static final int MAX_COMPACTING_L0 = 32;
private CompactionCandidate getSTCSInL0CompactionCandidate() { if (!DatabaseDescriptor.getDisableSTCSInL0() && getLevel(0).size() > MAX_COMPACTING_L0) { List<SSTableReader> mostInteresting = getSSTablesForSTCS(getLevel(0)); if (!mostInteresting.isEmpty()) { logger.debug("L0 is too far behind, performing size-tiering there first"); return new CompactionCandidate(mostInteresting, 0, Long.MAX_VALUE); } } return null; }
This is done to quickly reduce the number of SSTables in L0. If you recall, the goal of LCS is to coalesce the partition fragments so that the least amount of SSTables need to be read to satisfy a request. This is problematic when there are too many SSTables in level 0. Cheers!
6 People are following this question.
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2023 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use