You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jm...@apache.org on 2022/09/20 18:21:41 UTC

[cassandra] branch cassandra-4.0 updated: Mitigate direct buffer memory OOM on replacements

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

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


The following commit(s) were added to refs/heads/cassandra-4.0 by this push:
     new 22ec7eee7f Mitigate direct buffer memory OOM on replacements
22ec7eee7f is described below

commit 22ec7eee7f340e8333055b2b10646cfe00cb6a84
Author: Josh McKenzie <jm...@apache.org>
AuthorDate: Thu Sep 15 12:40:25 2022 -0400

    Mitigate direct buffer memory OOM on replacements
    
    Patch by Jon Meredith; reviewed by Josh McKenzie for CASSANDRA-17895
    
    Co-authored-by: Jon Meredith <jo...@apache.org>
    Co-authored-by: Josh McKenzie <jm...@apache.org>
---
 CHANGES.txt                                                         | 1 +
 .../cassandra/io/sstable/format/big/BigTableZeroCopyWriter.java     | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/CHANGES.txt b/CHANGES.txt
index 22bebd6e88..664791f43a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 4.0.7
+ * Mitigate direct buffer memory OOM on replacements (CASSANDRA-17895)
  * Fix repair failure on assertion if two peers have overlapping mismatching ranges (CASSANDRA-17900)
  * Better handle null state in Gossip schema migration to avoid NPE (CASSANDRA-17864)
  * HintedHandoffAddRemoveNodesTest now accounts for the fact that StorageMetrics.totalHints is not updated synchronously w/ writes (CASSANDRA-16679)
diff --git a/src/java/org/apache/cassandra/io/sstable/format/big/BigTableZeroCopyWriter.java b/src/java/org/apache/cassandra/io/sstable/format/big/BigTableZeroCopyWriter.java
index f05ea94cb7..2564e966d4 100644
--- a/src/java/org/apache/cassandra/io/sstable/format/big/BigTableZeroCopyWriter.java
+++ b/src/java/org/apache/cassandra/io/sstable/format/big/BigTableZeroCopyWriter.java
@@ -114,7 +114,7 @@ public class BigTableZeroCopyWriter extends SSTable implements SSTableMultiWrite
                 out.write(buff, 0, count);
                 bytesRead += count;
             }
-            out.sync();
+            out.sync(); // finish will also call sync(). Leaving here to get stuff flushed as early as possible
         }
         catch (IOException e)
         {
@@ -138,6 +138,10 @@ public class BigTableZeroCopyWriter extends SSTable implements SSTableMultiWrite
     public Collection<SSTableReader> finish(boolean openResult)
     {
         setOpenResult(openResult);
+
+        for (SequentialWriter writer : componentWriters.values())
+            writer.finish();
+
         return finished();
     }
 


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