Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-8551

Windows - Failure to rename file during compaction - unit test only

    XMLWordPrintableJSON

Details

    • Low

    Description

      This occurs on both 2.1 and trunk on Windows.

      The error is as follows:

      ERROR 21:42:48 Fatal exception in thread Thread[CompactionExecutor:3,1,main]
      java.lang.RuntimeException: Failed to rename build\test\cassandra\data;0\system\schema_columns-296e9c049bec3085827dc17d3df2122a\system-schema_columns-tmp-ka-10-Index.db to build\test\cassandra\data;0\system\schema_columns-296e9c049bec3085827dc17d3df2122a\system-schema_columns-ka-10-Index.db
      at org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:170) ~[main/:na]
      at org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:154) ~[main/:na]
      at org.apache.cassandra.io.sstable.SSTableWriter.rename(SSTableWriter.java:569) ~[main/:na]
      at org.apache.cassandra.io.sstable.SSTableWriter.rename(SSTableWriter.java:561) ~[main/:na]
      at org.apache.cassandra.io.sstable.SSTableWriter.close(SSTableWriter.java:535) ~[main/:na]
      at org.apache.cassandra.io.sstable.SSTableWriter.finish(SSTableWriter.java:470) ~[main/:na]
      at org.apache.cassandra.io.sstable.SSTableRewriter.finishAndMaybeThrow(SSTableRewriter.java:349) ~[main/:na]
      at org.apache.cassandra.io.sstable.SSTableRewriter.finish(SSTableRewriter.java:324) ~[main/:na]
      at org.apache.cassandra.io.sstable.SSTableRewriter.finish(SSTableRewriter.java:304) ~[main/:na]
      at org.apache.cassandra.db.compaction.CompactionTask.runMayThrow(CompactionTask.java:201) ~[main/:na]
      at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) ~[main/:na]
      at org.apache.cassandra.db.compaction.CompactionTask.executeInternal(CompactionTask.java:75) ~[main/:na]
      at org.apache.cassandra.db.compaction.AbstractCompactionTask.execute(AbstractCompactionTask.java:59) ~[main/:na]
      at org.apache.cassandra.db.compaction.CompactionManager$BackgroundCompactionTask.run(CompactionManager.java:226) ~[main/:na]
      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.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: build\test\cassandra\data;0\system\schema_columns-296e9c049bec3085827dc17d3df2122a\system-schema_columns-tmp-ka-10-Index.db -> build\test\cassandra\data;0\system\schema_columns-296e9c049bec3085827dc17d3df2122a\system-schema_columns-ka-10-Index.db: The process cannot access the file because it is being used by another process.
      

      The rename operation from -tmp to final sstable name fails on Windows as something still has a handle open to the file. This occurs during unit tests only so marking as minor, but it's incredibly noisy so it's best to fix it.

      Attachments

        Issue Links

          Activity

            People

              JoshuaMcKenzie Joshua McKenzie
              JoshuaMcKenzie Joshua McKenzie
              Joshua McKenzie
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: