You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2011/04/29 17:35:18 UTC
svn commit: r1097843 - in /cassandra/branches/cassandra-0.7: CHANGES.txt
src/java/org/apache/cassandra/db/migration/Migration.java
Author: jbellis
Date: Fri Apr 29 15:35:18 2011
New Revision: 1097843
URL: http://svn.apache.org/viewvc?rev=1097843&view=rev
Log:
refuse to apply migrations with older timestamps than the current schema
patch by Tyler Hobbs; reviewed by jbellis and gdusbabek for CASSANDRA-2536
Modified:
cassandra/branches/cassandra-0.7/CHANGES.txt
cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/Migration.java
Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1097843&r1=1097842&r2=1097843&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Fri Apr 29 15:35:18 2011
@@ -4,6 +4,8 @@
* fix incorrect use of NBHM.size in ReadCallback that could cause
reads to time out even when responses were received (CASSAMDRA-2552)
* trigger read repair correctly for LOCAL_QUORUM reads (CASSANDRA-2556)
+ * refuse to apply migrations with older timestamps than the current
+ schema (CASSANDRA-2536)
0.7.5
Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/Migration.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/Migration.java?rev=1097843&r1=1097842&r2=1097843&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/Migration.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/migration/Migration.java Fri Apr 29 15:35:18 2011
@@ -98,6 +98,8 @@ public abstract class Migration
// ensure migration is serial. don't apply unless the previous version matches.
if (!DatabaseDescriptor.getDefsVersion().equals(lastVersion))
throw new ConfigurationException("Previous version mismatch. cannot apply.");
+ if (newVersion.timestamp() <= lastVersion.timestamp())
+ throw new ConfigurationException("New version timestamp is not newer than the current version timestamp.");
// write to schema
assert rm != null;
if (!clientMode)