You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ma...@apache.org on 2021/03/18 08:46:16 UTC

[cassandra] branch trunk updated (28e8632 -> 1ca27e4)

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

marcuse pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git.


    from 28e8632  Mark StreamingMetrics.ActiveOutboundStreams as deprecated
     new 32394e9  Ignore trailing zeros in hint files
     new 8257868  Merge branch 'cassandra-3.0' into cassandra-3.11
     new 1ca27e4  Merge branch 'cassandra-3.11' into trunk

The 3 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/hints/HintsReader.java    |  26 +++++
 .../apache/cassandra/hints/HintsReaderTest.java    | 114 ++++++++++++++++++---
 3 files changed, 124 insertions(+), 17 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.11' into trunk

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

marcuse pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git

commit 1ca27e456d9b4bd51bc7808c162ddba4366b1cfc
Merge: 28e8632 8257868
Author: Marcus Eriksson <ma...@apache.org>
AuthorDate: Thu Mar 18 09:41:29 2021 +0100

    Merge branch 'cassandra-3.11' into trunk

 CHANGES.txt                                        |   1 +
 .../org/apache/cassandra/hints/HintsReader.java    |  26 +++++
 .../apache/cassandra/hints/HintsReaderTest.java    | 114 ++++++++++++++++++---
 3 files changed, 124 insertions(+), 17 deletions(-)

diff --cc CHANGES.txt
index ada218a,daa7329..e6f15ff
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,45 -1,7 +1,46 @@@
 -3.11.11
 +4.0-beta5
 + * Mark StreamingMetrics.ActiveOutboundStreams as deprecated (CASSANDRA-11174)
 + * Increase the cqlsh version number (CASSANDRA-16509)
 + * Fix the CQL generated for the views.where_clause column when some identifiers require quoting (CASSANDRA-16479)
 + * Send FAILED_SESSION_MSG on shutdown and on in-progress repairs during startup (CASSANDRA-16425)
 + * Reinstate removed ApplicationState padding (CASSANDRA-16484)
 + * Expose data dirs to ColumnFamilyStoreMBean (CASSANDRA-16335)
 + * Add possibility to copy SSTables in SSTableImporter instead of moving them (CASSANDRA-16407)
 + * Fix DESCRIBE statement for CUSTOM indices with options (CASSANDRA-16482)
 + * Fix cassandra-stress JMX connection (CASSANDRA-16473)
 + * Avoid processing redundant application states on endpoint changes (CASSANDRA-16381)
 + * Prevent parent repair sessions leak (CASSANDRA-16446)
 + * Fix timestamp issue in SinglePartitionSliceCommandTest testPartitionD…eletionRowDeletionTie (CASSANDRA-16443)
 + * Promote protocol V5 out of beta (CASSANDRA-14973)
 + * Fix incorrect encoding for strings can be UTF8 (CASSANDRA-16429)
 + * Fix node unable to join when RF > N in multi-DC with added warning (CASSANDRA-16296)
 + * Add an option to nodetool tablestats to check sstable location correctness (CASSANDRA-16344) 
 + * Unable to ALTER KEYSPACE while decommissioned/assassinated nodes are in gossip (CASSANDRA-16422)
 + * Metrics backward compatibility restored after CASSANDRA-15066 (CASSANDRA-16083)
 + * Reduce new reserved keywords introduced since 3.0 (CASSANDRA-16439)
 + * Improve system tables handling in case of disk failures (CASSANDRA-14793)
 + * Add access and datacenters to unreserved keywords (CASSANDRA-16398)
 + * Fix nodetool ring, status output when DNS resolution or port printing are in use (CASSANDRA-16283)
 + * Upgrade Jacoco to 0.8.6 (for Java 11 support) (CASSANDRA-16365)
 + * Move excessive repair debug loggings to trace level (CASSANDRA-16406)
 + * Restore validation of each message's protocol version (CASSANDRA-16374)
 + * Upgrade netty and chronicle-queue dependencies to get Auditing and native library loading working on arm64 architectures (CASSANDRA-16384,CASSANDRA-16392)
 + * Release StreamingTombstoneHistogramBuilder spool when switching writers (CASSANDRA-14834)
 + * Correct memtable on-heap size calculations to match actual use (CASSANDRA-16318)
 + * Fix client notifications in CQL protocol v5 (CASSANDRA-16353)
 + * Too defensive check when picking sstables for preview repair (CASSANDRA-16284)
 + * Ensure pre-negotiation native protocol responses have correct stream id (CASSANDRA-16376)
 + * Fix check for -Xlog in cassandra-env.sh (CASSANDRA-16279)
 + * SSLFactory should initialize SSLContext before setting protocols (CASSANDRA-16362)
 + * Restore sasi dependencies jflex, snowball-stemmer, and concurrent-trees, in the cassandra-all pom (CASSANDRA-16303)
 + * Fix DecimalDeserializer#toString OOM (CASSANDRA-14925)
 +Merged from 3.11:
   * Upgrade jackson-databind to 2.9.10.8 (CASSANDRA-16462)
 + * Fix digest computation for queries with fetched but non queried columns (CASSANDRA-15962)
 + * Reduce amount of allocations during batch statement execution (CASSANDRA-16201)
 + * Update jflex-1.6.0.jar to match upstream (CASSANDRA-16393)
  Merged from 3.0:
+  * Ignore trailing zeros in hint files (CASSANDRA-16523)
   * Refuse DROP COMPACT STORAGE if some 2.x sstables are in use (CASSANDRA-15897)
   * Fix ColumnFilter::toString not returning a valid CQL fragment (CASSANDRA-16483)
   * Fix ColumnFilter behaviour to prevent digest mitmatches during upgrades (CASSANDRA-16415)
