diff --git a/src/java/org/apache/cassandra/utils/memory/EnsureOnHeap.java b/src/java/org/apache/cassandra/utils/memory/EnsureOnHeap.java index d66c02c8e263..b37dfbcf37f7 100644 --- a/src/java/org/apache/cassandra/utils/memory/EnsureOnHeap.java +++ b/src/java/org/apache/cassandra/utils/memory/EnsureOnHeap.java @@ -57,8 +57,9 @@ public DecoratedKey applyToPartitionKey(DecoratedKey key) public Row applyToRow(Row row) { - if (row == null) - return null; + // If current "row" is Rows.EMPTY_STATIC_ROW, don't copy it again, as "copied_empty_static_row" != EMPTY_STATIC_ROW + if (row == null || row == Rows.EMPTY_STATIC_ROW) + return row; return row.clone(HeapCloner.instance); }