Haoqing Geng
Haoqing Geng

Reputation: 13

How to remove tombstones of secondary index in Cassandra

After scanning 100k tombstones, cassandra will error out the query, I tried to do major compaction on the table, but it doesn't remove tombstones of its secondary index. The query still can not be completed.

I searched for a while, one suggestion is rebuild_index, but I think it will cause many queries to fail while rebuilding, and I don't have an estimate of how long it'll take to rebuild indexes.

Any suggestion?

Upvotes: 0

Views: 1002

Answers (2)

HammerZEIT
HammerZEIT

Reputation: 53

I don't know if you found your answer but I hope it can help anyone : Try to rebuild to secondary index, I suspect that ordinary nodetool command does not "clean" seconday index properly.

# nodetool rebuild_index keyspace "CF" "CF".SecondayIndex

Like Ananth said, you might have to rethink your datamodel to avoid secondary index being full with tombstones again.

Regards,

Upvotes: 3

Ananth
Ananth

Reputation: 991

Change the gc_grace_seconds to 1 and run a compaction on the table and see. It should clear the tombstones immediately. Once done,reset the gc_grace_seconds to a lower value. Default is 10 days. I think you need to model your data better.

Upvotes: -1

Related Questions