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 800DD200CBF for ; Sat, 24 Jun 2017 01:57:05 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7ECF2160BF2; Fri, 23 Jun 2017 23:57:05 +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 C58C2160BE5 for ; Sat, 24 Jun 2017 01:57:04 +0200 (CEST) Received: (qmail 36484 invoked by uid 500); 23 Jun 2017 23:57:03 -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 36472 invoked by uid 99); 23 Jun 2017 23:57:03 -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; Fri, 23 Jun 2017 23:57:03 +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 1FACEC14D0 for ; Fri, 23 Jun 2017 23:57:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, 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 fi2BiZ8I8jps for ; Fri, 23 Jun 2017 23:57:02 +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 540375FD91 for ; Fri, 23 Jun 2017 23:57:01 +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 C6F75E0D76 for ; Fri, 23 Jun 2017 23:57:00 +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 28B9C21946 for ; Fri, 23 Jun 2017 23:57:00 +0000 (UTC) Date: Fri, 23 Jun 2017 23:57:00 +0000 (UTC) From: "Devaraj Das (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-18214) Replace the folly::AtomicHashMap usage in the RPC layer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 23 Jun 2017 23:57:05 -0000 [ https://issues.apache.org/jira/browse/HBASE-18214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16061660#comment-16061660 ] Devaraj Das commented on HBASE-18214: ------------------------------------- Looks fine but I think the lock inside {code}mapped_type& operator[](const key_type& key) {code} should be the unique_lock since we are mutating the map when the key doesn't exist, no? > Replace the folly::AtomicHashMap usage in the RPC layer > ------------------------------------------------------- > > Key: HBASE-18214 > URL: https://issues.apache.org/jira/browse/HBASE-18214 > Project: HBase > Issue Type: Sub-task > Reporter: Devaraj Das > Assignee: Devaraj Das > Attachments: 18214-1-1.txt, 18214-1-2.txt, hbase-18214_v3.patch, hbase-18214_v4.patch > > > In my tests, I saw that folly::AtomicHashMap usage is not appropriate for one, rather common use case. It'd become sort of unusable (inserts would hang) after a bunch of inserts and erases. This hashmap is used to keep track of call-Id after a connection is set up in the RPC layer (insert a call-id/msg pair when an RPC is sent, and erase the pair when the corresponding response is received). Here is a simple program that will demonstrate the issue: > {code} > folly::AtomicHashMap f(100); > int i = 0; > while (i < 10000) { > try { > f.insert(i,100); > LOG(INFO) << "Inserted " << i << " " << f.size(); > f.erase(i); > LOG(INFO) << "Deleted " << i << " " << f.size(); > i++; > } catch (const std::exception &e) { > LOG(INFO) << "Exception " << e.what(); > break; > } > } > {code} > After poking around a little bit, it is indeed called out as a limitation here https://github.com/facebook/folly/blob/master/folly/docs/AtomicHashMap.md (grep for 'erase'). Proposal is to replace this with something that will fit in in the above usecase (thinking of using std::unordered_map). -- This message was sent by Atlassian JIRA (v6.4.14#64029)