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 4d0daf091812a37c7846efe2a1b8031592bd0207
Merge: 2355c37 228e33d
Author: Marcus Eriksson <[email protected]>
AuthorDate: Fri Jan 15 09:28:01 2021 +0100

    Merge branch 'cassandra-3.11' into trunk

 CHANGES.txt                                        |  1 +
 .../apache/cassandra/hints/HintsDescriptor.java    | 28 +++++++++++++++++-
 .../cassandra/hints/HintsDescriptorTest.java       | 34 ++++++++++++++++++----
 3 files changed, 56 insertions(+), 7 deletions(-)

diff --cc CHANGES.txt
index a925e06,c732513..fbb1bd1
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,46 -1,11 +1,47 @@@
 -3.11.10
 +4.0-beta5
 + * 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)
 - * Rate limit validation compactions using compaction_throughput_mb_per_sec 
(CASSANDRA-16161)
 - * SASI's `max_compaction_flush_memory_in_mb` settings over 100GB revert to 
default of 1GB (CASSANDRA-16071)
 +Merged from 3.11:
  Merged from 3.0:
+  * Improve empty hint file handling during startup (CASSANDRA-16162)
 - * Allow empty string in collections with COPY FROM in cqlsh (CASSANDRA-16372)
   * Fix skipping on pre-3.0 created compact storage sstables due to missing 
