You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/04/18 09:51:55 UTC

[GitHub] [cassandra] alex-ninja commented on a change in pull request #971: CASSANDRA-15669. Fixed ArrayIndexOutOfBoundsException in LCS for L8 compaction.

alex-ninja commented on a change in pull request #971:
URL: https://github.com/apache/cassandra/pull/971#discussion_r615373294



##########
File path: src/java/org/apache/cassandra/db/compaction/LeveledManifest.java
##########
@@ -242,11 +242,17 @@ public synchronized CompactionCandidate getCompactionCandidates()
             // we want to calculate score excluding compacting ones
             Set<SSTableReader> sstablesInLevel = Sets.newHashSet(sstables);
             Set<SSTableReader> remaining = Sets.difference(sstablesInLevel, cfs.getTracker().getCompacting());
-            double score = (double) SSTableReader.getTotalBytes(remaining) / (double)maxBytesForLevel(i, maxSSTableSizeInBytes);
+            long remainingBytesForLevel = SSTableReader.getTotalBytes(remaining);

Review comment:
       Here I rely on the remaining bytes rather than total bytes and I feel it is safe to do so because on the first compaction attempt total = remaining. Please, confirm the assumption is correct.




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

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



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