cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject git commit: Dont try to set repairedAt on old sstables
Date Sat, 13 Sep 2014 15:28:16 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 f168fdad6 -> 25eb83091


Dont try to set repairedAt on old sstables

Patch by marcuse; reviewed by jbellis for CASSANDRA-7913


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/25eb8309
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/25eb8309
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/25eb8309

Branch: refs/heads/cassandra-2.1
Commit: 25eb83091e03bb3ca9393fdec220727ac3e340ab
Parents: f168fda
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Thu Sep 11 16:28:39 2014 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Sat Sep 13 17:27:32 2014 +0200

----------------------------------------------------------------------
 CHANGES.txt                                          |  1 +
 .../cassandra/tools/SSTableRepairedAtSetter.java     | 15 +++++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/25eb8309/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 7030570..fdf6fbe 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.1
+ * Don't try to set repairedAt on old sstables (CASSANDRA-7913)
  * Add metrics for tracking PreparedStatement use (CASSANDRA-7719)
  * (cqlsh) tab-completion for triggers (CASSANDRA-7824)
  * (cqlsh) Support for query paging (CASSANDRA-7514)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/25eb8309/src/java/org/apache/cassandra/tools/SSTableRepairedAtSetter.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/SSTableRepairedAtSetter.java b/src/java/org/apache/cassandra/tools/SSTableRepairedAtSetter.java
index 623e71b..4dec32c 100644
--- a/src/java/org/apache/cassandra/tools/SSTableRepairedAtSetter.java
+++ b/src/java/org/apache/cassandra/tools/SSTableRepairedAtSetter.java
@@ -78,14 +78,21 @@ public class SSTableRepairedAtSetter
 
         String fname = args[2];
         Descriptor descriptor = Descriptor.fromFilename(fname);
-        if (setIsRepaired)
+        if (descriptor.version.hasRepairedAt)
         {
-            FileTime f = Files.getLastModifiedTime(new File(descriptor.filenameFor(Component.DATA)).toPath());
-            descriptor.getMetadataSerializer().mutateRepairedAt(descriptor, f.toMillis());
+            if (setIsRepaired)
+            {
+                FileTime f = Files.getLastModifiedTime(new File(descriptor.filenameFor(Component.DATA)).toPath());
+                descriptor.getMetadataSerializer().mutateRepairedAt(descriptor, f.toMillis());
+            }
+            else
+            {
+                descriptor.getMetadataSerializer().mutateRepairedAt(descriptor, ActiveRepairService.UNREPAIRED_SSTABLE);
+            }
         }
         else
         {
-            descriptor.getMetadataSerializer().mutateRepairedAt(descriptor, ActiveRepairService.UNREPAIRED_SSTABLE);
+            out.println("SSTable "+fname+" does not have repaired property, run upgradesstables");
         }
 
     }


Mime
View raw message