cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Watanabe Maki <>
Subject Re: snapshot files locked
Date Thu, 15 Mar 2012 00:04:01 GMT
It's true on unix, but you can't delete hard links of opened files on windows.
Try following:
1  Create a text file ORIG.TXT
  Now you have hard link LINK.TXT .
3  Open ORIG.TXT with MS Word.
    It returns error.

Interesting thing is that you can delete link.txt if you open orig.txt with notepad. 
Notepad may close file after load, or it may be using different API.

On 2012/03/15, at 5:04, Jim Newsham <> wrote:

> Hi Maki,
> Thanks for the reply.  Yes, I understand that snapshots are hard links.  However, my
understanding is that removing any hard-linked files just removes the link (decrementing the
link counter of the file on disk) -- it does not delete the file itself nor remove any other
links which may be pointing at the file.  To confirm my understanding, I tested this in Windows
by terminating Cassandra and then deleting all files in the snapshot dir.  None of the corresponding
files in the parent keyspace directory were removed.
> Regards,
> Jim
> On 3/13/2012 9:29 PM, Maki Watanabe wrote:
>> snapshot files are "hardlink"s of the original sstables.
>> As you know, on windows, you can't delete files opened by other process.
>> If you try to delete the "hardlink", windows thinks you try to delete
>> the sstables in production.
>> maki
>> 2012/3/14 Jim Newsham<>:
>>> Hi,
>>> I'm using Cassandra 1.0.8, on Windows 7.  When I take a snapshot of the
>>> database, I find that I am unable to delete the snapshot directory (i.e.,
>>> dir named "{datadir}\{keyspacename}\snapshots\{snapshottag}") while
>>> Cassandra is running:  "The action can't be completed because the folder or
>>> a file in it is open in another program.  Close the folder or file and try
>>> again".  If I terminate Cassandra, then I can delete the directory with no
>>> problem.  Is there a reason why Cassandra must hold onto these files?
>>> Thanks,
>>> Jim

View raw message