diff --cc test/unit/org/apache/cassandra/hints/HintsReaderTest.java
index 871b796,84b5981..f05d4ce
--- a/test/unit/org/apache/cassandra/hints/HintsReaderTest.java
+++ b/test/unit/org/apache/cassandra/hints/HintsReaderTest.java
@@@ -31,16 -33,17 +33,19 @@@ import org.junit.BeforeClass
  import org.junit.Test;
  
  import org.apache.cassandra.SchemaLoader;
 -import org.apache.cassandra.config.CFMetaData;
 -import org.apache.cassandra.config.Schema;
  import org.apache.cassandra.db.Mutation;
  import org.apache.cassandra.db.RowUpdateBuilder;
 -import org.apache.cassandra.db.UnknownColumnFamilyException;
 +import org.apache.cassandra.db.marshal.ValueAccessors;
  import org.apache.cassandra.db.rows.Cell;
  import org.apache.cassandra.db.rows.Row;
++import org.apache.cassandra.exceptions.UnknownTableException;
+ import org.apache.cassandra.io.FSReadError;
+ import org.apache.cassandra.io.util.DataInputBuffer;
  import org.apache.cassandra.io.util.FileUtils;
  import org.apache.cassandra.schema.KeyspaceParams;
 +import org.apache.cassandra.schema.MigrationManager;
 +import org.apache.cassandra.schema.Schema;
 +import org.apache.cassandra.schema.TableMetadata;
  
  import static junit.framework.Assert.assertEquals;
  import static junit.framework.Assert.assertNotNull;
@@@ -107,27 -115,96 +117,97 @@@ public class HintsReaderTes
                  {
                      int i = index / numTable;
                      Hint hint = hints.next();
+                     if (hint != null)
+                     {
+                         verifyHint(hint, baseTimestamp, i);
+                         index++;
+                     }
+                 }
+             }
+         }
+         assertEquals(index, num);
+     }
  
-                     long timestamp = baseTimestamp + i;
-                     Mutation mutation = hint.mutation;
+     private void verifyHint(Hint hint, long baseTimestamp, int i)
+     {
+         long timestamp = baseTimestamp + i;
+         Mutation mutation = hint.mutation;
+ 
+         assertEquals(timestamp, hint.creationTime);
+         assertEquals(dk(bytes(i)), mutation.key());
+ 
+         Row row = mutation.getPartitionUpdates().iterator().next().iterator().next();
+         assertEquals(1, Iterables.size(row.cells()));
 -        assertEquals(bytes(i), row.clustering().get(0));
 -        Cell cell = row.cells().iterator().next();
++        ValueAccessors.assertDataEquals(bytes(i), row.clustering().get(0));
++        Cell<?> cell = row.cells().iterator().next();
+         assertNotNull(cell);
 -        assertEquals(bytes(i), cell.value());
++        ValueAccessors.assertDataEquals(bytes(i), cell.buffer());
+         assertEquals(timestamp * 1000, cell.timestamp());
+     }
  
-                     assertEquals(timestamp, hint.creationTime);
-                     assertEquals(dk(bytes(i)), mutation.key());
 +
-                     Row row = mutation.getPartitionUpdates().iterator().next().iterator().next();
-                     assertEquals(1, Iterables.size(row.cells()));
-                     ValueAccessors.assertDataEquals(bytes(i), row.clustering().get(0));
-                     Cell<?> cell = row.cells().iterator().next();
-                     assertNotNull(cell);
-                     ValueAccessors.assertDataEquals(bytes(i), cell.buffer());
-                     assertEquals(timestamp * 1000, cell.timestamp());
+     private Iterator<Hint> deserializePageBuffers(HintsReader.Page page)
+     {
+         final Iterator<ByteBuffer> buffers = page.buffersIterator();
+         return new Iterator<Hint>()
+         {
+             public boolean hasNext()
+             {
+                 return buffers.hasNext();
+             }
  
-                     index++;
+             public Hint next()
+             {
+                 try
+                 {
+                     return Hint.serializer.deserialize(new DataInputBuffer(buffers.next(), false),
+                                                        descriptor.messagingVersion());
+                 }
 -                catch (UnknownColumnFamilyException e)
++                catch (UnknownTableException e)
+                 {
 -                    return null;  // ignore
++                    return null; // ignore
+                 }
+                 catch (IOException e)
+                 {
+                     throw new RuntimeException("Unexpected error deserializing hint", e);
                  }
 -            };
 +            }
-         }
+         };
+     }
  
-         assertEquals(index, num);
+     @Test
+     public void corruptFile() throws IOException
+     {
+         corruptFileHelper(new byte[100], "corruptFile");
+     }
+ 
+     @Test(expected = FSReadError.class)
+     public void corruptFileNotAllZeros() throws IOException
+     {
+         byte [] bs = new byte[100];
+         bs[50] = 1;
+         corruptFileHelper(bs, "corruptFileNotAllZeros");
+     }
+ 
+     private void corruptFileHelper(byte[] toAppend, String ks) throws IOException
+     {
+         SchemaLoader.createKeyspace(ks,
+                                     KeyspaceParams.simple(1),
+                                     SchemaLoader.standardCFMD(ks, CF_STANDARD1),
+                                     SchemaLoader.standardCFMD(ks, CF_STANDARD2));
+         int numTable = 2;
+         directory = Files.createTempDirectory(null).toFile();
+         try
+         {
+             generateHints(3, ks);
+             File hintFile = new File(directory, descriptor.fileName());
+             Files.write(hintFile.toPath(), toAppend, StandardOpenOption.APPEND);
+             readHints(3 * numTable, numTable);
+         }
+         finally
+         {
+             directory.delete();
+         }
      }
  
      @Test


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