diff --git a/CHANGES.txt b/CHANGES.txt index 69ccf55c5b..29100fc8d9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -9,6 +9,7 @@ * 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) 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: * Improved check of num_tokens against the length of initial_token (CASSANDRA-14477) * Fix a race condition on ColumnFamilyStore and TableMetrics (CASSANDRA-16228) diff --git a/NEWS.txt b/NEWS.txt index 99c8af473f..498fbbbe7d 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -280,6 +280,18 @@ Materialized Views to be NOT NULL, and no base primary key columns get automatically included in view definition. You have to specify them explicitly now. +3.11.10 +====== + +Upgrading +--------- + - SASI's `max_compaction_flush_memory_in_mb` setting was previously getting interpreted in bytes. From 3.11.8 + it is correctly interpreted in megabytes, but prior to 3.11.10 previous configurations of this setting will + lead to nodes OOM during compaction. From 3.11.10 previous configurations will be detected as incorrect, + logged, and the setting reverted to the default value of 1GB. It is up to the user to correct the setting + after an upgrade, via dropping and recreating the index. See CASSANDRA-16071 for details. + + 3.11.6 ====== diff --git a/src/java/org/apache/cassandra/index/sasi/conf/IndexMode.java b/src/java/org/apache/cassandra/index/sasi/conf/IndexMode.java index 93c0101238..93ccc66c25 100644 --- a/src/java/org/apache/cassandra/index/sasi/conf/IndexMode.java +++ b/src/java/org/apache/cassandra/index/sasi/conf/IndexMode.java @@ -56,6 +56,7 @@ public class IndexMode private static final String INDEX_IS_LITERAL_OPTION = "is_literal"; private static final String INDEX_MAX_FLUSH_MEMORY_OPTION = "max_compaction_flush_memory_in_mb"; private static final double INDEX_MAX_FLUSH_DEFAULT_MULTIPLIER = 0.15; + private static final long DEFAULT_MAX_MEM_BYTES = (long) (1073741824 * INDEX_MAX_FLUSH_DEFAULT_MULTIPLIER); // 1G default for memtable public final Mode mode; public final boolean isAnalyzed, isLiteral; @@ -187,9 +188,14 @@ public class IndexMode } long maxMemBytes = indexOptions.get(INDEX_MAX_FLUSH_MEMORY_OPTION) == null - ? (long) (1073741824 * INDEX_MAX_FLUSH_DEFAULT_MULTIPLIER) // 1G default for memtable + ? DEFAULT_MAX_MEM_BYTES : 1048576L * Long.parseLong(indexOptions.get(INDEX_MAX_FLUSH_MEMORY_OPTION)); + if (maxMemBytes > 100L * 1073741824) + { + logger.error("{} configured as {} is above 100GB, reverting to default 1GB", INDEX_MAX_FLUSH_MEMORY_OPTION, maxMemBytes); + maxMemBytes = DEFAULT_MAX_MEM_BYTES; + } return new IndexMode(mode, isLiteral, isAnalyzed, analyzerClass, maxMemBytes); }