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 980F4200C02 for ; Fri, 6 Jan 2017 02:02:44 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 96CD5160B47; Fri, 6 Jan 2017 01:02:44 +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 E9309160B33 for ; Fri, 6 Jan 2017 02:02:43 +0100 (CET) Received: (qmail 82693 invoked by uid 500); 6 Jan 2017 01:02:40 -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 82449 invoked by uid 99); 6 Jan 2017 01:02:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2017 01:02:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 9ED9F2C2A68 for ; Fri, 6 Jan 2017 01:02:40 +0000 (UTC) Date: Fri, 6 Jan 2017 01:02:40 +0000 (UTC) From: "Jon Haddad (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-12979) checkAvailableDiskSpace doesn't update expectedWriteSize when reducing thread scope MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 06 Jan 2017 01:02:44 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-12979?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jon Haddad updated CASSANDRA-12979: ----------------------------------- Attachment: (was: trunk-12979.patch) > checkAvailableDiskSpace doesn't update expectedWriteSize when reducing thread scope > ----------------------------------------------------------------------------------- > > Key: CASSANDRA-12979 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12979 > Project: Cassandra > Issue Type: Bug > Reporter: Jon Haddad > Assignee: Jon Haddad > Labels: compaction > Fix For: 2.2.9, 3.0.11, 4.0, 3.x > > Attachments: 2.2-Fixed-checkAvailableDiskSpace-to-properly-recalculat.patch, 30-Fixed-checkAvailableDiskSpace-to-properly-recalculat.patch, trunk-12979.patch, trunk-Fixed-checkAvailableDiskSpace-to-properly-recalculat.patch > > > If a compaction occurs that looks like it'll take up more space than remaining disk available, the compaction manager attempts to reduce the scope of the compaction by calling {{reduceScopeForLimitedSpace()}} repeatedly. > Unfortunately, the while loop passes the {{estimatedWriteSize}} calculated from the original call to {{hasAvailableDiskSpace}}, so the comparisons that are done will always be against the size of the original compaction, rather than the reduced scope one. > Full method below: > {code} > protected void checkAvailableDiskSpace(long estimatedSSTables, long expectedWriteSize) > { > if(!cfs.isCompactionDiskSpaceCheckEnabled() && compactionType == OperationType.COMPACTION) > { > logger.info("Compaction space check is disabled"); > return; > } > while (!getDirectories().hasAvailableDiskSpace(estimatedSSTables, expectedWriteSize)) > { > if (!reduceScopeForLimitedSpace()) > throw new RuntimeException(String.format("Not enough space for compaction, estimated sstables = %d, expected write size = %d", estimatedSSTables, expectedWriteSize)); > > } > } > {code} > I'm proposing to recalculate the {{estimatedSSTables}} and {{expectedWriteSize}} after each iteration of {{reduceScopeForLimitedSpace}}. -- This message was sent by Atlassian JIRA (v6.3.4#6332)