user2572068
user2572068

Reputation: 21

How can I produce 'tombstone compaction' in cassandra 1.2.6

Regarding tombstone compaction

I'd like to know why I can't produce 'tombstone compaction' in cassandra1.2.6.

[steps]

  1. create column family in cassandra-cli

    create keyspace keyspace1 with placement_strategy = 'org.apache.cassandra.locator.SimpleStrategy' and strategy_options = {replication_factor:3};

    use keyspace1;

    create column family cf1 with comparator=AsciiType and default_validation_class=AsciiType and key_validation_class=AsciiType and compaction_strategy_options={tombstone_compaction_interval: 1, tombstone_threshold: '0.1'} and gc_grace=600 and column_metadata=[ {column_name: column1, validation_class: LongType} ];

  2. Entry some data with TTL in cassandra-cli as following

    set cf1['key1']['column1']=100 with ttl = 1;
    set cf1['key2']['column1']=200 with ttl = 1;
    set cf1['key3']['column1']=300 with ttl = 1;
    set cf1['key4']['column1']=400 with ttl = 600;
    set cf1['key5']['column1']=500 with ttl = 600;
    set cf1['key6']['column1']=600 with ttl = 600;

  3. execute 'nodetool flush'

  4. check Data.db with sstable2json

    {"key": "2412441","columns": [["column1","100",1373516242953000,"d"]]},
    {"key": "2412442","columns": [["column1","200",1373516242963000,"d"]]},
    {"key": "2412443","columns": [["column1","300",1373516242973000,"d"]]},
    {"key": "2412444","columns": [["column1","400",1373516242983000,"e",600,1373516300]]},
    {"key": "2412445","columns": [["column1","500",1373516242983000,"e",600,1373516300]]},
    {"key": "2412446","columns": [["column1","600",1373516242983000,"e",600,1373516300]]}

  5. Wait over 1hour.... It has no change in Data.db.... tombstone compaction wasn't produced...

  6. Entry some data and execute nodetool flush again... Just new Data.db was created... tombstone compaction wasn't produced...

I'd like to just try 'tombstone compaction'.

Upvotes: 2

Views: 1405

Answers (1)

jbellis
jbellis

Reputation: 19377

You probably don't have enough data in the sstable for Cassandra to guess the tombstone ratio. You can use the getDroppableTombstoneRatio method from ColumnFamilyStoreMBean over JMX to check.

Upvotes: 2

Related Questions