[
https://issues.apache.org/jira/browse/CASSANDRA-8598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Joshua McKenzie updated CASSANDRA-8598:
---------------------------------------
Attachment: 8598_v1.txt
SSTableRewriterTest.testFileRemoval was failing and leaving files sitting
around causing other tests to fail. It looks like the root cause is that after
the call to s.releaseReference(), we're expecting the tmplink files to be
removed and asserting to that effect. This fails on Windows since
SequentialWriter.out is a RandomAccessFile, meaning it doesn't have the
FILE_SHARE_DELETE flag so files can't be deleted while still open. Indeed, the
"Unable to delete" SSTableDeletingTask message pops up in the logs during that
unit test right before assertion failure.
I've attached a v1 that changes some of the logic on the test (marks s2 as
replacing s1) and removes the assertion that expects the tmplink file to be
gone before the writer is closed or aborted and the test now passes on trunk in
Windows. Ultimately the test is a little less granular and we lose the
confirmation that the releaseReferences deletes the files before the writer is
closed (since that differs based on platform), however after CASSANDRA-8535 and
CASSANDRA-8551 this problem will likely be addressed.
[~krummas]: Care to review? Should be trivial and you're quite familiar with
the test code in question.
> Windows - SSTableRewriterTest fails on trunk
> --------------------------------------------
>
> Key: CASSANDRA-8598
> URL: https://issues.apache.org/jira/browse/CASSANDRA-8598
> Project: Cassandra
> Issue Type: Bug
> Reporter: Joshua McKenzie
> Assignee: Joshua McKenzie
> Priority: Minor
> Labels: Windows
> Fix For: 3.0
>
> Attachments: 8598_v1.txt
>
>
> Right at the top of the test, we see:
> {noformat}
> [junit] ERROR 18:15:05 Unable to delete
> build\test\cassandra\data;0\SSTableRewriterTest\Standard1-e63f49c09a8611e4bebb8ff5e6ab1035\tmplink-la-27-big-Data.db
> (it will be removed on server restart; we'll also retry after GC)
> [junit] ERROR 18:15:05 Unable to delete
> build\test\cassandra\data;0\SSTableRewriterTest\Standard1-e63f49c09a8611e4bebb8ff5e6ab1035\tmplink-la-27-big-Data.db
> (it will be removed on server restart; we'll also retry after GC)
> [junit] ------------- ---------------- ---------------
> [junit] Testcase:
> testFileRemoval(org.apache.cassandra.io.sstable.SSTableRewriterTest):
> FAILED
> [junit] expected:<0> but was:<2>
> [junit] junit.framework.AssertionFailedError: expected:<0> but was:<2>
> [junit] at
> org.apache.cassandra.io.sstable.SSTableRewriterTest.assertFileCounts(SSTableRewriterTest.java:758)
> [junit] at
> org.apache.cassandra.io.sstable.SSTableRewriterTest.testFileRemoval(SSTableRewriterTest.java:229)
> {noformat}
> The rest cascade after that.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)