From dev-return-322160-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Mon May 14 23:41:06 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 CFCA1180627 for ; Mon, 14 May 2018 23:41:05 +0200 (CEST) Received: (qmail 3921 invoked by uid 500); 14 May 2018 21:41:04 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 3907 invoked by uid 99); 14 May 2018 21:41:04 -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; Mon, 14 May 2018 21:41:04 +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 EE9B8C0189 for ; Mon, 14 May 2018 21:41:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.311 X-Spam-Level: X-Spam-Status: No, score=-110.311 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id GoLQrYHwNS7O for ; Mon, 14 May 2018 21:41:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id BE92F5F2A9 for ; Mon, 14 May 2018 21:41: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 B6864E0CCC for ; Mon, 14 May 2018 21:41: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 485EF2179F for ; Mon, 14 May 2018 21:41:00 +0000 (UTC) Date: Mon, 14 May 2018 21:41:00 +0000 (UTC) From: "David Smiley (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SOLR-12338) Replay buffering tlog in parallel MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SOLR-12338?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1647= 4832#comment-16474832 ]=20 David Smiley commented on SOLR-12338: ------------------------------------- I looked at this again (after a few days of vacation) and I withdraw my con= cern that there's a bug. =C2=A0The use of ArrayBlockingQueue(1) is acting a= s a sort of Lock in the same way I suggested to use a Lock. =C2=A0Couldn't = you simply replace it with a Lock? =C2=A0The put() becomes a lock(), and th= e poll() becomes an unlock(); see what I mean?. =C2=A0I think this is clear= er since it's a simpler mechanism than an ArrayBlockingQueue, and the use o= f ABQ in this specific way (size 1)=C2=A0could lend itself to misuse later = if someone thinks increasing its size or type gains us parallelism. =C2=A0A= nd I don't think the fairness setting matters here. =C2=A0And although you = initialized the size of this array of ABQ to be the number of threads, I th= ink we ought to=C2=A0use a larger array to prevent collisions (prevent need= lessly blocking on different docIDs that hash to the same thread). I also was thinking of a way to have more "on-deck" runnables for a given d= ocID, waiting in-line. =C2=A0The Runnable we submit to the delegate could b= e some inner class OrderedRunnable that has a "next" pointer to the next Or= deredRunnable. =C2=A0We could maintain a parallel array of the top=C2=A0Ord= eredRunnable (parallel to an array of Locks). =C2=A0Manipulating the Ordere= dRunnable chain requires holding the lock. =C2=A0To ensure we bound these t= hings waiting in-line, we could use one Semaphore for the whole OrderedExec= utor instance. =C2=A0There's more to it than this. =C2=A0Of course this add= s complexity, but the current approach (either ABQ or Lock) can unfortunate= ly block needlessly if the doc ID is locked yet soon more/different dock ID= s will be submitted next and there are available threads. =C2=A0Perhaps thi= s is overthinking it (over optimization / complexity) as this will not be t= he common case? =C2=A0This would be even more needless if we increase the L= ock array to prevent collisions so nevermind I guess. =C2=A0 {quote}(RE Submit without ID) This can help us to=C2=A0know how many thread= s are running (pending). Therefore OrderedExecutor does not execute more th= an=C2=A0\{{numThreads=C2=A0}}in parallel. It also solves the case=C2=A0when= ExecutorService's queue is full it will throw=C2=A0RejectedExecutionExcept= ion. {quote} Isn't this up to how the backing delegate is configured? =C2=A0If it's usin= g a fixed thread pool, then there won't be more threads running. =C2=A0Like= wise for RejectedExecutionException. > Replay buffering tlog in parallel > --------------------------------- > > Key: SOLR-12338 > URL: https://issues.apache.org/jira/browse/SOLR-12338 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public)=20 > Reporter: Cao Manh Dat > Assignee: Cao Manh Dat > Priority: Major > Attachments: SOLR-12338.patch, SOLR-12338.patch > > > Since updates with different id are independent, therefore it is safe to = replay them in parallel. This will significantly reduce recovering time of = replicas in high load indexing environment.=20 -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org