Tamil
Tamil

Reputation: 5358

Major compaction in cassandra

I have a 4 node brisk cluster with 2 Cassandra nodes in Cassandra DC and 2 brisk nodes in Brisk DC. I stress tested this set up using stress tool which is being shipped along with cassandra for 10 Million writes

On executing

$ ./nodetool -h x.x.x.x compactionstats

pending tasks: 17
          compaction type        keyspace   column family bytes compacted     bytes total  progress
                    Major       Keyspace1       Standard1        45172473        60278166    74.94%

AFAIK major compaction is manually triggered from node tool. But I'm able to see that it has been triggered automatically. Is this a desired behavior? If so what are all the situations this may occur?

Regards, Tamil

Upvotes: 3

Views: 5197

Answers (1)

Savino Sguera
Savino Sguera

Reputation: 3572

From the doc:

Compactions are triggered when at least N SStables have been flushed to disk, where N is tunable and defaults to 4.

"Minor" compactions merge sstables of similar size; "major" compactions merge all sstables in a given ColumnFamily.

Again from the doc:

A major compaction is triggered either via nodeprobe, or automatically:

Nodeprobe sends TreeRequest messages to all neighbors of the target node: when a node receives a TreeRequest, it will perform a readonly compaction to immediately validate the column family.

Automatic compactions will also validate a column family and broadcast TreeResponses, but since TreeRequest messages are not sent to neighboring nodes, repairs will only occur if two nodes happen to perform automatic compactions within TREE_STORE_TIMEOUT of one another.

You may find more info here and here

Upvotes: 8

Related Questions