[jira] [Commented] (CASSANDRA-12961) LCS needlessly checks for L0 STCS candidates multiple times
[ https://issues.apache.org/jira/browse/CASSANDRA-12961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16189558#comment-16189558 ] Vusal Ahmadoglu commented on CASSANDRA-12961: - Thanks [~jjirsa]. That's a good news! > 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.0 > > 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 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 sstablesInLevel = Sets.newHashSet(sstables); > Set 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
[jira] [Commented] (CASSANDRA-12961) LCS needlessly checks for L0 STCS candidates multiple times
[ https://issues.apache.org/jira/browse/CASSANDRA-12961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16184637#comment-16184637 ] Vusal Ahmadoglu commented on CASSANDRA-12961: - Sure. > 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 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 sstablesInLevel = Sets.newHashSet(sstables); > Set 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
[jira] [Commented] (CASSANDRA-12961) LCS needlessly checks for L0 STCS candidates multiple times
[ https://issues.apache.org/jira/browse/CASSANDRA-12961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16181654#comment-16181654 ] Vusal Ahmadoglu commented on CASSANDRA-12961: - Hi Jeff. I checked your last circlleci tests. I got the same failure ([circleci|https://circleci.com/gh/vusal-ahmadoglu/cassandra/10]): _org.apache.cassandra.streaming.StreamTransferTaskTest Tests run: 2, Failures: 1_ > 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 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 sstablesInLevel = Sets.newHashSet(sstables); > Set 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
[jira] [Commented] (CASSANDRA-12961) LCS needlessly checks for L0 STCS candidates multiple times
[ https://issues.apache.org/jira/browse/CASSANDRA-12961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16177183#comment-16177183 ] Vusal Ahmadoglu commented on CASSANDRA-12961: - Okay. Thanks, Jeff! > 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 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 sstablesInLevel = Sets.newHashSet(sstables); > Set 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
[jira] [Commented] (CASSANDRA-12961) LCS needlessly checks for L0 STCS candidates multiple times
[ https://issues.apache.org/jira/browse/CASSANDRA-12961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16177021#comment-16177021 ] Vusal Ahmadoglu commented on CASSANDRA-12961: - Hi, Jeff. I can see that tests are failing. Is there anything I can help? Sorry for bothering you, I want to setup Circle CI to be able to run tests, could you suggest me resource about how can I set up and run C* tests in Circle CI? > 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 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 sstablesInLevel = Sets.newHashSet(sstables); > Set 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
[jira] [Commented] (CASSANDRA-12961) LCS needlessly checks for L0 STCS candidates multiple times
[ https://issues.apache.org/jira/browse/CASSANDRA-12961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16173857#comment-16173857 ] Vusal Ahmadoglu commented on CASSANDRA-12961: - BTW, thanks for your changes :) > 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 > 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 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 sstablesInLevel = Sets.newHashSet(sstables); > Set 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
[jira] [Commented] (CASSANDRA-12961) LCS needlessly checks for L0 STCS candidates multiple times
[ https://issues.apache.org/jira/browse/CASSANDRA-12961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16173848#comment-16173848 ] Vusal Ahmadoglu commented on CASSANDRA-12961: - Ohh, cool! I missed that part, good point. I have to setup CI, otherwise, it takes too long on the local machine. > 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 > 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 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 sstablesInLevel = Sets.newHashSet(sstables); > Set 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
[jira] [Updated] (CASSANDRA-12961) LCS needlessly checks for L0 STCS candidates multiple times
[ https://issues.apache.org/jira/browse/CASSANDRA-12961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vusal Ahmadoglu updated CASSANDRA-12961: Status: Patch Available (was: In Progress) Hi, Jeff. I'm new here, that's why I might go to the wrong direction :) I attached the patch as a file. Please, could you have a look and let me know in case there is anything wrong. Have a lovely day! > 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 > 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 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 sstablesInLevel = Sets.newHashSet(sstables); > Set 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
[jira] [Updated] (CASSANDRA-12961) LCS needlessly checks for L0 STCS candidates multiple times
[ https://issues.apache.org/jira/browse/CASSANDRA-12961?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Vusal Ahmadoglu updated CASSANDRA-12961: Attachment: 0001-CASSANDRA-12961-Moving-getSTCSInL0CompactionCandidat.patch Patch for CASSANDRA-12961 > 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 > 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 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 sstablesInLevel = Sets.newHashSet(sstables); > Set 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
[jira] [Commented] (CASSANDRA-12961) LCS needlessly checks for L0 STCS candidates multiple times
[ https://issues.apache.org/jira/browse/CASSANDRA-12961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16169069#comment-16169069 ] Vusal Ahmadoglu commented on CASSANDRA-12961: - Hi Jeff, could you assign this ticket to me? > 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 >Priority: Trivial > Labels: lhf > > 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 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 sstablesInLevel = Sets.newHashSet(sstables); > Set 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