netudima commented on code in PR #4878:
URL: https://github.com/apache/cassandra/pull/4878#discussion_r3409666172


##########
src/java/org/apache/cassandra/db/rows/ColumnData.java:
##########
@@ -183,6 +183,19 @@ public ColumnData retain(ColumnData existing)
             return removeShadowed(existing, postReconcile);
         }
 
+        /**
+         * Like {@link #retain} but does NOT notify the {@link 
PostReconciliationFunction} of removed
+         * data. Use this when filtering shadowed cells out of the UPDATE 
(incoming) side of a merge:
+         * that data was never allocated to / owned by the memtable, so 
recording its removal would
+         * make the memtable allocator under-count what it owns and eventually 
report a negative
+         * release at flush (CASSANDRA-21390). Recording removals (via {@link 
#retain}) is only correct
+         * for the EXISTING side, whose data the memtable already owns.
+         */
+        public ColumnData retainWithoutRecordingRemoval(ColumnData existing)

Review Comment:
   removeShadowed has exactly the same logic and it is used for very similar 
case on cell level, so we can just reuse it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to