澄清卡桑德拉墓碑和手动压实
我几乎没有关于卡桑德拉墓碑和手动压实的疑问。
假设我在时间X上删除了Cassandra群集中的一行(分区密钥)。让我们假设gc_grace_seconds
具有其默认值(十天)。
确实,如果手动启动
Nodetool Compact
在低于x+10天的时间时,旧数据仍将在压实后仍在磁盘上?相反,如果我启动
nodetool compact
在比x+10天高的时间中,旧数据实际上是从磁盘中删除的?让我们假设删除是在时间x上发出的,然后在我将
gc_grace_seconds
更改为较低的值(例如1天)。如果在时间x+2天,我开始nodetool compact
旧数据将真正从磁盘中删除?换句话说,创建墓碑时包含删除时间,而不是到期时间,对
I have few questions about Cassandra tombstones and manual compaction.
Let's say that I delete a row (partition key) in my Cassandra cluster at time X. Let's assume that gc_grace_seconds
has its default value (ten days).
Is it true that if manually start a
nodetool compact
at a time lower than X+10 days the old data will be still on disk after the compaction ?Instead, if I start
nodetool compact
at a time higher than X+10 days the old data is really removed from disk ?Let's assume that the delete was issued at time X and later on I change the
gc_grace_seconds
to a lower value (let's say 1 day). If at time X+2 days I startnodetool compact
the old data will be really removed from disk ? In other words the tombstone, when created, contains the deletion time and not the expiration time, right ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,如果在 gc_grace_seconds 之前运行压缩,则不会删除逻辑删除。
一般来说是的,但也取决于压缩策略。所以你不能 100% 确定这一点。
是的,你在这一点上是正确的。墓碑包含删除时间。过期时间取决于表的 gc_grace_seconds 值。
您通常不应该运行nodetoolcompact命令(主要压缩)并且您的压缩应该自动运行(次要压缩)。
Yes tombstones are not removed if compaction is run before gc_grace_seconds.
Generally yes but depends on compaction strategy also. So you cannot be 100% sure of this.
Yes you are correct on this. Tombstones contains deletion time. Expiry depends on gc_grace_seconds value of the table.
You should generally not run nodetool compact command (major compcations) and your compactions should be running automatically (minor compactions).