incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Desimpel, Ignace" <>
Subject FW: Migration LCS from 1.2.X to 2.0.x exception
Date Wed, 25 Sep 2013 14:52:04 GMT
Did a test for File::rename on Ubuntu and windows.
Seems that on Ubuntu the File::renameTo(FROM, TO) is actually replacing the existing (same
as TO) file and content with the new (same as FROM) file and content.
So that would make it a problem only on Windows. Adding a File::delete before the rename in
case of Windows could do the (scary) trick.

From: Desimpel, Ignace []
Sent: woensdag 25 september 2013 13:13
Subject: FW: Migration LCS from 1.2.X to 2.0.x exception

Same is true if started from 1.2.9 version to 2.0.x
Seems like Cassandra-5383 is the related issue.

The code in the function mutateLevel  (from 1.2.5 to 1.2.9 and later ) is indirectly using
the java file::renameTo function. And that will not work on Windows if the file already exists.
Don't know about Linux, but even the java function description is already telling that the
behavior of the function can be machine dependent. So even on linux based systems, and even
if that functions returns with success, still does not confirm that actually the old file
name/content was removed and the new file name/content is used as replacement.

From: Marcus Eriksson []<mailto:[]>
Sent: woensdag 25 september 2013 10:02
Subject: Re: Migration LCS from 1.2.X to 2.0.x exception

this is the issue:

guess it fell between chairs, will poke around

On Tue, Sep 24, 2013 at 4:26 PM, Nate McCall <<>>
What version of 1.2.x?

Unfortunately, you must go through 1.2.9 first. See

On Tue, Sep 24, 2013 at 8:57 AM, Desimpel, Ignace <<>>
Tested on WINDOWS : On startup of the 2.0.0 version from 1.2.x files I get an error as listed

This is due to the code in LeveledManifest:: mutateLevel. The method already has a comment
saying that it is scary ...
On windows, one cannot use the File::rename if the target file name already exists.
Also, even on Linux, I'm not sure if a rename would actually 'overwrite/implicit-delete' the
content of the target file.

Anyway, adding code (below) before the FileUtils.renameWithConfirm should work in both cases
(maybe even rename the fromFile to be able to recover...)
File oTo = new File(filename);
                if ( oTo.exists() ) oTo.delete();

java.lang.RuntimeException: Failed to rename\Function-ic-10-Statistics.db-tmp to\Function-ic-10-Statistics.db
                at org.apache.cassandra.db.compaction.LeveledManifest.mutateLevel(
                at org.apache.cassandra.db.compaction.LegacyLeveledManifest.migrateManifests(
                at org.apache.cassandra.service.CassandraDaemon.setup(
                at org.apache.cassandra.service.CassandraDaemon.activate(


Ignace Desimpel

View raw message