blambov commented on code in PR #4300:
URL: https://github.com/apache/cassandra/pull/4300#discussion_r2276249630


##########
src/java/org/apache/cassandra/db/compaction/CompactionTask.java:
##########
@@ -102,6 +110,43 @@ public boolean 
reduceScopeForLimitedSpace(Set<SSTableReader> nonExpiredSSTables,
         return false;
     }
 
+    private void 
maybeNotifyIndexersAboutRowsInFullyExpiredSSTables(Set<SSTableReader> 
fullyExpiredSSTables)
+    {
+        if (fullyExpiredSSTables.isEmpty())
+            return;
+
+        List<Index> indexes = cfs.indexManager.listIndexes()
+                                              .stream()
+                                              
.filter(Index::notifyIndexerAboutRowsInFullyExpiredSSTables)
+                                              .collect(Collectors.toList());
+
+        if (indexes.isEmpty())
+            return;
+
+        for (SSTableReader expiredSSTable : fullyExpiredSSTables)
+        {
+            expiredSSTable.getScanner()
+                          .forEachRemaining(partition ->
+                                            {
+                                                
partition.forEachRemaining(unfiltered -> {

Review Comment:
   We definitely don't want to materialize the whole partition, but the number 
rows in the partition should not matter here. The number of "versions", i.e. 
sources for each merged row, in this case is always one (only the obsoleted 
sstable). Thus we should be able to move the transaction initialization as it 
is to the per-partition section.
   
   As the row is deleted, something like
   ```
   transaction.onRowMerge(null, (Row) unfiltered);
   ```
   should be the correct usage.
   
   If this doesn't work, let's not spend any more time on it and go back to 
your original implementation.



-- 
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