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 542BE2009F8 for ; Fri, 3 Jun 2016 15:11:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 52F67160A2A; Fri, 3 Jun 2016 13:11:51 +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 BD4EF160A25 for ; Fri, 3 Jun 2016 15:11:50 +0200 (CEST) Received: (qmail 9132 invoked by uid 500); 3 Jun 2016 13:11:49 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 9119 invoked by uid 99); 3 Jun 2016 13:11:49 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2016 13:11:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 91AA7DFC13; Fri, 3 Jun 2016 13:11:49 +0000 (UTC) From: mjwall To: dev@accumulo.apache.org Reply-To: dev@accumulo.apache.org References: In-Reply-To: Subject: [GitHub] accumulo pull request #107: ACCUMULO-4157 Bug fix for removing WALs to quick... Content-Type: text/plain Message-Id: <20160603131149.91AA7DFC13@git1-us-west.apache.org> Date: Fri, 3 Jun 2016 13:11:49 +0000 (UTC) archived-at: Fri, 03 Jun 2016 13:11:51 -0000 Github user mjwall commented on a diff in the pull request: https://github.com/apache/accumulo/pull/107#discussion_r65704213 --- Diff: server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java --- @@ -410,4 +556,41 @@ static boolean isUUID(String name) { } } + /** + * Determine if TServer has been dead long enough to remove associated WALs. + *

+ * Uses a map where the key is the address and the value is the time first seen dead. If the address is not in the map, it is added with the current system + * nanoTime. When the passed in wait time has elapsed, this method returns true and removes the key and value from the map. + * + * @param address + * HostAndPort of dead tserver + * @param wait + * long value of elapsed time to wait + * @return boolean whether enough time elapsed since the server was first seen as dead. + */ + @VisibleForTesting + protected boolean timeToDelete(HostAndPort address, long wait) { + // check whether the tserver has been dead long enough + Long firstSeen = firstSeenDead.get(address); + if (firstSeen != null) { + long elapsedTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - firstSeen); --- End diff -- Good catch, I change it and didn't update the log message. Will fix. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---