smiklosovic commented on code in PR #4300:
URL: https://github.com/apache/cassandra/pull/4300#discussion_r2276131662
##########
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:
I am not completely sure this whole logic makes sense. First of all, I do
not think you can do one transaction _per partition_. Because it needs
`versions` (currenty set to `1`). I am not sure what I should set that to
because this is there when it is going to be _compacted_ but we are not
compacting anything really so 1 makes sense?
So, we get IndexGCTransaction.
Then, it will initialize `rows` in IndexGCTransaction's `start`. The size of
the rows array is derived from `versions`. Then it will go over rows in
`commit` etc.
However, to have individual rows in `rows` not null, it has to go over
`onRowMerge` where it is "merging" rows. Then it will run it through
`Rows.diff` and if builders are not null, it will populate `rows`
Calling it like this did not help
````
transaction.onRowMerge((Row) unfiltered);
````
but this did the trick
````
transaction.onRowMerge((Row) unfiltered, (Row) unfiltered);
````
Basically we are "merging" row into itself and the diff is the row? Does
this make sense? The test passes though.
Also, the reason I can not do transaction per partition, only per row, is
that IndexGCTransaction is row-oriented, not partition oriented.
--
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]