You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Jim Newsham (Created) (JIRA)" <ji...@apache.org> on 2012/03/14 21:22:37 UTC

[jira] [Created] (CASSANDRA-4050) cassandra unnecessarily holds file locks on snapshot files

cassandra unnecessarily holds file locks on snapshot files
----------------------------------------------------------

                 Key: CASSANDRA-4050
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4050
             Project: Cassandra
          Issue Type: Bug
    Affects Versions: 1.0.8
         Environment: Windows 7
            Reporter: Jim Newsham


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" [in Windows Explorer].  If I terminate Cassandra, then I can delete the directory with no problem.

I expect to be able to move or delete the snapshotted files while Cassandra is running, as this should not affect the runtime operation of Cassandra.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4050) cassandra unnecessarily holds file locks on snapshot files

Posted by "Jim Newsham (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13229883#comment-13229883 ] 

Jim Newsham commented on CASSANDRA-4050:
----------------------------------------

Yeah I'm starting to think that might be true -- unfortunately.  I haven't found anything definitive, but the following postings imply a hardlink cannot be deleted while another hardlink to the same file is locked:

http://superuser.com/questions/387136/is-it-possible-to-delete-a-hardlink-to-a-locked-file
http://superuser.com/questions/301303/one-hardlink-is-locked-how-do-i-remove-the-other

Perhaps the data structure that records the lock is in the file object and not the hardlink object.
                
> cassandra unnecessarily holds file locks on snapshot files
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-4050
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4050
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.0.8
>         Environment: Windows 7
>            Reporter: Jim Newsham
>            Priority: Minor
>
> 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" [in Windows Explorer].  If I terminate Cassandra, then I can delete the directory with no problem.
> I expect to be able to move or delete the snapshotted files while Cassandra is running, as this should not affect the runtime operation of Cassandra.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4050) cassandra unnecessarily holds file locks on snapshot files

Posted by "Alexander Kashirin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470759#comment-13470759 ] 

Alexander Kashirin commented on CASSANDRA-4050:
-----------------------------------------------

I have the same problem with Cassandra 1.1.5 on Windows 7 and Windows Server 2008 R2:

The nodetool stably creates snapshots that can't be deleted by the "clearsnapshot" command later (- IOException: Failed to delete ...). The bare facts are below.
 
For some (not for all) snapshot files (= hard links):
 
1) WinExplorer->Delete says "The process cannot access the file because it is being used by another process".
2) Command interpreter writes "Access denied" on "del" command.
3) Troubleshooting tools (- "Process Explorer" and "Unlocker") do not find open file handles. Moreover, Unlocker is able to delete these files without problems.
4) The files become deletable by the rest tools just after Cassandra-server has been stopped.
5) After restart, the same files become locked again.
6) Everything repeats after computer has been restarted.



                
> cassandra unnecessarily holds file locks on snapshot files
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-4050
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4050
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.0.8
>         Environment: Windows 7
>            Reporter: Jim Newsham
>            Priority: Minor
>
> 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" [in Windows Explorer].  If I terminate Cassandra, then I can delete the directory with no problem.
> I expect to be able to move or delete the snapshotted files while Cassandra is running, as this should not affect the runtime operation of Cassandra.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CASSANDRA-4050) cassandra unnecessarily holds file locks on snapshot files

Posted by "Jonathan Ellis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-4050:
--------------------------------------

    Priority: Minor  (was: Major)

Currently we take the snapshot using mklink /H, but I've experimented with the Java7 Files.createLink and see the same behavior.  It may simply be normal behavior for Windows that links are considered "open" until their creator is closed.


                
> cassandra unnecessarily holds file locks on snapshot files
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-4050
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4050
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.0.8
>         Environment: Windows 7
>            Reporter: Jim Newsham
>            Priority: Minor
>
> 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" [in Windows Explorer].  If I terminate Cassandra, then I can delete the directory with no problem.
> I expect to be able to move or delete the snapshotted files while Cassandra is running, as this should not affect the runtime operation of Cassandra.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CASSANDRA-4050) cassandra unnecessarily holds file locks on snapshot files

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-4050?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470901#comment-13470901 ] 

Jonathan Ellis commented on CASSANDRA-4050:
-------------------------------------------

Right, so NTFS is locking the underlying data since the "original" sstable is still open in Cassandra, so the behavior described by Jim applies.  We'd have to add a workaround like the one given on superuser.com -- move the links to a "garbage" location to clean up on restart.

This is pretty low priority for me but I'd be glad to point someone interested in the right direction.
                
> cassandra unnecessarily holds file locks on snapshot files
> ----------------------------------------------------------
>
>                 Key: CASSANDRA-4050
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4050
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: Windows 7
>            Reporter: Jim Newsham
>            Priority: Minor
>
> 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" [in Windows Explorer].  If I terminate Cassandra, then I can delete the directory with no problem.
> I expect to be able to move or delete the snapshotted files while Cassandra is running, as this should not affect the runtime operation of Cassandra.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CASSANDRA-4050) Unable to remove snapshot files on Windows while original sstables are live

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-4050?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-4050:
--------------------------------------

    Affects Version/s:     (was: 1.0.8)
              Summary: Unable to remove snapshot files on Windows while original sstables are live  (was: cassandra unnecessarily holds file locks on snapshot files)
    
> Unable to remove snapshot files on Windows while original sstables are live
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-4050
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4050
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: Windows 7
>            Reporter: Jim Newsham
>            Priority: Minor
>
> 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" [in Windows Explorer].  If I terminate Cassandra, then I can delete the directory with no problem.
> I expect to be able to move or delete the snapshotted files while Cassandra is running, as this should not affect the runtime operation of Cassandra.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira