You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Ben Hood <0x...@gmail.com> on 2014/02/26 16:14:53 UTC
Flushing after dropping a column family
Hi,
I'm trying to truncate data on a single node 2.0.5 instance and I'm
noticing that using either TRUNCATE or DROP/CREATE in cqlsh appear to
leave the underlying data behind.
So I was wondering what nodetool operation I should use to completely
nuke the old data, short of dropping the entire keyspace.
Cheers,
Ben
Re: Flushing after dropping a column family
Posted by Robert Wille <rw...@fold3.com>.
I use truncate between my test cases. Never had a problem with one test
case inheriting the data from the previous one. I¹m using a single node,
so that may be why.
On 2/26/14, 9:27 AM, "Ben Hood" <0x...@gmail.com> wrote:
>On Wed, Feb 26, 2014 at 3:58 PM, DuyHai Doan <do...@gmail.com> wrote:
>> Try truncate foo instead of drop table foo.
>>
>> About the nodetool clearsnapshot, I've experienced the same behavior
>>also
>> before. Snapshots cleaning is not immediate
>
>I get the same behavior with truncate as well.
Re: Flushing after dropping a column family
Posted by Ben Hood <0x...@gmail.com>.
On Wed, Feb 26, 2014 at 3:58 PM, DuyHai Doan <do...@gmail.com> wrote:
> Try truncate foo instead of drop table foo.
>
> About the nodetool clearsnapshot, I've experienced the same behavior also
> before. Snapshots cleaning is not immediate
I get the same behavior with truncate as well.
Re: Flushing after dropping a column family
Posted by DuyHai Doan <do...@gmail.com>.
Try truncate foo instead of drop table foo.
About the nodetool clearsnapshot, I've experienced the same behavior also
before. Snapshots cleaning is not immediate
On Wed, Feb 26, 2014 at 4:53 PM, Ben Hood <0x...@gmail.com> wrote:
> On Wed, Feb 26, 2014 at 3:17 PM, DuyHai Doan <do...@gmail.com> wrote:
> > "I'm noticing that using either TRUNCATE or DROP/CREATE in cqlsh appear
> to
> > leave the underlying data behind."
> >
> > --> What do you mean by "underlying data" ? Are you talking about
> > "snapshots" ?
>
> I was referring to all of the state related to the particular column
> family I want to set fire to, be it snapshots, parts of commit logs,
> sstables, key caches, row caches, or anything else on or off disk that
> relates to said column family.
>
> > If yes, you can wipe them using nodetool clearsnapshots command
>
> This is what I'm doing:
>
> cqlsh:bar> drop table foo;
>
> $ nodetool clearsnapshot bar
> Requested clearing snapshot for: bar
>
> cqlsh:bar> create table foo (....);
> cqlsh:bar> select * from foo limit 1;
>
> This returns nothing (as you would expect).
>
> But this if I re-run this again after about a minute, the data is back.
>
> I get the same behavior if I use nodetool cleanup, flush, compact or
> repair.
>
> It's as if there is either a background app process filling the table
> up again or if the deletion hasn't taken place.
>
Re: Flushing after dropping a column family
Posted by DuyHai Doan <do...@gmail.com>.
I've played with it using a 2 nodes cluster with auto_snapshot = false in
cassandra.yaml and by deactivating durable write (no commitlog). In my
case, truncating tables allows cleaning up data.
With "nodetool status", I can see the data payload decreasing from Gb to
some kbytes
On Wed, Feb 26, 2014 at 4:59 PM, Tupshin Harper <tu...@tupshin.com> wrote:
> This is a known issue that is fixed in 2.1beta1.
> https://issues.apache.org/jira/browse/CASSANDRA-5202
>
> Until 2.1, we do not recommend relying on the recycling of tables through
> drop/create or truncate.
>
> However, on a single node cluster, I suspect that truncate will work far
> more reliably than drop/recreate.
>
> -Tupshin
>
>
> On Wed, Feb 26, 2014 at 10:53 AM, Ben Hood <0x...@gmail.com> wrote:
>
>> On Wed, Feb 26, 2014 at 3:17 PM, DuyHai Doan <do...@gmail.com>
>> wrote:
>> > "I'm noticing that using either TRUNCATE or DROP/CREATE in cqlsh appear
>> to
>> > leave the underlying data behind."
>> >
>> > --> What do you mean by "underlying data" ? Are you talking about
>> > "snapshots" ?
>>
>> I was referring to all of the state related to the particular column
>> family I want to set fire to, be it snapshots, parts of commit logs,
>> sstables, key caches, row caches, or anything else on or off disk that
>> relates to said column family.
>>
>> > If yes, you can wipe them using nodetool clearsnapshots command
>>
>> This is what I'm doing:
>>
>> cqlsh:bar> drop table foo;
>>
>> $ nodetool clearsnapshot bar
>> Requested clearing snapshot for: bar
>>
>> cqlsh:bar> create table foo (....);
>> cqlsh:bar> select * from foo limit 1;
>>
>> This returns nothing (as you would expect).
>>
>> But this if I re-run this again after about a minute, the data is back.
>>
>> I get the same behavior if I use nodetool cleanup, flush, compact or
>> repair.
>>
>> It's as if there is either a background app process filling the table
>> up again or if the deletion hasn't taken place.
>>
>
>
Re: Flushing after dropping a column family
Posted by Ben Hood <0x...@gmail.com>.
On Wed, Feb 26, 2014 at 3:59 PM, Tupshin Harper <tu...@tupshin.com> wrote:
> This is a known issue that is fixed in 2.1beta1.
> https://issues.apache.org/jira/browse/CASSANDRA-5202
>
> Until 2.1, we do not recommend relying on the recycling of tables through
> drop/create or truncate.
>
> However, on a single node cluster, I suspect that truncate will work far
> more reliably than drop/recreate.
Cool, thanks for the heads up.
Short of using 2.1beta1, is there a more stable way of recycling tables?
Re: Flushing after dropping a column family
Posted by Tupshin Harper <tu...@tupshin.com>.
This is a known issue that is fixed in 2.1beta1.
https://issues.apache.org/jira/browse/CASSANDRA-5202
Until 2.1, we do not recommend relying on the recycling of tables through
drop/create or truncate.
However, on a single node cluster, I suspect that truncate will work far
more reliably than drop/recreate.
-Tupshin
On Wed, Feb 26, 2014 at 10:53 AM, Ben Hood <0x...@gmail.com> wrote:
> On Wed, Feb 26, 2014 at 3:17 PM, DuyHai Doan <do...@gmail.com> wrote:
> > "I'm noticing that using either TRUNCATE or DROP/CREATE in cqlsh appear
> to
> > leave the underlying data behind."
> >
> > --> What do you mean by "underlying data" ? Are you talking about
> > "snapshots" ?
>
> I was referring to all of the state related to the particular column
> family I want to set fire to, be it snapshots, parts of commit logs,
> sstables, key caches, row caches, or anything else on or off disk that
> relates to said column family.
>
> > If yes, you can wipe them using nodetool clearsnapshots command
>
> This is what I'm doing:
>
> cqlsh:bar> drop table foo;
>
> $ nodetool clearsnapshot bar
> Requested clearing snapshot for: bar
>
> cqlsh:bar> create table foo (....);
> cqlsh:bar> select * from foo limit 1;
>
> This returns nothing (as you would expect).
>
> But this if I re-run this again after about a minute, the data is back.
>
> I get the same behavior if I use nodetool cleanup, flush, compact or
> repair.
>
> It's as if there is either a background app process filling the table
> up again or if the deletion hasn't taken place.
>
Re: Flushing after dropping a column family
Posted by Ben Hood <0x...@gmail.com>.
On Wed, Feb 26, 2014 at 3:17 PM, DuyHai Doan <do...@gmail.com> wrote:
> "I'm noticing that using either TRUNCATE or DROP/CREATE in cqlsh appear to
> leave the underlying data behind."
>
> --> What do you mean by "underlying data" ? Are you talking about
> "snapshots" ?
I was referring to all of the state related to the particular column
family I want to set fire to, be it snapshots, parts of commit logs,
sstables, key caches, row caches, or anything else on or off disk that
relates to said column family.
> If yes, you can wipe them using nodetool clearsnapshots command
This is what I'm doing:
cqlsh:bar> drop table foo;
$ nodetool clearsnapshot bar
Requested clearing snapshot for: bar
cqlsh:bar> create table foo (....);
cqlsh:bar> select * from foo limit 1;
This returns nothing (as you would expect).
But this if I re-run this again after about a minute, the data is back.
I get the same behavior if I use nodetool cleanup, flush, compact or repair.
It's as if there is either a background app process filling the table
up again or if the deletion hasn't taken place.
Re: Flushing after dropping a column family
Posted by DuyHai Doan <do...@gmail.com>.
"I'm noticing that using either TRUNCATE or DROP/CREATE in cqlsh appear to
leave the underlying data behind."
--> What do you mean by "underlying data" ? Are you talking about
"snapshots" ?
If yes, you can wipe them using nodetool clearsnapshots command
On Wed, Feb 26, 2014 at 4:14 PM, Ben Hood <0x...@gmail.com> wrote:
> Hi,
>
> I'm trying to truncate data on a single node 2.0.5 instance and I'm
> noticing that using either TRUNCATE or DROP/CREATE in cqlsh appear to
> leave the underlying data behind.
>
> So I was wondering what nodetool operation I should use to completely
> nuke the old data, short of dropping the entire keyspace.
>
> Cheers,
>
> Ben
>