cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject cassandra git commit: Checksum sstable metadata
Date Fri, 06 Oct 2017 13:28:18 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk c9c792d54 -> cfee3e93b


Checksum sstable metadata

Patch by marcuse; reviewed by Jason Brown for CASSANDRA-13321


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

Branch: refs/heads/trunk
Commit: cfee3e93bec7e527391da93f5b810b0ef4fb0fc8
Parents: c9c792d
Author: Marcus Eriksson <marcuse@apache.org>
Authored: Wed Apr 5 09:20:03 2017 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Fri Oct 6 15:25:28 2017 +0200

----------------------------------------------------------------------
 CHANGES.txt                                     |   1 +
 .../cassandra/io/sstable/format/Version.java    |   2 +
 .../io/sstable/format/big/BigFormat.java        |   9 ++-
 .../io/sstable/metadata/MetadataSerializer.java |  66 +++++++++++++++++--
 .../legacy_na_clust/na-1-big-CompressionInfo.db | Bin 87 -> 87 bytes
 .../legacy_na_clust/na-1-big-Data.db            | Bin 5359 -> 5256 bytes
 .../legacy_na_clust/na-1-big-Digest.crc32       |   2 +-
 .../legacy_na_clust/na-1-big-Index.db           | Bin 157553 -> 157553 bytes
 .../legacy_na_clust/na-1-big-Statistics.db      | Bin 7070 -> 7103 bytes
 .../legacy_na_clust/na-1-big-TOC.txt            |   8 +--
 .../na-1-big-CompressionInfo.db                 | Bin 87 -> 87 bytes
 .../legacy_na_clust_compact/na-1-big-Data.db    | Bin 5426 -> 5286 bytes
 .../na-1-big-Digest.crc32                       |   2 +-
 .../legacy_na_clust_compact/na-1-big-Index.db   | Bin 157553 -> 157553 bytes
 .../na-1-big-Statistics.db                      | Bin 7070 -> 7103 bytes
 .../legacy_na_clust_compact/na-1-big-TOC.txt    |   8 +--
 .../na-1-big-CompressionInfo.db                 | Bin 79 -> 79 bytes
 .../legacy_na_clust_counter/na-1-big-Data.db    | Bin 6015 -> 5797 bytes
 .../na-1-big-Digest.crc32                       |   2 +-
 .../legacy_na_clust_counter/na-1-big-Index.db   | Bin 157553 -> 157553 bytes
 .../na-1-big-Statistics.db                      | Bin 7079 -> 7112 bytes
 .../legacy_na_clust_counter/na-1-big-TOC.txt    |   8 +--
 .../na-1-big-CompressionInfo.db                 | Bin 79 -> 79 bytes
 .../na-1-big-Data.db                            | Bin 6014 -> 5817 bytes
 .../na-1-big-Digest.crc32                       |   2 +-
 .../na-1-big-Index.db                           | Bin 157553 -> 157553 bytes
 .../na-1-big-Statistics.db                      | Bin 7079 -> 7112 bytes
 .../na-1-big-TOC.txt                            |   8 +--
 .../na-1-big-CompressionInfo.db                 | Bin 47 -> 47 bytes
 .../legacy_na_simple/na-1-big-Data.db           | Bin 92 -> 88 bytes
 .../legacy_na_simple/na-1-big-Digest.crc32      |   2 +-
 .../legacy_na_simple/na-1-big-Statistics.db     | Bin 4623 -> 4656 bytes
 .../legacy_na_simple/na-1-big-TOC.txt           |   8 +--
 .../na-1-big-CompressionInfo.db                 | Bin 47 -> 47 bytes
 .../legacy_na_simple_compact/na-1-big-Data.db   | Bin 95 -> 91 bytes
 .../na-1-big-Digest.crc32                       |   2 +-
 .../na-1-big-Statistics.db                      | Bin 4664 -> 4697 bytes
 .../legacy_na_simple_compact/na-1-big-TOC.txt   |   8 +--
 .../na-1-big-CompressionInfo.db                 | Bin 47 -> 47 bytes
 .../legacy_na_simple_counter/na-1-big-Data.db   | Bin 145 -> 139 bytes
 .../na-1-big-Digest.crc32                       |   2 +-
 .../na-1-big-Statistics.db                      | Bin 4632 -> 4665 bytes
 .../legacy_na_simple_counter/na-1-big-TOC.txt   |   8 +--
 .../na-1-big-CompressionInfo.db                 | Bin 47 -> 47 bytes
 .../na-1-big-Data.db                            | Bin 146 -> 142 bytes
 .../na-1-big-Digest.crc32                       |   2 +-
 .../na-1-big-Statistics.db                      | Bin 4673 -> 4706 bytes
 .../na-1-big-TOC.txt                            |   8 +--
 .../cassandra/io/sstable/LegacySSTableTest.java |  23 +++++++
 49 files changed, 134 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index e006db3..90c6b9c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.0
