You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Sergio Bilello <la...@gmail.com> on 2020/04/30 17:47:18 UTC

Nodetool clearsnapshot does not delete snapshot for dropped column_family

Hi guys!
I am running cassandra 3.11.4. I dropped a column_family but I am able to see the disk space occupied by that column_family in the disk. I understood that since I have the auto_snapshot flag = true this behavior is expected.
However, I would like to avoid to write a dummy script that removes the column_family folder for each node.
I tried the nodetool clearsnapshot command but it didn't work and when I try to nodetool listsnapshots I don't see anything. It is like hidden that space occupied.

Any suggestion?

Thanks,

Sergio

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@cassandra.apache.org
For additional commands, e-mail: user-help@cassandra.apache.org


Re: Nodetool clearsnapshot does not delete snapshot for dropped column_family

Posted by Sebastian Estevez <se...@datastax.com>.
Perhaps you had a DDL collision and ended up with two data dirs for the
table?

In that case running drop table would only move the active table directory
to snapshots and as Eric suggested would leave the data in the duplicate
directory "orphaned".

I haven't tried to reproduce this yet but I think given how DDL works in c*
it checks out as a possible scenario.

Keep calm and Cassandra on folks,

Seb


On Thu, Apr 30, 2020, 7:46 PM Sergio <la...@gmail.com> wrote:

> The problem is that folder is not under snapshot but it is under the data
> path.
> I tried with the --all switch too
> Thanks,
> Sergio
>
> On Thu, Apr 30, 2020, 4:21 PM Nitan Kainth <ni...@gmail.com> wrote:
>
>> I don't think it works like that. clearsnapshot --all would remove all
>> snapshots. Here is an example:
>>
>> $ ls -l
>> /ss/xx/cassandra/data/ww/a-5bf825428b3811eabe0c6b7631a60bb0/snapshots/
>>
>> total 8
>>
>> drwxr-xr-x 2 cassandra cassandra 4096 Apr 30 23:17
>> dropped-1588288650821-a
>>
>> drwxr-xr-x 2 cassandra cassandra 4096 Apr 30 23:17 manual
>>
>> $ nodetool clearsnapshot --all
>>
>> Requested clearing snapshot(s) for [all keyspaces] with [all snapshots]
>>
>> $ ls -l
>> /ss/xx/cassandra/data/ww/a-5bf825428b3811eabe0c6b7631a60bb0/snapshots/
>>
>> ls: cannot access
>> /ss/xx/cassandra/data/ww/a-5bf825428b3811eabe0c6b7631a60bb0/snapshots/:
>> No such file or directory
>>
>> $
>>
>>
>> On Thu, Apr 30, 2020 at 5:44 PM Erick Ramirez <er...@datastax.com>
>> wrote:
>>
>>> Yes, you're right. It doesn't show up in listsnapshots nor does
>>> clearsnapshot remove the dropped snapshot because the table is no
>>> longer managed by C* (because it got dropped). So you will need to manually
>>> remove the dropped-* directories from the filesystem.
>>>
>>> Someone here will either correct me or hopefully provide a
>>> user-friendlier solution. Cheers!
>>>
>>

Re: Nodetool clearsnapshot does not delete snapshot for dropped column_family

Posted by Sergio <la...@gmail.com>.
The problem is that folder is not under snapshot but it is under the data
path.
I tried with the --all switch too
Thanks,
Sergio

On Thu, Apr 30, 2020, 4:21 PM Nitan Kainth <ni...@gmail.com> wrote:

> I don't think it works like that. clearsnapshot --all would remove all
> snapshots. Here is an example:
>
> $ ls -l
> /ss/xx/cassandra/data/ww/a-5bf825428b3811eabe0c6b7631a60bb0/snapshots/
>
> total 8
>
> drwxr-xr-x 2 cassandra cassandra 4096 Apr 30 23:17 dropped-1588288650821-a
>
> drwxr-xr-x 2 cassandra cassandra 4096 Apr 30 23:17 manual
>
> $ nodetool clearsnapshot --all
>
> Requested clearing snapshot(s) for [all keyspaces] with [all snapshots]
>
> $ ls -l
> /ss/xx/cassandra/data/ww/a-5bf825428b3811eabe0c6b7631a60bb0/snapshots/
>
> ls: cannot access
> /ss/xx/cassandra/data/ww/a-5bf825428b3811eabe0c6b7631a60bb0/snapshots/:
> No such file or directory
>
> $
>
>
> On Thu, Apr 30, 2020 at 5:44 PM Erick Ramirez <er...@datastax.com>
> wrote:
>
>> Yes, you're right. It doesn't show up in listsnapshots nor does
>> clearsnapshot remove the dropped snapshot because the table is no longer
>> managed by C* (because it got dropped). So you will need to manually remove
>> the dropped-* directories from the filesystem.
>>
>> Someone here will either correct me or hopefully provide a
>> user-friendlier solution. Cheers!
>>
>

Re: Nodetool clearsnapshot does not delete snapshot for dropped column_family

Posted by Nitan Kainth <ni...@gmail.com>.
I don't think it works like that. clearsnapshot --all would remove all
snapshots. Here is an example:

$ ls -l
/ss/xx/cassandra/data/ww/a-5bf825428b3811eabe0c6b7631a60bb0/snapshots/

total 8

drwxr-xr-x 2 cassandra cassandra 4096 Apr 30 23:17 dropped-1588288650821-a

drwxr-xr-x 2 cassandra cassandra 4096 Apr 30 23:17 manual

$ nodetool clearsnapshot --all

Requested clearing snapshot(s) for [all keyspaces] with [all snapshots]

$ ls -l
/ss/xx/cassandra/data/ww/a-5bf825428b3811eabe0c6b7631a60bb0/snapshots/

ls: cannot access
/ss/xx/cassandra/data/ww/a-5bf825428b3811eabe0c6b7631a60bb0/snapshots/: No
such file or directory

$


On Thu, Apr 30, 2020 at 5:44 PM Erick Ramirez <er...@datastax.com>
wrote:

> Yes, you're right. It doesn't show up in listsnapshots nor does
> clearsnapshot remove the dropped snapshot because the table is no longer
> managed by C* (because it got dropped). So you will need to manually remove
> the dropped-* directories from the filesystem.
>
> Someone here will either correct me or hopefully provide a user-friendlier
> solution. Cheers!
>

Re: Nodetool clearsnapshot does not delete snapshot for dropped column_family

Posted by Erick Ramirez <er...@datastax.com>.
Yes, you're right. It doesn't show up in listsnapshots nor does
clearsnapshot remove the dropped snapshot because the table is no longer
managed by C* (because it got dropped). So you will need to manually remove
the dropped-* directories from the filesystem.

Someone here will either correct me or hopefully provide a user-friendlier
solution. Cheers!