primary key liveness (CASSANDRA-16226)
 + * Allow empty string in collections with COPY FROM in cqlsh (CASSANDRA-16372
 +
 +4.0-beta4
 + * DROP COMPACT STORAGE should invalidate prepared statements still using 
CompactTableMetadata (CASSANDRA-16361)
 + * Update default num_tokens to 16 and 
allocate_tokens_for_local_replication_factor to 3 (CASSANDRA-13701)
 + * Remove use of String.intern() (CASSANDRA-15810)
 + * Fix the missing bb position in ByteBufferAccessor.getUnsignedShort 
(CASSANDRA-16249)
 + * Make sure OOM errors are rethrown on truncation failure (CASSANDRA-16254)
 + * Send back client warnings when creating too many tables/keyspaces 
(CASSANDRA-16309)
 + * Add dedicated tcp user timeout for streaming connection (CASSANDRA-16143)
 + * Add generatetokens script for offline token allocation strategy generation 
(CASSANDRA-16205)
 + * Remove Windows scripts (CASSANDRA-16171)
 + * Improve checksumming and compression in protocol V5 (CASSANDRA-15299)
 + * Optimised repair streaming improvements (CASSANDRA-16274)
 + * Update jctools dependency to 3.1.0 (CASSANDRA-16255)
 + * 'SSLEngine closed already' exception on failed outbound connection 
(CASSANDRA-16277)
 + * Drain and/or shutdown might throw because of slow messaging service 
shutdown (CASSANDRA-16276)
 + * Upgrade JNA to 5.6.0, dropping support for <=glibc-2.6 systems 
(CASSANDRA-16212)
 + * Add saved Host IDs to TokenMetadata at startup (CASSANDRA-16246)
 + * Ensure that CacheMetrics.requests is picked up by the metric reporter 
(CASSANDRA-16228)
 + * Add a ratelimiter to snapshot creation and deletion (CASSANDRA-13019)
 + * Produce consistent tombstone for reads to avoid digest mistmatch 
(CASSANDRA-15369)
 + * Fix SSTableloader issue when restoring a table named backups 
(CASSANDRA-16235)
 + * Invalid serialized size for responses caused by increasing message time by 
1ms which caused extra bytes in size calculation (CASSANDRA-16103)
 + * Throw BufferOverflowException from DataOutputBuffer for better visibility 
(CASSANDRA-16214)
 + * TLS connections to the storage port on a node without server encryption 
configured causes java.io.IOException accessing missing keystore 
(CASSANDRA-16144)
 + * Internode messaging catches OOMs and does not rethrow (CASSANDRA-15214)
 + * When a table attempts to clean up metrics, it was cleaning up all global 
table metrics (CASSANDRA-16095)
 + * Bring back the accepted encryption protocols list as configurable option 
(CASSANDRA-13325)
 + * DigestResolver.getData throws AssertionError since dataResponse is null 
(CASSANDRA-16097)
 + * Cannot replace_address /X because it doesn't exist in gossip 
(CASSANDRA-16213)
 + * cqlsh row_id resets on page boundaries (CASSANDRA-16160)
 +Merged from 3.11:
 + * SASI's `max_compaction_flush_memory_in_mb` settings over 100GB revert to 
default of 1GB (CASSANDRA-16071)
 +Merged from 3.0:
   * Extend the exclusion of replica filtering protection to other indices 
instead of just SASI (CASSANDRA-16311)
   * Synchronize transaction logs for JBOD (CASSANDRA-16225)
   * Fix the counting of cells per partition (CASSANDRA-16259)
diff --cc test/unit/org/apache/cassandra/hints/HintsDescriptorTest.java
index 2d9f972,bab2356..2fad733
--- a/test/unit/org/apache/cassandra/hints/HintsDescriptorTest.java
+++ b/test/unit/org/apache/cassandra/hints/HintsDescriptorTest.java
@@@ -24,7 -27,7 +27,6 @@@ import java.util.UUID
  
  import com.google.common.collect.ImmutableMap;
  import com.google.common.io.ByteStreams;
- import com.google.common.io.Files;
 -import org.junit.Assert;
  import org.junit.Test;
  
  import org.apache.cassandra.io.compress.LZ4Compressor;
@@@ -33,8 -35,9 +35,8 @@@ import org.apache.cassandra.net.Messagi
  
  import static junit.framework.Assert.assertEquals;
  import static junit.framework.Assert.assertNotSame;
- import static junit.framework.Assert.assertTrue;
  import static junit.framework.Assert.fail;
 -import static org.junit.Assert.assertFalse;
 -import static org.junit.Assert.assertTrue;
++import static org.assertj.core.api.Assertions.assertThat;
  
  public class HintsDescriptorTest
  {
@@@ -118,16 -121,25 +120,36 @@@
      }
  
      @Test
 +    public void testMessagingVersion()
 +    {
 +        String errorMsg = "Please update the current Hints messaging version 
to match the current messaging version";
 +        int messageVersion = 
HintsDescriptor.messagingVersion(HintsDescriptor.CURRENT_VERSION);
 +        assertEquals(errorMsg, messageVersion, 
MessagingService.current_version);
 +
 +        HintsDescriptor descriptor = new HintsDescriptor(UUID.randomUUID(), 
HintsDescriptor.CURRENT_VERSION, System.currentTimeMillis(), ImmutableMap.of());
 +        assertEquals(errorMsg, descriptor.messagingVersion(), 
MessagingService.current_version);
 +    }
 +
++    @Test
+     public void testHandleIOE() throws IOException
+     {
+         Path p = Files.createTempFile("testing", ".hints");
+         // empty file;
 -        assertTrue(p.toFile().exists());
 -        Assert.assertEquals(0, Files.size(p));
++        assertThat(p).exists();
++        assertThat(Files.size(p)).isEqualTo(0);
+         HintsDescriptor.handleDescriptorIOE(new IOException("test"), p);
 -        assertFalse(Files.exists(p));
++        assertThat(p).doesNotExist();
+ 
+         // non-empty
+         p = Files.createTempFile("testing", ".hints");
+         Files.write(p, Collections.singleton("hello"));
+         HintsDescriptor.handleDescriptorIOE(new IOException("test"), p);
+         File newFile = new File(p.getParent().toFile(), 
p.getFileName().toString().replace(".hints", ".corrupt.hints"));
 -        assertFalse(Files.exists(p));
 -        assertTrue(newFile.toString(), newFile.exists());
++        assertThat(p).doesNotExist();
++        assertThat(newFile).exists();
+         newFile.deleteOnExit();
+     }
+ 
      private static void testSerializeDeserializeLoop(HintsDescriptor 
descriptor) throws IOException
      {
          // serialize to a byte array


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to