From issues-return-12120-archive-asf-public=cust-asf.ponee.io@bookkeeper.apache.org Tue Sep 11 03:19:58 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 CC27C18067A for ; Tue, 11 Sep 2018 03:19:57 +0200 (CEST) Received: (qmail 83422 invoked by uid 500); 11 Sep 2018 01:19:56 -0000 Mailing-List: contact issues-help@bookkeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@bookkeeper.apache.org Delivered-To: mailing list issues@bookkeeper.apache.org Received: (qmail 83413 invoked by uid 99); 11 Sep 2018 01:19:56 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Sep 2018 01:19:56 +0000 From: GitBox To: issues@bookkeeper.apache.org Subject: [GitHub] athanatos commented on a change in pull request #1646: Use immutable metadata in LedgerHandle Message-ID: <153662879629.32209.8340276834738712922.gitbox@gitbox.apache.org> Date: Tue, 11 Sep 2018 01:19:56 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit athanatos commented on a change in pull request #1646: Use immutable metadata in LedgerHandle URL: https://github.com/apache/bookkeeper/pull/1646#discussion_r216521270 ########## File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java ########## @@ -138,7 +139,8 @@ */ public static final long INVALID_LEDGER_ID = -0xABCDABCDL; - final AtomicInteger blockAddCompletions = new AtomicInteger(0); + final Object metadataLock = new Object(); Review comment: I'm guessing that the reason for this lock is to prevent write completion events from contending on the LedgerHandle object with write initiation? Is that contention really enough of a problem for this to be a measurable win? If so, I think that the state protected by this lock (changingEnsemble, delayedWriteFailedBookies) should be moved into an actual object with descriptive methods. As it is, it's a bit tough to infer the update rules. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services