Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7297A100C2 for ; Wed, 25 Sep 2013 11:20:53 +0000 (UTC) Received: (qmail 79725 invoked by uid 500); 25 Sep 2013 11:14:19 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 79603 invoked by uid 500); 25 Sep 2013 11:13:54 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 79511 invoked by uid 99); 25 Sep 2013 11:13:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Sep 2013 11:13:31 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Ignace.Desimpel@nuance.com designates 198.71.66.80 as permitted sender) Received: from [198.71.66.80] (HELO som-mx-a.nuance.com) (198.71.66.80) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Sep 2013 11:13:26 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AksGAJnEQlIKHBQY/2dsb2JhbABbgkN8UsBFgTRtB4IlAQEBBC0yKgIBCA0EBAEBCx0HIREUAwEDAQEFAwEBBBMIEodaAxuyEQ2JZgSMZoI6DSAKAYMdgQADlhIBiEKFa4hXgio Received: from unknown (HELO SOM-CAS01.nuance.com) ([10.28.20.24]) by som-mx-a.nuance.com with ESMTP/TLS/AES128-SHA; 25 Sep 2013 07:12:57 -0400 Received: from SOM-CAS03.nuance.com (10.28.20.26) by SOM-CAS01.nuance.com (10.28.20.24) with Microsoft SMTP Server (TLS) id 14.3.146.0; Wed, 25 Sep 2013 07:13:04 -0400 Received: from SOM-EXCH02.nuance.com ([fe80::4992:8492:7315:6160]) by SOM-CAS03.nuance.com ([::1]) with mapi id 14.03.0146.000; Wed, 25 Sep 2013 07:13:04 -0400 From: "Desimpel, Ignace" To: "user@cassandra.apache.org" Subject: FW: Migration LCS from 1.2.X to 2.0.x exception Thread-Topic: Migration LCS from 1.2.X to 2.0.x exception Thread-Index: Ac65LDjnI+38AJ0cSdG1hfTDhHFUngAJ04sAACTia4AAAkjeoA== Date: Wed, 25 Sep 2013 11:13:03 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.28.16.110] Content-Type: multipart/alternative; boundary="_000_FCD5C460700DCA4C8CEB1730307336020781AAD3SOMEXCH02nuance_" MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org --_000_FCD5C460700DCA4C8CEB1730307336020781AAD3SOMEXCH02nuance_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 i= ndirectly 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 j= ava function description is already telling that the behavior of the functi= on can be machine dependent. So even on linux based systems, and even if th= at 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 > wrote: What version of 1.2.x? Unfortunately, you must go through 1.2.9 first. See https://github.com/apac= he/cassandra/blob/cassandra-2.0.0/NEWS.txt#L19-L24 On Tue, Sep 24, 2013 at 8:57 AM, Desimpel, Ignace > 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 alread= y 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/imp= licit-delete' the content of the target file. Anyway, adding code (below) before the FileUtils.renameWithConfirm should w= ork in both cases (maybe even rename the fromFile to be able to recover...) File oTo =3D new File(filename); if ( oTo.exists() ) oTo.delete(); java.lang.RuntimeException: Failed to rename .....xxx\Function-ic-10-Statis= tics.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.mutat= eLevel(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(Cassa= ndraDaemon.java:247) ~[main/:na] at org.apache.cassandra.service.CassandraDaemon.activate(Ca= ssandraDaemon.java:443) ~[main/:na] Regards, Ignace Desimpel --_000_FCD5C460700DCA4C8CEB1730307336020781AAD3SOMEXCH02nuance_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Same is true if started f= rom 1.2.9 version to 2.0.x

Seems like Cassandra-5383= is the related issue.

 <= /p>

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. Do= n’t know about Linux, but even the java function description is alrea= dy telling that the behavior of the function can be machine dependent. So e= ven 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.

 <= /p>

 <= /p>

From: Marcus E= riksson [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<= /span>

 

this is the issue:

 

guess it fell between chairs, will poke around<= /o:p>

 

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

What version of 1.2.x? 

 

Unfortunately, you must go through 1.2.9 first. See&= nbsp;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 &l= t;Ignace.De= simpel@nuance.com> wrote:

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

 

This is due to the code in LeveledManifest:: mutateLevel. The meth= od already has a comment saying that it is scary …

On windows, one cannot use the File::rename if the target file nam= e 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 re= cover…)

File oTo =3D 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<= /o:p>

           =      at org.apache.cassandra.io.util.FileUtils.renameWi= thConfirm(FileUtils.java:136) ~[main/:na]

           =      at org.apache.cassandra.io.util.FileUtils.renameWi= thConfirm(FileUtils.java:125) ~[main/:na]

           =      at org.apache.cassandra.db.compaction.LeveledManif= est.mutateLevel(LeveledManifest.java:601) ~[main/:na]

           =      at org.apache.cassandra.db.compaction.LegacyLevele= dManifest.migrateManifests(LegacyLeveledManifest.java:103) ~[main/:na]=

           =      at org.apache.cassandra.service.CassandraDaemon.se= tup(CassandraDaemon.java:247) ~[main/:na]

           =      at org.apache.cassandra.service.CassandraDaemon.ac= tivate(CassandraDaemon.java:443) ~[main/:na]

 

Regards,

 

Ignace Desimpel

 

 

--_000_FCD5C460700DCA4C8CEB1730307336020781AAD3SOMEXCH02nuance_--