You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ad...@apache.org on 2020/07/10 17:30:40 UTC

[cassandra] branch cassandra-3.11 updated (e819f9b -> f3bee1a)

This is an automated email from the ASF dual-hosted git repository.

adelapena pushed a change to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


    from e819f9b  Merge branch 'cassandra-3.0' into cassandra-3.11
     new 976096a  Fix writing of snapshot manifest when the table has table-backed secondary indexes patch by Aleksandr Sorokoumov; reviewed by Andrés de la Peña for CASSANDRA-10968
     new 257fb03  Merge branch 'cassandra-2.1' into cassandra-2.2
     new 4f11cb9  Merge branch 'cassandra-2.2' into cassandra-3.0
     new f3bee1a  Merge branch 'cassandra-3.0' into cassandra-3.11

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGES.txt                                        |  1 +
 .../org/apache/cassandra/db/ColumnFamilyStore.java | 11 +++---
 src/java/org/apache/cassandra/db/Directories.java  | 23 ++++++++-----
 .../apache/cassandra/io/sstable/Descriptor.java    |  7 +++-
 .../apache/cassandra/db/ColumnFamilyStoreTest.java | 39 ++++++++++++++++++++++
 .../cassandra/io/sstable/DescriptorTest.java       |  8 +++++
 6 files changed, 74 insertions(+), 15 deletions(-)


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


[cassandra] 01/01: Merge branch 'cassandra-3.0' into cassandra-3.11

Posted by ad...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

adelapena pushed a commit to branch cassandra-3.11
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit f3bee1aecd3ee6b8a7cded866c0357031c861a05
Merge: e819f9b 4f11cb9
Author: adelapena <a....@gmail.com>
AuthorDate: Fri Jul 10 18:14:01 2020 +0100

    Merge branch 'cassandra-3.0' into cassandra-3.11
    
    # Conflicts:
    #	CHANGES.txt
    #	src/java/org/apache/cassandra/db/ColumnFamilyStore.java

 CHANGES.txt                                        |  1 +
 .../org/apache/cassandra/db/ColumnFamilyStore.java | 11 +++---
 src/java/org/apache/cassandra/db/Directories.java  | 23 ++++++++-----
 .../apache/cassandra/io/sstable/Descriptor.java    |  7 +++-
 .../apache/cassandra/db/ColumnFamilyStoreTest.java | 39 ++++++++++++++++++++++
 .../cassandra/io/sstable/DescriptorTest.java       |  8 +++++
 6 files changed, 74 insertions(+), 15 deletions(-)

diff --cc src/java/org/apache/cassandra/db/ColumnFamilyStore.java
index fa00e5b,70c14c0..99cac7c
--- a/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
@@@ -1812,12 -1655,13 +1812,13 @@@ public class ColumnFamilyStore implemen
                          logger.trace("Snapshot for {} keyspace data file {} created in {}", keyspace, ssTable.getFilename(), snapshotDirectory);
                      snapshottedSSTables.add(ssTable);
                  }
- 
-                 writeSnapshotManifest(filesJSONArr, snapshotName);
-                 if (!SchemaConstants.isLocalSystemKeyspace(metadata.ksName) && !SchemaConstants.isReplicatedSystemKeyspace(metadata.ksName))
-                     writeSnapshotSchema(snapshotName);
              }
          }
 -        writeSnapshotManifest(filesJSONArr, snapshotName);
+ 
 -        if (!Schema.isLocalSystemKeyspace(metadata.ksName) && !Schema.isReplicatedSystemKeyspace(metadata.ksName))
++        writeSnapshotManifest(filesJSONArr, snapshotName);
++        if (!SchemaConstants.isLocalSystemKeyspace(metadata.ksName) && !SchemaConstants.isReplicatedSystemKeyspace(metadata.ksName))
+             writeSnapshotSchema(snapshotName);
+ 
          if (ephemeral)
              createEphemeralSnapshotMarkerFile(snapshotName);
          return snapshottedSSTables;
diff --cc test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
index 8463a1f,f7152ff..a3564bb
--- a/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
+++ b/test/unit/org/apache/cassandra/db/ColumnFamilyStoreTest.java
@@@ -514,6 -518,40 +520,39 @@@ public class ColumnFamilyStoreTes
      }
  
      @Test
+     public void testSnapshotWithoutFlushWithSecondaryIndexes() throws Exception
+     {
+         Keyspace keyspace = Keyspace.open(KEYSPACE1);
+         ColumnFamilyStore cfs = keyspace.getColumnFamilyStore(CF_INDEX1);
+         cfs.truncateBlocking();
+ 
+         UpdateBuilder builder = UpdateBuilder.create(cfs.metadata, "key")
+                                              .newRow()
+                                              .add("birthdate", 1L)
+                                              .add("notbirthdate", 2L);
+         new Mutation(builder.build()).applyUnsafe();
+         cfs.forceBlockingFlush();
+ 
+         String snapshotName = "newSnapshot";
+         cfs.snapshotWithoutFlush(snapshotName);
+ 
+         File snapshotManifestFile = cfs.getDirectories().getSnapshotManifestFile(snapshotName);
+         JSONParser parser = new JSONParser();
+         JSONObject manifest = (JSONObject) parser.parse(new FileReader(snapshotManifestFile));
+         JSONArray files = (JSONArray) manifest.get("files");
+ 
+         // Keyspace1-Indexed1 and the corresponding index
+         assert files.size() == 2;
+ 
+         // Snapshot of the secondary index is stored in the subfolder with the same file name
+         String baseTableFile = (String) files.get(0);
+         String indexTableFile = (String) files.get(1);
+         assert !baseTableFile.equals(indexTableFile);
+         assert Directories.isSecondaryIndexFolder(new File(indexTableFile).getParentFile());
+         assert indexTableFile.endsWith(baseTableFile);
+     }
+ 
 -
+     @Test
      public void testScrubDataDirectories() throws Throwable
      {
          ColumnFamilyStore cfs = Keyspace.open(KEYSPACE1).getColumnFamilyStore(CF_STANDARD1);
diff --cc test/unit/org/apache/cassandra/io/sstable/DescriptorTest.java
index 64367dc,184d637..9c1dc84
--- a/test/unit/org/apache/cassandra/io/sstable/DescriptorTest.java
+++ b/test/unit/org/apache/cassandra/io/sstable/DescriptorTest.java
@@@ -23,8 -23,8 +23,10 @@@ import java.util.UUID
  
  import org.apache.commons.lang3.StringUtils;
  import org.junit.Assert;
++import org.junit.BeforeClass;
  import org.junit.Test;
  
++import org.apache.cassandra.config.DatabaseDescriptor;
  import org.apache.cassandra.db.Directories;
  import org.apache.cassandra.io.sstable.format.SSTableFormat;
  import org.apache.cassandra.utils.ByteBufferUtil;
@@@ -45,6 -45,6 +47,12 @@@ public class DescriptorTes
          tempDataDir = File.createTempFile("DescriptorTest", null).getParentFile();
      }
  
++    @BeforeClass
++    public static void setup()
++    {
++        DatabaseDescriptor.daemonInitialization();
++    }
++
      @Test
      public void testFromFilename() throws Exception
      {


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