From issues-return-357458-archive-asf-public=cust-asf.ponee.io@hbase.apache.org Wed Aug 1 08:25:39 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0EAA5180662 for ; Wed, 1 Aug 2018 08:25:38 +0200 (CEST) Received: (qmail 66666 invoked by uid 500); 1 Aug 2018 06:23:40 -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 66596 invoked by uid 99); 1 Aug 2018 06:23:39 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2018 06:23:39 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 5AFDAC1C06 for ; Wed, 1 Aug 2018 06:23:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id pHfWxlaAtDNp for ; Wed, 1 Aug 2018 06:23:38 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id C4863623F1 for ; Wed, 1 Aug 2018 06:23:18 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 7715AE2639 for ; Wed, 1 Aug 2018 06:23:18 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5BAD527765 for ; Wed, 1 Aug 2018 06:23:18 +0000 (UTC) Date: Wed, 1 Aug 2018 06:23:18 +0000 (UTC) From: "Gavin (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Issue Comment Deleted] (HBASE-18168) NoSuchElementException when rolling the log 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-18168?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gavin updated HBASE-18168: -------------------------- Comment: was deleted (was: A comment with security level 'jira-users' was removed.) > NoSuchElementException when rolling the log > ------------------------------------------- > > Key: HBASE-18168 > URL: https://issues.apache.org/jira/browse/HBASE-18168 > Project: HBase > Issue Type: Bug > Affects Versions: 1.1.11 > Reporter: Allan Yang > Assignee: Allan Yang > Priority: Major > Fix For: 1.1.11 > > Attachments: HBASE-18168-branch-1.1.patch, HBASE-18168-branch-1.1.v2.patch, HBASE-18168-branch-1.1.v3.patch > > > Today, one of our server aborted due to the following log. > {code} > 2017-06-06 05:38:47,142 ERROR [regionserver/xxxx.logRoller] regionserver.LogRoller: Log rolling failed > java.util.NoSuchElementException > at java.util.concurrent.ConcurrentSkipListMap$Iter.advance(ConcurrentSkipListMap.java:2224) > at java.util.concurrent.ConcurrentSkipListMap$ValueIterator.next(ConcurrentSkipListMap.java:2253) > at java.util.Collections.min(Collections.java:628) > at org.apache.hadoop.hbase.regionserver.wal.FSHLog.findEligibleMemstoresToFlush(FSHLog.java:861) > at org.apache.hadoop.hbase.regionserver.wal.FSHLog.findRegionsToForceFlush(FSHLog.java:886) > at org.apache.hadoop.hbase.regionserver.wal.FSHLog.rollWriter(FSHLog.java:728) > at org.apache.hadoop.hbase.regionserver.LogRoller.run(LogRoller.java:137) > at java.lang.Thread.run(Thread.java:756) > 2017-06-06 05:38:47,142 FATAL [regionserver/xxxx.logRoller] regionserver.HRegionServer: ABORTING region server xxxx: Log rolling failed > java.util.NoSuchElementException > ...... > {code} > The code is here: > {code} > private byte[][] findEligibleMemstoresToFlush(Map regionsSequenceNums) { > List regionsToFlush = null; > // Keeping the old behavior of iterating unflushedSeqNums under oldestSeqNumsLock. > synchronized (regionSequenceIdLock) { > for (Map.Entry e: regionsSequenceNums.entrySet()) { > ConcurrentMap m = > this.oldestUnflushedStoreSequenceIds.get(e.getKey()); > if (m == null) { > continue; > } > long unFlushedVal = Collections.min(m.values()); //The exception is thrown here > ...... > {code} > The map 'm' is empty is the only reason I can think of why NoSuchElementException is thrown. I then looked up all code related to the update of 'oldestUnflushedStoreSequenceIds'. All update to 'oldestUnflushedStoreSequenceIds' is guarded by the synchronization of 'regionSequenceIdLock' except here: > {code} > private ConcurrentMap getOrCreateOldestUnflushedStoreSequenceIdsOfRegion( > byte[] encodedRegionName) { > ...... > oldestUnflushedStoreSequenceIdsOfRegion = > new ConcurrentSkipListMap(Bytes.BYTES_COMPARATOR); > ConcurrentMap alreadyPut = > oldestUnflushedStoreSequenceIds.putIfAbsent(encodedRegionName, > oldestUnflushedStoreSequenceIdsOfRegion); // Here, a empty map may put to 'oldestUnflushedStoreSequenceIds' with no synchronization > return alreadyPut == null ? oldestUnflushedStoreSequenceIdsOfRegion : alreadyPut; > } > {code} > It should be a very rare bug. But it can lead to server abort. It only exists in branch-1.1. -- This message was sent by Atlassian JIRA (v7.6.3#76005)