Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E334811FCA for ; Fri, 1 Aug 2014 21:53:39 +0000 (UTC) Received: (qmail 83812 invoked by uid 500); 1 Aug 2014 21:53:39 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 83756 invoked by uid 500); 1 Aug 2014 21:53:39 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 83742 invoked by uid 99); 1 Aug 2014 21:53:39 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Aug 2014 21:53:39 +0000 Date: Fri, 1 Aug 2014 21:53:39 +0000 (UTC) From: "Andrew Wang (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-6788) Improve synchronization in BPOfferService with read write lock 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/HDFS-6788?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14083017#comment-14083017 ] Andrew Wang commented on HDFS-6788: ----------------------------------- As an FYI, I just did a quick revert + fix for the branch-2 version of this since the SVN merge messed up (a brace was in the wrong place, but no conflict). > Improve synchronization in BPOfferService with read write lock > -------------------------------------------------------------- > > Key: HDFS-6788 > URL: https://issues.apache.org/jira/browse/HDFS-6788 > Project: Hadoop HDFS > Issue Type: Bug > Components: datanode > Affects Versions: 2.5.0 > Reporter: Yongjun Zhang > Assignee: Yongjun Zhang > Fix For: 2.6.0 > > Attachments: HDFS-6788.001.patch, HDFS-6788.002.patch > > > Threads in DN (DataXceiver, PacketResponder, Async disk worker etc) may block at BPOfferService.getBlockPoolId() when calling BPOfferService.checkBlock(), though they are just reading the same blockpool id. This is unnecessary overhead and may cause performance hit when many threads compete. Filing this jira to replace synchronized method with read write lock (ReentrantReadWriteLock). -- This message was sent by Atlassian JIRA (v6.2#6252)