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


##########
src/java/org/apache/cassandra/db/ReadCommand.java:
##########
@@ -867,6 +868,130 @@ protected LongPredicate getPurgeEvaluator()
         return Transformation.apply(iterator, new 
WithoutPurgeableTombstones());
     }
 
+
+    /**
+     * Wraps the provided iterator so that metrics on count of purgeable 
tombstones are tracked and traced.
+     * It tracks only tombstones with localDeletionTime < now - 
gc_grace_period.
+     * Other (non-purgeable) tombstones will be tracked by regular Cassandra 
logic later.
+     */
+    private UnfilteredPartitionIterator 
withPurgeableTombstonesMetricRecording(UnfilteredPartitionIterator iter,
+                                                                               
ColumnFamilyStore cfs)
+    {
+        class PurgeableTombstonesMetricRecording extends 
Transformation<UnfilteredRowIterator>
+        {
+            private int purgeableTombstones = 0;
+
+            @Override
+            public UnfilteredRowIterator 
applyToPartition(UnfilteredRowIterator iter)
+            {
+                return Transformation.apply(iter, this);

Review Comment:
   yes, I do not expect a huge impact but I want to check if it is visible. We 
may read many rows if we select a big enough partition and each row has some 
number of cells, so MxN cells to iterate and check. As I mentioned, I suppose 
frequently per-cell stats are not really needed to pay an overhead for it, 
IMHO.. A configuration option can be a compromise here, like: 
droppable_tobmstones_metric_granularity: disabled|row|cell
   
   In https://issues.apache.org/jira/browse/CASSANDRA-20165 I have spent some 
time already to try to reduce the number of such non-optimal places already, so 
I would not like to introduce one more by myself :-D



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to