You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Joshua McKenzie (JIRA)" <ji...@apache.org> on 2014/04/05 00:03:20 UTC

[jira] [Commented] (CASSANDRA-6283) Windows 7 data files keept open / can't be deleted after compaction.

    [ https://issues.apache.org/jira/browse/CASSANDRA-6283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13960479#comment-13960479 ] 

Joshua McKenzie commented on CASSANDRA-6283:
--------------------------------------------

On CASSANDRA-4050 we're converting our RandomAccessReader to use nio which should fix the "can't delete a hard-link while original file is open" for most use-cases.  Unfortunately you cannot delete hard-linked files on Windows if you have a memory-mapped segment in the original file - I've done some benchmarking on CASSANDRA-6890 regarding removing memory mapped I/O and the performance cost / feature loss is high enough that we're going to keep it for now.

I'll put together a patch for this ticket to create something similar to an SSTableDeletingTask for a snapshot folder - walk the files and try to delete them, re-scheduling a job to try and clear this folder again after a GC if there's any failures due to access violations.  That combined with CASSANDRA-4050 should give us immediate and full clear on compressed cf's and partial / incrementally improving snapshot clearing on snapshots where there's memory mapped readers to the original sstables.

I don't like having partially cleared out snapshots floating around on the file-system though.  I'd guess this will cause some confusion for people in the future.

> Windows 7 data files keept open / can't be deleted after compaction.
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-6283
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6283
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>         Environment: Windows 7 (32) / Java 1.7.0.45
>            Reporter: Andreas Schnitzerling
>            Assignee: Joshua McKenzie
>              Labels: compaction
>             Fix For: 2.0.7
>
>         Attachments: 6283_StreamWriter_patch.txt, leakdetect.patch, neighbor-log.zip, root-log.zip, screenshot-1.jpg, system.log
>
>
> Files cannot be deleted, patch CASSANDRA-5383 (Win7 deleting problem) doesn't help on Win-7 on Cassandra 2.0.2. Even 2.1 Snapshot is not running. The cause is: Opened file handles seem to be lost and not closed properly. Win 7 blames, that another process is still using the file (but its obviously cassandra). Only restart of the server makes the files deleted. But after heavy using (changes) of tables, there are about 24K files in the data folder (instead of 35 after every restart) and Cassandra crashes. I experiminted and I found out, that a finalizer fixes the problem. So after GC the files will be deleted (not optimal, but working fine). It runs now 2 days continously without problem. Possible fix/test:
> I wrote the following finalizer at the end of class org.apache.cassandra.io.util.RandomAccessReader:
> {code:title=RandomAccessReader.java|borderStyle=solid}
> @Override
> protected void finalize() throws Throwable {
> 	deallocate();
> 	super.finalize();
> }
> {code}
> Can somebody test / develop / patch it? Thx.



--
This message was sent by Atlassian JIRA
(v6.2#6252)