Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 055571143E for ; Wed, 30 Jul 2014 18:12:40 +0000 (UTC) Received: (qmail 2807 invoked by uid 500); 30 Jul 2014 18:12:39 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 2757 invoked by uid 500); 30 Jul 2014 18:12:39 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 2670 invoked by uid 99); 30 Jul 2014 18:12:39 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jul 2014 18:12:39 +0000 Date: Wed, 30 Jul 2014 18:12:39 +0000 (UTC) From: "Demai Ni (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HBASE-11617) AgeOfLastAppliedOp in MetricsSink got increased when no new replication sink OP 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/HBASE-11617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Demai Ni updated HBASE-11617: ----------------------------- Environment: (was: AgeOfLastAppliedOp in MetricsSink.java is to indicate the time an edit sat in the 'replication queue' before it got replicated(aka applied) {code} /** * Set the age of the last applied operation * * @param timestamp The timestamp of the last operation applied. * @return the age that was set */ public long setAgeOfLastAppliedOp(long timestamp) { lastTimestampForAge = timestamp; long age = System.currentTimeMillis() - lastTimestampForAge; rms.setGauge(SINK_AGE_OF_LAST_APPLIED_OP, age); return age; } {code} In the following scenario: 1) at 7:00am a sink op is applied, and the SINK_AGE_OF_LAST_APPLIED_OP is set for example 100ms; 2) and then NO new Sink op occur. 3) when a refreshAgeOfLastAppliedOp() is invoked at 8:00am. Instead of return the 100ms, the AgeOfLastAppliedOp become 1hour + 100ms, It was because that refreshAgeOfLastAppliedOp() get invoked periodically by getStats(). proposed fix: {code} .... // a new value + private long age; .... public long setAgeOfLastAppliedOp(long timestamp) { + if (lastTimestampForAge != timestamp) { lastTimestampForAge = timestamp; - long age = System.currentTimeMillis() - lastTimestampForAge; + this.age = System.currentTimeMillis() - lastTimestampForAge; rms.setGauge(SINK_AGE_OF_LAST_APPLIED_OP, age); } return age; } {code} detail discussion in [dev@hbase | http://mail-archives.apache.org/mod_mbox/hbase-dev/201407.mbox/%3CCAOEq2C5BKMXAM2Fv4LGVb_Ktek-Pm%3DhjOi33gSHX-2qHqAou6w%40mail.gmail.com%3E ]) > AgeOfLastAppliedOp in MetricsSink got increased when no new replication sink OP > -------------------------------------------------------------------------------- > > Key: HBASE-11617 > URL: https://issues.apache.org/jira/browse/HBASE-11617 > Project: HBase > Issue Type: Bug > Components: Replication > Affects Versions: 0.98.2 > Reporter: Demai Ni > Assignee: Demai Ni > Priority: Minor > Fix For: 0.99.0, 0.98.5, 2.0.0 > > -- This message was sent by Atlassian JIRA (v6.2#6252)