You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Kévin LOVATO <kl...@alprema.com> on 2015/06/05 17:30:25 UTC

TTL and gc_grace_period

Hi,

I have a column family with data (metrics) that is never overwritten and
only deleted using TTLs, and I am wondering if it would be reasonable to
have a very low gc_grace_period (even 0) on that CF. I would like to do
that mainly to save space and also to prevent tombstone scanning.

>From what I understand of what I could read online, when an expired TTLed
column is compacted, it is replaced by a tombstone, so having
gc_grace_period would prevent that. Although this would allow the
appearance of ghost/zombie columns.

The question I'm trying to answer here is the following: Would those ghost
columns be able to appear, and if so, would it be a problem, since they
would themselves be marked as "expired"?

Thanks,

Kévin

Re: TTL and gc_grace_period

Posted by Tyler Hobbs <ty...@datastax.com>.
On Fri, Jun 5, 2015 at 11:02 AM, Kévin LOVATO <kl...@alprema.com> wrote:

> Great, so is there any reason I wouldn't want to set gc_grace_seconds to 0
> on an "insert once/ttl only" column family, since it feels like the best
> thing to do?


Nope, setting gc_grace_seconds to 0 is just fine in your case.


-- 
Tyler Hobbs
DataStax <http://datastax.com/>

Re: TTL and gc_grace_period

Posted by Kévin LOVATO <kl...@alprema.com>.
Great, so is there any reason I wouldn't want to set gc_grace_seconds to 0
on an "insert once/ttl only" column family, since it feels like the best
thing to do?

On Fri, Jun 5, 2015 at 5:35 PM, Tyler Hobbs <ty...@datastax.com> wrote:

>
> On Fri, Jun 5, 2015 at 10:30 AM, Kévin LOVATO <kl...@alprema.com> wrote:
>
>>
>> I have a column family with data (metrics) that is never overwritten and
>> only deleted using TTLs, and I am wondering if it would be reasonable to
>> have a very low gc_grace_period (even 0) on that CF. I would like to do
>> that mainly to save space and also to prevent tombstone scanning.
>>
>
> Yes, you can safely lower gc_grace_seconds.  You would only _not_ want to
> lower gc_grace_seconds if you did deletes or overwrote cells with a lower
> TTL.
>
>
>>
>> From what I understand of what I could read online, when an expired TTLed
>> column is compacted, it is replaced by a tombstone, so having
>> gc_grace_period would prevent that. Although this would allow the
>> appearance of ghost/zombie columns.
>>
>> The question I'm trying to answer here is the following: Would those
>> ghost columns be able to appear, and if so, would it be a problem, since
>> they would themselves be marked as "expired"?
>>
>
> You don't need to worry about expired data being revived because every
> node that has a copy of that data will have the same TTL.
>
>
> --
> Tyler Hobbs
> DataStax <http://datastax.com/>
>

Re: TTL and gc_grace_period

Posted by Tyler Hobbs <ty...@datastax.com>.
On Fri, Jun 5, 2015 at 10:30 AM, Kévin LOVATO <kl...@alprema.com> wrote:

>
> I have a column family with data (metrics) that is never overwritten and
> only deleted using TTLs, and I am wondering if it would be reasonable to
> have a very low gc_grace_period (even 0) on that CF. I would like to do
> that mainly to save space and also to prevent tombstone scanning.
>

Yes, you can safely lower gc_grace_seconds.  You would only _not_ want to
lower gc_grace_seconds if you did deletes or overwrote cells with a lower
TTL.


>
> From what I understand of what I could read online, when an expired TTLed
> column is compacted, it is replaced by a tombstone, so having
> gc_grace_period would prevent that. Although this would allow the
> appearance of ghost/zombie columns.
>
> The question I'm trying to answer here is the following: Would those ghost
> columns be able to appear, and if so, would it be a problem, since they
> would themselves be marked as "expired"?
>

You don't need to worry about expired data being revived because every node
that has a copy of that data will have the same TTL.


-- 
Tyler Hobbs
DataStax <http://datastax.com/>