[
https://issues.apache.org/jira/browse/CASSANDRA-8390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14268185#comment-14268185
]
Joshua McKenzie commented on CASSANDRA-8390:
--------------------------------------------
In SSTableDeletingTask, we function under the assumption that once we're
successfully able to delete the data file we should be able to delete the other
components of an SSTable without issue as all internal handles will be closed
at this time and mapped buffers unmapped. The problem comes in when we have
external applications (A/V, Windows Search, anything that provides a [file
system
driver|http://msdn.microsoft.com/en-us/library/windows/hardware/dn641617(v=vs.85).aspx]
in the kernel) that hold handles to a file that we're trying to delete as our
deletion could fail. Given the import of failed file deletion (filling up a
drive and killing a node), by default the disk_failure_policy in
conf/cassandra.yaml is to stop.
File locks and deleting difficulties on a Cassandra cluster should not happen.
This is why we've pursued CASSANDRA-4050 for the 3.0 release and have
temporarily disabled memory-mapped I/O until we have a more robust solution to
work around file deletion issues on Windows.
> The process cannot access the file because it is being used by another process
> ------------------------------------------------------------------------------
>
> Key: CASSANDRA-8390
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8390
> Project: Cassandra
> Issue Type: Bug
> Reporter: Ilya Komolkin
> Assignee: Joshua McKenzie
> Fix For: 2.1.3
>
> Attachments: NoHostAvailableLogs.zip
>
>
> {code}21:46:27.810 [NonPeriodicTasks:1] ERROR o.a.c.service.CassandraDaemon -
> Exception in thread Thread[NonPeriodicTasks:1,5,main]
> org.apache.cassandra.io.FSWriteError: java.nio.file.FileSystemException:
> E:\Upsource_12391\data\cassandra\data\kernel\filechangehistory_t-a277b560764611e48c8e4915424c75fe\kernel-filechangehistory_t-ka-33-Index.db:
> The process cannot access the file because it is being used by another
> process.
>
> at
> org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:135)
> ~[cassandra-all-2.1.1.jar:2.1.1]
> at
> org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:121)
> ~[cassandra-all-2.1.1.jar:2.1.1]
> at
> org.apache.cassandra.io.sstable.SSTable.delete(SSTable.java:113)
> ~[cassandra-all-2.1.1.jar:2.1.1]
> at
> org.apache.cassandra.io.sstable.SSTableDeletingTask.run(SSTableDeletingTask.java:94)
> ~[cassandra-all-2.1.1.jar:2.1.1]
> at
> org.apache.cassandra.io.sstable.SSTableReader$6.run(SSTableReader.java:664)
> ~[cassandra-all-2.1.1.jar:2.1.1]
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> ~[na:1.7.0_71]
> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> ~[na:1.7.0_71]
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
> ~[na:1.7.0_71]
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
> ~[na:1.7.0_71]
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> ~[na:1.7.0_71]
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> [na:1.7.0_71]
> at java.lang.Thread.run(Thread.java:745) [na:1.7.0_71]
> Caused by: java.nio.file.FileSystemException:
> E:\Upsource_12391\data\cassandra\data\kernel\filechangehistory_t-a277b560764611e48c8e4915424c75fe\kernel-filechangehistory_t-ka-33-Index.db:
> The process cannot access the file because it is being used by another
> process.
>
> at
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> ~[na:1.7.0_71]
> at
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> ~[na:1.7.0_71]
> at
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> ~[na:1.7.0_71]
> at
> sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)
> ~[na:1.7.0_71]
> at
> sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
> ~[na:1.7.0_71]
> at java.nio.file.Files.delete(Files.java:1079) ~[na:1.7.0_71]
> at
> org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:131)
> ~[cassandra-all-2.1.1.jar:2.1.1]
> ... 11 common frames omitted{code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)