澄清卡桑德拉墓碑和手动压实

发布于 2025-01-20 18:38:01 字数 470 浏览 3 评论 0原文

我几乎没有关于卡桑德拉墓碑和手动压实的疑问。

假设我在时间X上删除了Cassandra群集中的一行(分区密钥)。让我们假设gc_grace_seconds具有其默认值(十天)。

  1. 确实,如果手动启动Nodetool Compact在低于x+10天的时间时,旧数据仍将在压实后仍在磁盘上?

  2. 相反,如果我启动nodetool compact在比x+10天高的时间中,旧数据实际上是从磁盘中删除的?

  3. 让我们假设删除是在时间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).

  1. 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 ?

  2. Instead, if I start nodetool compact at a time higher than X+10 days the old data is really removed from disk ?

  3. 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 start nodetool 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独闯女儿国 2025-01-27 18:38:01

如果在 X+10 天以内手动启动 Nodetool Compact,压缩后旧数据仍将保留在磁盘上吗?

是的,如果在 gc_grace_seconds 之前运行压缩,则不会删除逻辑删除。

相反,如果我在超过 X+10 天的时间启动 Nodetool Compact,旧数据真的会从磁盘中删除吗?

一般来说是的,但也取决于压缩策略。所以你不能 100% 确定这一点。

假设删除是在时间 X 发出的,后来我将 gc_grace_seconds 更改为较低的值(假设为 1 天)。如果在X+2天我启动nodetool Compact,旧数据真的会从磁盘中删除吗?换句话说,墓碑在创建时包含删除时间而不是过期时间,对吗?

是的,你在这一点上是正确的。墓碑包含删除时间。过期时间取决于表的 gc_grace_seconds 值。

您通常不应该运行nodetoolcompact命令(主要压缩)并且您的压缩应该自动运行(次要压缩)。

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 ?

Yes tombstones are not removed if compaction is run before gc_grace_seconds.

Instead, if I start nodetool compact at a time higher than X+10 days the old data is really removed from disk ?

Generally yes but depends on compaction strategy also. So you cannot be 100% sure of this.

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 start nodetool 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 ?

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文