Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2D4F4200D0E for ; Wed, 27 Sep 2017 00:03:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 2BC281609D7; Tue, 26 Sep 2017 22:03:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 72E721609C4 for ; Wed, 27 Sep 2017 00:03:03 +0200 (CEST) Received: (qmail 31568 invoked by uid 500); 26 Sep 2017 22:03:02 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 31557 invoked by uid 99); 26 Sep 2017 22:03:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Sep 2017 22:03:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 04389C8603 for ; Tue, 26 Sep 2017 22:03:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Y-t9w5oIgHOZ for ; Tue, 26 Sep 2017 22:03:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 21AE65F299 for ; Tue, 26 Sep 2017 22:03:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id AD18BE0059 for ; Tue, 26 Sep 2017 22:03:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 6EABA24266 for ; Tue, 26 Sep 2017 22:03:00 +0000 (UTC) Date: Tue, 26 Sep 2017 22:03:00 +0000 (UTC) From: "Vusal Ahmadoglu (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-12961) LCS needlessly checks for L0 STCS candidates multiple times MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 26 Sep 2017 22:03:04 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-12961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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-unsubscribe@cassandra.apache.org For additional commands, e-mail: commits-help@cassandra.apache.org