You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by "Desimpel, Ignace" <Ig...@nuance.com> on 2013/09/24 15:57:41 UTC

Migration LCS from 1.2.X to 2.0.x exception

Tested on WINDOWS : On startup of the 2.0.0 version from 1.2.x files I get an error as listed below.

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 .....xxx\Function-ic-10-Statistics.db-tmp to .....xxx\Function-ic-10-Statistics.db
                at org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:136) ~[main/:na]
                at org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:125) ~[main/:na]
                at org.apache.cassandra.db.compaction.LeveledManifest.mutateLevel(LeveledManifest.java:601) ~[main/:na]
                at org.apache.cassandra.db.compaction.LegacyLeveledManifest.migrateManifests(LegacyLeveledManifest.java:103) ~[main/:na]
                at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:247) ~[main/:na]
                at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:443) ~[main/:na]

Regards,

Ignace Desimpel

FW: Migration LCS from 1.2.X to 2.0.x exception

Posted by "Desimpel, Ignace" <Ig...@nuance.com>.
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 [mailto:Ignace.Desimpel@nuance.com]
Sent: woensdag 25 september 2013 13:13
To: user@cassandra.apache.org
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:krummas@gmail.com]<mailto:[mailto:krummas@gmail.com]>
Sent: woensdag 25 september 2013 10:02
To: user@cassandra.apache.org<ma...@cassandra.apache.org>
Subject: Re: Migration LCS from 1.2.X to 2.0.x exception

this is the issue:
https://issues.apache.org/jira/browse/CASSANDRA-5383

guess it fell between chairs, will poke around

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

Unfortunately, you must go through 1.2.9 first. See https://github.com/apache/cassandra/blob/cassandra-2.0.0/NEWS.txt#L19-L24

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

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 .....xxx\Function-ic-10-Statistics.db-tmp to .....xxx\Function-ic-10-Statistics.db
                at org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:136) ~[main/:na]
                at org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:125) ~[main/:na]
                at org.apache.cassandra.db.compaction.LeveledManifest.mutateLevel(LeveledManifest.java:601) ~[main/:na]
                at org.apache.cassandra.db.compaction.LegacyLeveledManifest.migrateManifests(LegacyLeveledManifest.java:103) ~[main/:na]
                at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:247) ~[main/:na]
                at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:443) ~[main/:na]

Regards,

Ignace Desimpel



FW: Migration LCS from 1.2.X to 2.0.x exception

Posted by "Desimpel, Ignace" <Ig...@nuance.com>.
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:krummas@gmail.com]
Sent: woensdag 25 september 2013 10:02
To: user@cassandra.apache.org
Subject: Re: Migration LCS from 1.2.X to 2.0.x exception

this is the issue:
https://issues.apache.org/jira/browse/CASSANDRA-5383

guess it fell between chairs, will poke around

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

Unfortunately, you must go through 1.2.9 first. See https://github.com/apache/cassandra/blob/cassandra-2.0.0/NEWS.txt#L19-L24

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

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 .....xxx\Function-ic-10-Statistics.db-tmp to .....xxx\Function-ic-10-Statistics.db
                at org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:136) ~[main/:na]
                at org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:125) ~[main/:na]
                at org.apache.cassandra.db.compaction.LeveledManifest.mutateLevel(LeveledManifest.java:601) ~[main/:na]
                at org.apache.cassandra.db.compaction.LegacyLeveledManifest.migrateManifests(LegacyLeveledManifest.java:103) ~[main/:na]
                at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:247) ~[main/:na]
                at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:443) ~[main/:na]

Regards,

Ignace Desimpel



Re: Migration LCS from 1.2.X to 2.0.x exception

Posted by Marcus Eriksson <kr...@gmail.com>.
this is the issue:
https://issues.apache.org/jira/browse/CASSANDRA-5383

guess it fell between chairs, will poke around


On Tue, Sep 24, 2013 at 4:26 PM, Nate McCall <na...@thelastpickle.com> wrote:

> What version of 1.2.x?
>
> Unfortunately, you must go through 1.2.9 first. See
> https://github.com/apache/cassandra/blob/cassandra-2.0.0/NEWS.txt#L19-L24
>
>
> On Tue, Sep 24, 2013 at 8:57 AM, Desimpel, Ignace <
> Ignace.Desimpel@nuance.com> wrote:
>
>>  Tested on WINDOWS : On startup of the 2.0.0 version from 1.2.x files I
>> get an error as listed below.****
>>
>> ** **
>>
>> 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
>> …..xxx\Function-ic-10-Statistics.db-tmp to
>> …..xxx\Function-ic-10-Statistics.db****
>>
>>                 at
>> org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:136)
>> ~[main/:na]****
>>
>>                 at
>> org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:125)
>> ~[main/:na]****
>>
>>                 at
>> org.apache.cassandra.db.compaction.LeveledManifest.mutateLevel(LeveledManifest.java:601)
>> ~[main/:na]****
>>
>>                 at
>> org.apache.cassandra.db.compaction.LegacyLeveledManifest.migrateManifests(LegacyLeveledManifest.java:103)
>> ~[main/:na]****
>>
>>                 at
>> org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:247)
>> ~[main/:na]****
>>
>>                 at
>> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:443)
>> ~[main/:na]****
>>
>> ** **
>>
>> Regards,****
>>
>> ** **
>>
>> Ignace Desimpel****
>>
>
>

Re: Migration LCS from 1.2.X to 2.0.x exception

Posted by Nate McCall <na...@thelastpickle.com>.
What version of 1.2.x?

Unfortunately, you must go through 1.2.9 first. See
https://github.com/apache/cassandra/blob/cassandra-2.0.0/NEWS.txt#L19-L24


On Tue, Sep 24, 2013 at 8:57 AM, Desimpel, Ignace <
Ignace.Desimpel@nuance.com> wrote:

>  Tested on WINDOWS : On startup of the 2.0.0 version from 1.2.x files I
> get an error as listed below.****
>
> ** **
>
> 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
> …..xxx\Function-ic-10-Statistics.db-tmp to
> …..xxx\Function-ic-10-Statistics.db****
>
>                 at
> org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:136)
> ~[main/:na]****
>
>                 at
> org.apache.cassandra.io.util.FileUtils.renameWithConfirm(FileUtils.java:125)
> ~[main/:na]****
>
>                 at
> org.apache.cassandra.db.compaction.LeveledManifest.mutateLevel(LeveledManifest.java:601)
> ~[main/:na]****
>
>                 at
> org.apache.cassandra.db.compaction.LegacyLeveledManifest.migrateManifests(LegacyLeveledManifest.java:103)
> ~[main/:na]****
>
>                 at
> org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:247)
> ~[main/:na]****
>
>                 at
> org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:443)
> ~[main/:na]****
>
> ** **
>
> Regards,****
>
> ** **
>
> Ignace Desimpel****
>