+ * Checksum sstable metadata (CASSANDRA-13321)
  * Expose recent histograms in JmxHistograms (CASSANDRA-13642)
  * Fix buffer length comparison when decompressing in netty-based streaming (CASSANDRA-13899)
  * Properly close StreamCompressionInputStream to release any ByteBuf (CASSANDRA-13906)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/src/java/org/apache/cassandra/io/sstable/format/Version.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/format/Version.java b/src/java/org/apache/cassandra/io/sstable/format/Version.java
index a7d1abf..e8721a6 100644
--- a/src/java/org/apache/cassandra/io/sstable/format/Version.java
+++ b/src/java/org/apache/cassandra/io/sstable/format/Version.java
@@ -55,6 +55,8 @@ public abstract class Version
 
     public abstract boolean hasPendingRepair();
 
+    public abstract boolean hasMetadataChecksum();
+
     public String getVersion()
     {
         return version;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java b/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
index a58b201..5f6dd53 100644
--- a/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
+++ b/src/java/org/apache/cassandra/io/sstable/format/big/BigFormat.java
@@ -120,7 +120,7 @@ public class BigFormat implements SSTableFormat
         // mb (3.0.7, 3.7): commit log lower bound included
         // mc (3.0.8, 3.9): commit log intervals included
 
-        // na (4.0.0): uncompressed chunks, pending repair session
+        // na (4.0.0): uncompressed chunks, pending repair session, checksummed sstable metadata
file
         //
         // NOTE: when adding a new version, please add that to LegacySSTableTest, too.
 
@@ -130,6 +130,7 @@ public class BigFormat implements SSTableFormat
         private final boolean hasCommitLogIntervals;
         public final boolean hasMaxCompressedLength;
         private final boolean hasPendingRepair;
+        private final boolean hasMetadataChecksum;
 
         BigVersion(String version)
         {
@@ -142,6 +143,7 @@ public class BigFormat implements SSTableFormat
             hasCommitLogIntervals = version.compareTo("mc") >= 0;
             hasMaxCompressedLength = version.compareTo("na") >= 0;
             hasPendingRepair = version.compareTo("na") >= 0;
+            hasMetadataChecksum = version.compareTo("na") >= 0;
         }
 
         @Override
@@ -174,6 +176,11 @@ public class BigFormat implements SSTableFormat
         }
 
         @Override
