Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EE31FD57A for ; Sun, 7 Oct 2012 14:39:57 +0000 (UTC) Received: (qmail 4134 invoked by uid 500); 7 Oct 2012 14:39:55 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 4077 invoked by uid 500); 7 Oct 2012 14:39:54 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 4069 invoked by uid 99); 7 Oct 2012 14:39:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Oct 2012 14:39:54 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of edlinuxguru@gmail.com designates 209.85.223.172 as permitted sender) Received: from [209.85.223.172] (HELO mail-ie0-f172.google.com) (209.85.223.172) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Oct 2012 14:39:49 +0000 Received: by mail-ie0-f172.google.com with SMTP id 9so8563678iec.31 for ; Sun, 07 Oct 2012 07:39:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=uMF0DD8zs/cuF/PVbNdogNmhV2vQKPXUWd4PkhSWgKg=; b=mE4xD5NyfKfWClcFxlnEms+rREPIyUTkw2BznsoCd59rAcUJH97g5PZjbX/Db4QFp3 b6S2PLid504HnaZeqhX1QaVmPJ8eVo0xWte2x15XNKf7UJJZLTWeZQQlRtVKh5O0o4cm OUclUATupTZtceWFv8uWDnYB7wqpus527/+vkgzlKlHQohFLZ1Xsiqo1IOIpne8MXDeD 4twwmqq5OmDuAdcTPW9lhM9Mc6aNVTDnoxdtBv0U3KIMoXHa8ihk8Pocz3OJ+rSEC/8+ kwfzFZ40QXZzX8g78Vwd5JpXgHJXrX2F8O65lKtuZAAlXQa8kLSkxHX9VaSXmO1tW5Ec JFrg== MIME-Version: 1.0 Received: by 10.50.190.161 with SMTP id gr1mr3663936igc.14.1349620769103; Sun, 07 Oct 2012 07:39:29 -0700 (PDT) Received: by 10.64.97.106 with HTTP; Sun, 7 Oct 2012 07:39:29 -0700 (PDT) In-Reply-To: References: Date: Sun, 7 Oct 2012 10:39:29 -0400 Message-ID: Subject: Re: MBean cassandra.db.CompactionManager TotalBytesCompacted counts backwards From: Edward Capriolo To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org I have not looked at this JMX object in a while, however the compaction manager can support multiple threads. Also it moves from 0-filesize each time it has to compact a set of files. That is more useful for showing current progress rather then lifetime history. On Fri, Oct 5, 2012 at 7:27 PM, Bryan Talbot wrote: > I've recently added compaction rate (in bytes / second) to my monitors for > cassandra and am seeing some odd values. I wasn't expecting the values for > TotalBytesCompacted to sometimes decrease from one reading to the next. It > seems that the value should be monotonically increasing while a server is > running -- obviously it would start again at 0 when the server is restarted > or if the counter rolls over (unlikely for a 64 bit long). > > Below are two samples taken 60 seconds apart: the value decreased by > 2,954,369,012 between the two readings. > > reported_metric=[timestamp:1349476449, status:200, > request:[mbean:org.apache.cassandra.db:type=CompactionManager, > attribute:TotalBytesCompacted, type:read], value:7548675470069] > > previous_metric=[timestamp:1349476389, status:200, > request:[mbean:org.apache.cassandra.db:type=CompactionManager, > attribute:TotalBytesCompacted, type:read], value:7551629839081] > > > I briefly looked at the code for CompactionManager and a few related classes > and don't see anyplace that is performing subtraction explicitly; however, > there are many additions of signed long values that are not validated and > could conceivably contain a negative value thus causing the > totalBytesCompacted to decrease. It's interesting to note that the all of > the differences I've seen so far are more than the overflow value of a > signed 32 bit value. The OS (CentOS 5.7) and sun java vm (1.6.0_29) are > both 64 bit. JNA is enabled. > > Is this expected and normal? If so, what is the correct interpretation of > this metric? I'm seeing the negatives values a few times per hour when > reading it once every 60 seconds. > > -Bryan >