[ 
https://issues.apache.org/jira/browse/CASSANDRA-12961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16173821#comment-16173821
 ] 

Jeff Jirsa edited comment on CASSANDRA-12961 at 9/20/17 9:41 PM:
-----------------------------------------------------------------

Hi [~vusal.ahmadoglu] - looks really good, one small change I'd like to make 
(which I can make for you if you're ok with it): -
 [you should be able to use l0Compaction here as 
well|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java#L392]
 and skip one last useless call.

The other thing we'll need to do is run your patch through CI - so I've pushed 
that small change to my branch 
[here|https://github.com/jeffjirsa/cassandra/tree/cassandra-12961] (+ a slight 
text change to CHANGES)

And I'm running unit tests 
[here|https://circleci.com/gh/jeffjirsa/cassandra/356] ( you can do this if you 
setup circle ci as well)
I'm running dtests 
[here|https://builds.apache.org/view/A-D/view/Cassandra/job/Cassandra-devbranch-dtest/332]
 (you CANT do this, but I'll do it for you):



was (Author: jjirsa):
Hi [~vusal.ahmadoglu] - looks really good, one small change I'd like to make 
(which I can make for you if you're ok with it): -
 [you should be able to use l0Compaction here as 
well|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java#L392]
 and skip one last useless call.

The other thing we'll need to do is run your patch through CI - so I've pushed 
that small change to my branch 
[https://github.com/jeffjirsa/cassandra/tree/cassandra-12961|here] (+ a slight 
text change to CHANGES)

And I'm running unit tests 
[here|https://circleci.com/gh/jeffjirsa/cassandra/356] ( you can do this if you 
setup circle ci as well)
I'm running dtests 
[here|https://builds.apache.org/view/A-D/view/Cassandra/job/Cassandra-devbranch-dtest/332]
 (you CANT do this, but I'll do it for you):


> LCS needlessly checks for L0 STCS candidates multiple times
> -----------------------------------------------------------
>
>                 Key: CASSANDRA-12961
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12961
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Compaction
>            Reporter: Jeff Jirsa
>            Assignee: Vusal Ahmadoglu
>            Priority: Trivial
>              Labels: lhf
>             Fix For: 4.x
>
>         Attachments: 
> 0001-CASSANDRA-12961-Moving-getSTCSInL0CompactionCandidat.patch
>
>
> It's very likely that the check for L0 STCS candidates (if L0 is falling 
> behind) can be moved outside of the loop, or at very least made so that it's 
> not called on each loop iteration:
> {code}
>         for (int i = generations.length - 1; i > 0; i--)
>         {
>             List<SSTableReader> sstables = getLevel(i);
>             if (sstables.isEmpty())
>                 continue; // mostly this just avoids polluting the debug log 
> with zero scores
>             // 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);
>             logger.trace("Compaction score for level {} is {}", i, score);
>             if (score > 1.001)
>             {
>                 // before proceeding with a higher level, let's see if L0 is 
> far enough behind to warrant STCS
>                 CompactionCandidate l0Compaction = 
> getSTCSInL0CompactionCandidate();
>                 if (l0Compaction != null)
>                     return l0Compaction;
> ......
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to