cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1156244 - in /cassandra/branches/cassandra-0.8: CHANGES.txt src/java/org/apache/cassandra/config/KSMetaData.java src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Date Wed, 10 Aug 2011 16:07:37 GMT
Author: jbellis
Date: Wed Aug 10 16:07:37 2011
New Revision: 1156244

URL: http://svn.apache.org/viewvc?rev=1156244&view=rev
Log:
ignore saved replication_factor strategy_option for NTS
patch by jbellis; reviewed by brandonwilliams for CASSANDRA-3011

Modified:
    cassandra/branches/cassandra-0.8/CHANGES.txt
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/KSMetaData.java
    cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/ColumnFamilyStore.java

Modified: cassandra/branches/cassandra-0.8/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/CHANGES.txt?rev=1156244&r1=1156243&r2=1156244&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.8/CHANGES.txt Wed Aug 10 16:07:37 2011
@@ -5,7 +5,9 @@
  * refuse counter write for CL.ANY (CASSANDRA-2990)
  * switch back to only logging recent dropped messages (CASSANDRA-3004)
  * fix issues with parameters being escaped incorrectly in Python CQL (CASSANDRA-2993)
- * force to always deseriale RowMutation for counters (CASSANDRA-3006)
+ * always deserialize RowMutation for counters (CASSANDRA-3006)
+ * ignore saved replication_factor strategy_option for NTS (CASSANDRA-3011)
+
 
 0.8.3
  * add ability to drop local reads/writes that are going to timeout

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/KSMetaData.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/KSMetaData.java?rev=1156244&r1=1156243&r2=1156244&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/KSMetaData.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/config/KSMetaData.java
Wed Aug 10 16:07:37 2011
@@ -144,7 +144,7 @@ public final class KSMetaData
 
     public static KSMetaData inflate(org.apache.cassandra.db.migration.avro.KsDef ks)
     {
-        Class<AbstractReplicationStrategy> repStratClass;
+        Class<? extends AbstractReplicationStrategy> repStratClass;
         try
         {
             String strategyClassName = convertOldStrategyName(ks.strategy_class.toString());
@@ -160,7 +160,16 @@ public final class KSMetaData
         {
             for (Map.Entry<CharSequence, CharSequence> e : ks.strategy_options.entrySet())
             {
-                strategyOptions.put(e.getKey().toString(), e.getValue().toString());
+                String name = e.getKey().toString();
+                // Silently discard a replication_factor option to NTS.
+                // The history is, people were creating CFs with the default settings (which
in the CLI is NTS) and then
+                // giving it a replication_factor option, which is nonsensical.  Initially
our strategy was to silently
+                // ignore this option, but that turned out to confuse people more.  So in
0.8.2 we switched to throwing
+                // an exception in the NTS constructor, which would be turned into an InvalidRequestException
for the
+                // client.  But, it also prevented startup for anyone upgrading without first
cleaning that option out.
+                if (repStratClass == NetworkTopologyStrategy.class && name.trim().toLowerCase().equals("replication_factor"))
+                    continue;
+                strategyOptions.put(name, e.getValue().toString());
             }
         }
         maybeAddReplicationFactor(strategyOptions, ks.strategy_class.toString(), ks.replication_factor);

Modified: cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=1156244&r1=1156243&r2=1156244&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
(original)
+++ cassandra/branches/cassandra-0.8/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Wed Aug 10 16:07:37 2011
@@ -1766,11 +1766,15 @@ public class ColumnFamilyStore implement
     public void invalidateRowCache()
     {
         rowCache.clear();
+        if (!rowCache.getCachePath().delete())
+            logger.error("RowCache " + columnFamily + " delete failed.");
     }
 
     public void invalidateKeyCache()
     {
         keyCache.clear();
+        if (!keyCache.getCachePath().delete())
+            logger.error("KeyCache " + columnFamily + " delete failed.");
     }
 
     public int getRowCacheCapacity()



Mime
View raw message