+        public boolean hasMetadataChecksum()
+        {
+            return hasMetadataChecksum;
+        }
+
         public boolean isCompatible()
         {
             return version.compareTo(earliest_supported_version) >= 0 && version.charAt(0)
<= current_version.charAt(0);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java b/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java
index 2c1e0ec..f17157c 100644
--- a/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java
+++ b/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java
@@ -21,12 +21,18 @@ import java.io.*;
 import java.util.*;
 
 import com.google.common.collect.Lists;
+import com.google.common.hash.HashFunction;
+import com.google.common.hash.Hasher;
+import com.google.common.hash.Hashing;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.cassandra.io.sstable.Component;
+import org.apache.cassandra.io.sstable.CorruptSSTableException;
 import org.apache.cassandra.io.sstable.Descriptor;
 import org.apache.cassandra.io.sstable.format.Version;
+import org.apache.cassandra.io.util.DataInputBuffer;
+import org.apache.cassandra.io.util.DataOutputBuffer;
 import org.apache.cassandra.io.util.DataOutputPlus;
 import org.apache.cassandra.io.util.DataOutputStreamPlus;
 import org.apache.cassandra.io.util.FileDataInput;
@@ -39,7 +45,7 @@ import org.apache.cassandra.utils.FBUtilities;
  * Metadata serializer for SSTables {@code version >= 'k'}.
  *
  * <pre>
- * File format := | number of components (4 bytes) | toc | component1 | component2 | ...
|
+ * File format := | number of components (4 bytes) | toc | component1 | c1 hash | component2
| c2 hash | ... |
  * toc         := | component type (4 bytes) | position of component |
  * </pre>
  *
@@ -48,9 +54,11 @@ import org.apache.cassandra.utils.FBUtilities;
 public class MetadataSerializer implements IMetadataSerializer
 {
     private static final Logger logger = LoggerFactory.getLogger(MetadataSerializer.class);
+    private static final HashFunction hashFunction = Hashing.md5();
 
     public void serialize(Map<MetadataType, MetadataComponent> components, DataOutputPlus
out, Version version) throws IOException
     {
+        boolean checksum = version.hasMetadataChecksum();
         // sort components by type
         List<MetadataComponent> sortedComponents = Lists.newArrayList(components.values());
         Collections.sort(sortedComponents);
@@ -59,6 +67,7 @@ public class MetadataSerializer implements IMetadataSerializer
         out.writeInt(components.size());
         // build and write toc
         int lastPosition = 4 + (8 * sortedComponents.size());
+        Map<MetadataType, Integer> sizes = new EnumMap<>(MetadataType.class);
         for (MetadataComponent component : sortedComponents)
         {
             MetadataType type = component.getType();
@@ -66,12 +75,22 @@ public class MetadataSerializer implements IMetadataSerializer
             out.writeInt(type.ordinal());
             // serialize position
             out.writeInt(lastPosition);
-            lastPosition += type.serializer.serializedSize(version, component);
+            int size = type.serializer.serializedSize(version, component);
+            lastPosition += size + (checksum ? 8 : 0); // checksum is long
+            sizes.put(type, size);
         }
         // serialize components
         for (MetadataComponent component : sortedComponents)
         {
-            component.getType().serializer.serialize(version, component, out);
+            byte[] bytes;
+            try (DataOutputBuffer dob = new DataOutputBuffer(sizes.get(component.getType())))
+            {
+                component.getType().serializer.serialize(version, component, dob);
+                bytes = dob.getData();
+            }
+            out.write(bytes);
+            if (checksum)
+                out.writeLong(hashFunction.hashBytes(bytes).asLong());
         }
     }
 
@@ -103,24 +122,59 @@ public class MetadataSerializer implements IMetadataSerializer
 
     public Map<MetadataType, MetadataComponent> deserialize(Descriptor descriptor,
FileDataInput in, EnumSet<MetadataType> types) throws IOException
     {
+        int totalSize = (int) in.bytesRemaining();
         Map<MetadataType, MetadataComponent> components = new EnumMap<>(MetadataType.class);
         // read number of components
         int numComponents = in.readInt();
         // read toc
         Map<MetadataType, Integer> toc = new EnumMap<>(MetadataType.class);
         MetadataType[] values = MetadataType.values();
+        Map<MetadataType, Integer> lengths = new EnumMap<>(MetadataType.class);
+        int start = 0;
+        MetadataType lastType = null;
         for (int i = 0; i < numComponents; i++)
         {
-            toc.put(values[in.readInt()], in.readInt());
+            int metadataTypeId = in.readInt();
+            int position = in.readInt();
+
+            toc.put(values[metadataTypeId], position);
+            if (lastType != null)
+                lengths.put(lastType, position - start);
+            start = position;
+            lastType = values[metadataTypeId];
         }
+        lengths.put(lastType, totalSize - start);
         for (MetadataType type : types)
         {
             Integer offset = toc.get(type);
             if (offset != null)
             {
                 in.seek(offset);
-                MetadataComponent component = type.serializer.deserialize(descriptor.version,
in);
-                components.put(type, component);
+
+                if (descriptor.version.hasMetadataChecksum())
+                {
+                    int size = lengths.get(type) - 8; // 8 bytes checksum
+                    byte[] bytes = new byte[size];
+                    in.readFully(bytes);
+                    MetadataComponent component;
+                    try (DataInputBuffer dib = new DataInputBuffer(bytes))
+                    {
+                        component = type.serializer.deserialize(descriptor.version, dib);
+                    }
+                    long writtenChecksum = in.readLong();
+                    if (writtenChecksum != hashFunction.hashBytes(bytes).asLong())
+                    {
+                        String filename = descriptor.filenameFor(Component.STATS);
+                        throw new CorruptSSTableException(new IOException("Checksums do not
match for " + filename), filename);
+                    }
+                    components.put(type, component);
+                }
+                else
+                {
+                    MetadataComponent component = type.serializer.deserialize(descriptor.version,
in);
+                    components.put(type, component);
+                }
+
             }
         }
         return components;

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-CompressionInfo.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-CompressionInfo.db
index 6bf2986..c7fc204 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-CompressionInfo.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-CompressionInfo.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Data.db b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Data.db
index f92f905..36f9800 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Data.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Digest.crc32
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Digest.crc32
index 37f68ab..9adb8f5 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Digest.crc32
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Digest.crc32
@@ -1 +1 @@
-1337396261
\ No newline at end of file
+829376603
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Index.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Index.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Index.db
index b173dda..d3b366d 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Index.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Index.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Statistics.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Statistics.db
index 1fd8bac..f750d82 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Statistics.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-TOC.txt b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-TOC.txt
index ae620de..0251bd9 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-TOC.txt
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust/na-1-big-TOC.txt
@@ -1,8 +1,8 @@
-Summary.db
-Filter.db
 Index.db
-CompressionInfo.db
 Data.db
-TOC.txt
+CompressionInfo.db
 Statistics.db
+Summary.db
+TOC.txt
 Digest.crc32
+Filter.db

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-CompressionInfo.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-CompressionInfo.db
index 1e69fcd..1ef9177 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-CompressionInfo.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-CompressionInfo.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Data.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Data.db
index f4fb8f2..1d130d4 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Data.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Data.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Digest.crc32
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Digest.crc32
index ce2e2f8..a9900da 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Digest.crc32
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Digest.crc32
@@ -1 +1 @@
-2454456604
\ No newline at end of file
+818525950
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Index.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Index.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Index.db
index 3f46350..e04d3db 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Index.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Index.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Statistics.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Statistics.db
index b15e758..f2da58d 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Statistics.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-Statistics.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-TOC.txt
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-TOC.txt
index ae620de..0251bd9 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-TOC.txt
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_compact/na-1-big-TOC.txt
@@ -1,8 +1,8 @@
-Summary.db
-Filter.db
 Index.db
-CompressionInfo.db
 Data.db
-TOC.txt
+CompressionInfo.db
 Statistics.db
+Summary.db
+TOC.txt
 Digest.crc32
+Filter.db

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-CompressionInfo.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-CompressionInfo.db
index 7fd6a6c..449f507 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-CompressionInfo.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-CompressionInfo.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Data.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Data.db
index 5e9425e..55be94d 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Data.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Data.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Digest.crc32
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Digest.crc32
index 0a20edb..0608cac 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Digest.crc32
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Digest.crc32
@@ -1 +1 @@
-41575897
\ No newline at end of file
+1278737554
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Index.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Index.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Index.db
index 2474c3e..646d4d4 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Index.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Index.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Statistics.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Statistics.db
index 3df7cf3..5692214 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Statistics.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-Statistics.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-TOC.txt
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-TOC.txt
index ae620de..0251bd9 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-TOC.txt
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter/na-1-big-TOC.txt
@@ -1,8 +1,8 @@
-Summary.db
-Filter.db
 Index.db
-CompressionInfo.db
 Data.db
-TOC.txt
+CompressionInfo.db
 Statistics.db
+Summary.db
+TOC.txt
 Digest.crc32
+Filter.db

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-CompressionInfo.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-CompressionInfo.db
index fd7c663..405b9fb 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-CompressionInfo.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-CompressionInfo.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Data.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Data.db
index 79f5919..1f4e26a 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Data.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Data.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Digest.crc32
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Digest.crc32
index 7c2e59a..3ae0adf 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Digest.crc32
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Digest.crc32
@@ -1 +1 @@
-4050499673
\ No newline at end of file
+2193718788
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Index.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Index.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Index.db
index 6c9cb96..041117e 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Index.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Index.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Statistics.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Statistics.db
index 68b6657..e899252 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Statistics.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-Statistics.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-TOC.txt
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-TOC.txt
index ae620de..0251bd9 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-TOC.txt
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_clust_counter_compact/na-1-big-TOC.txt
@@ -1,8 +1,8 @@
-Summary.db
-Filter.db
 Index.db
-CompressionInfo.db
 Data.db
-TOC.txt
+CompressionInfo.db
 Statistics.db
+Summary.db
+TOC.txt
 Digest.crc32
+Filter.db

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-CompressionInfo.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-CompressionInfo.db
index 2640f95..fc38a25 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-CompressionInfo.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-CompressionInfo.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Data.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Data.db
index 089aa6c..cd52dab 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Data.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Data.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Digest.crc32
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Digest.crc32
index 151fc22..1275575 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Digest.crc32
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Digest.crc32
@@ -1 +1 @@
-243065670
\ No newline at end of file
+3074491452
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Statistics.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Statistics.db
index 404a3f8..4205870 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Statistics.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-Statistics.db differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-TOC.txt
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-TOC.txt
index ae620de..0251bd9 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-TOC.txt
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple/na-1-big-TOC.txt
@@ -1,8 +1,8 @@
-Summary.db
-Filter.db
 Index.db
-CompressionInfo.db
 Data.db
-TOC.txt
+CompressionInfo.db
 Statistics.db
+Summary.db
+TOC.txt
 Digest.crc32
+Filter.db

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-CompressionInfo.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-CompressionInfo.db
index 63039e6..1c738aa 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-CompressionInfo.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-CompressionInfo.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Data.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Data.db
index 5970d11..8adbf54 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Data.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Data.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Digest.crc32
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Digest.crc32
index e85ffd9..138bc9c 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Digest.crc32
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Digest.crc32
@@ -1 +1 @@
-576034138
\ No newline at end of file
+1825853914
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Statistics.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Statistics.db
index f63efec..7e25613 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Statistics.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-Statistics.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-TOC.txt
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-TOC.txt
index ae620de..0251bd9 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-TOC.txt
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_compact/na-1-big-TOC.txt
@@ -1,8 +1,8 @@
-Summary.db
-Filter.db
 Index.db
-CompressionInfo.db
 Data.db
-TOC.txt
+CompressionInfo.db
 Statistics.db
+Summary.db
+TOC.txt
 Digest.crc32
+Filter.db

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-CompressionInfo.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-CompressionInfo.db
index 6726d74..e2860e1 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-CompressionInfo.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-CompressionInfo.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Data.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Data.db
index 28234ab..f3e6359 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Data.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Data.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Digest.crc32
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Digest.crc32
index 955bc49..2ad4fa0 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Digest.crc32
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Digest.crc32
@@ -1 +1 @@
-381306786
\ No newline at end of file
+3361465012
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Statistics.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Statistics.db
index d65a3a4..04cacf9 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Statistics.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-Statistics.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-TOC.txt
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-TOC.txt
index ae620de..0251bd9 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-TOC.txt
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter/na-1-big-TOC.txt
@@ -1,8 +1,8 @@
-Summary.db
-Filter.db
 Index.db
-CompressionInfo.db
 Data.db
-TOC.txt
+CompressionInfo.db
 Statistics.db
+Summary.db
+TOC.txt
 Digest.crc32
+Filter.db

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-CompressionInfo.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-CompressionInfo.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-CompressionInfo.db
index edf78d5..1237cc7 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-CompressionInfo.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-CompressionInfo.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Data.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Data.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Data.db
index ce4965c..72772f0 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Data.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Data.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Digest.crc32
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Digest.crc32
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Digest.crc32
index 06f147f..b44a733 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Digest.crc32
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Digest.crc32
@@ -1 +1 @@
-2161889354
\ No newline at end of file
+2410392183
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Statistics.db
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Statistics.db
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Statistics.db
index 6b2d88b..c431a59 100644
Binary files a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Statistics.db
and b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-Statistics.db
differ

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-TOC.txt
----------------------------------------------------------------------
diff --git a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-TOC.txt
b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-TOC.txt
index ae620de..0251bd9 100644
--- a/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-TOC.txt
+++ b/test/data/legacy-sstables/na/legacy_tables/legacy_na_simple_counter_compact/na-1-big-TOC.txt
@@ -1,8 +1,8 @@
-Summary.db
-Filter.db
 Index.db
-CompressionInfo.db
 Data.db
-TOC.txt
+CompressionInfo.db
 Statistics.db
+Summary.db
+TOC.txt
 Digest.crc32
+Filter.db

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cfee3e93/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java b/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java
index 0f11aee..8cbf006 100644
--- a/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/LegacySSTableTest.java
@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Random;
+import java.util.UUID;
 
 import org.junit.After;
 import org.junit.Assert;
@@ -146,6 +147,28 @@ public class LegacySSTableTest
         doTestLegacyCqlTables();
     }
 
+    @Test
+    public void testMutateMetadata() throws Exception
+    {
+        // we need to make sure we write old version metadata in the format for that version
+        for (String legacyVersion : legacyVersions)
+        {
+            logger.info("Loading legacy version: {}", legacyVersion);
+            truncateLegacyTables(legacyVersion);
+            loadLegacyTables(legacyVersion);
+            CacheService.instance.invalidateKeyCache();
+
+            for (ColumnFamilyStore cfs : Keyspace.open("legacy_tables").getColumnFamilyStores())
+            {
+                for (SSTableReader sstable : cfs.getLiveSSTables())
+                {
+                    sstable.descriptor.getMetadataSerializer().mutateRepaired(sstable.descriptor,
1234, UUID.randomUUID());
+                    sstable.reloadSSTableMetadata();
+                }
+            }
+        }
+    }
+
     private void doTestLegacyCqlTables() throws Exception
     {
         for (String legacyVersion : legacyVersions)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message