Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 236AD189B9 for ; Wed, 25 Nov 2015 10:21:12 +0000 (UTC) Received: (qmail 90964 invoked by uid 500); 25 Nov 2015 10:21:11 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 90899 invoked by uid 500); 25 Nov 2015 10:21:11 -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 90628 invoked by uid 99); 25 Nov 2015 10:21:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Nov 2015 10:21:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 002942C1F58 for ; Wed, 25 Nov 2015 10:21:11 +0000 (UTC) Date: Wed, 25 Nov 2015 10:21:10 +0000 (UTC) From: "Jakub Janecek (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-10740) Incorrect condition causes cleanup of SSTables which might not need it MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-10740?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15026562#comment-15026562 ] Jakub Janecek commented on CASSANDRA-10740: ------------------------------------------- [~krummas] I have added a patch with the test. The last test case shows that the change actually has some effect. The old implementation would return that the SSTable needs a cleanup but my implementation correctly returns false. > Incorrect condition causes cleanup of SSTables which might not need it > ---------------------------------------------------------------------- > > Key: CASSANDRA-10740 > URL: https://issues.apache.org/jira/browse/CASSANDRA-10740 > Project: Cassandra > Issue Type: Bug > Reporter: Jakub Janecek > Fix For: 2.1.x > > Attachments: trunk-10740.txt, trunk-test-10740.txt > > > We needed to perform cleanup of SSTables in our production cluster but found out that it would take several months. Together with my colleague [~JiriHorky] we have pinpointed the issue to method CompactionManager.needsCleanup which incorrectly marks almost all SSTables as the ones needing the cleanup even though that might not be true. I am attaching a patch which should be applicable from version 2.x forward (this is the version we would need it in). > To explain the problem, the last condition in the cycle that checks whether the next key in the SSTable after the current checked range is NOT contained in the next range falsely marks SSTable as necessary to have cleanup even though it might be contained in some other range. The correct condition (which is actully described in the comment) is to check whether the next key in the SSTable after the current range is less than or equal to the "left" key of the next range (assuming that the left key is exclusive which is described in another comment of the same method). > Is our patch and reasoning correct? -- This message was sent by Atlassian JIRA (v6.3.4#6332)