From dev-return-309190-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Fri Jan 19 18:48:08 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id B5855180607 for ; Fri, 19 Jan 2018 18:48:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id A543F160C36; Fri, 19 Jan 2018 17:48:08 +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 C4748160C1B for ; Fri, 19 Jan 2018 18:48:07 +0100 (CET) Received: (qmail 90086 invoked by uid 500); 19 Jan 2018 17:48:06 -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 90073 invoked by uid 99); 19 Jan 2018 17:48:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jan 2018 17:48:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 13457C1A97 for ; Fri, 19 Jan 2018 17:48:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.911 X-Spam-Level: X-Spam-Status: No, score=-99.911 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id uYOP43JbM_aa for ; Fri, 19 Jan 2018 17:48:05 +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 A522C5FDD2 for ; Fri, 19 Jan 2018 17:48:02 +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 A23F1E0373 for ; Fri, 19 Jan 2018 17:48: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 5F89C20EA9 for ; Fri, 19 Jan 2018 17:48:00 +0000 (UTC) Date: Fri, 19 Jan 2018 17:48:00 +0000 (UTC) From: "Andrey Kudryavtsev (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (SOLR-11459) AddUpdateCommand#prevVersion is not cleared which may lead to problem for in-place updates of non existed documents 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-11459?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1633= 2599#comment-16332599 ]=20 Andrey Kudryavtsev edited comment on SOLR-11459 at 1/19/18 5:47 PM: -------------------------------------------------------------------- {quote}The author, somehow tell us that the update should create this doc. = It's not clear whether it's described as an expected behavior. But even it = is, can we have clearer assertNotNull()?=C2=A0 {quote} No problem.=C2=A0 {quote}Also, can't we don't=C2=A0-copy-paste-=C2=A0introduce=C2=A0{{indexDo= cs()}}=C2=A0but rather loop through docs?=C2=A0 {quote} Not sure about this one. I need a batch=C2=A0of updates on a same=C2=A0Solr= node to=C2=A0see problems when=C2=A0same instance of {{AddUpdateCommand}} = is reused=C2=A0for different updates. So it's like {{add(Collection docs)}}=C2=A0must have here.=C2=A0 =C2=A0 was (Author: werder): {quote} The author, somehow tell us that the update should create this doc. It's no= t clear whether it's described as an expected behavior. But even it is, can= we have clearer assertNotNull()?=C2=A0 {quote} No problem.=C2=A0 {quote} Also, can't we don't=C2=A0-copy-paste-=C2=A0introduce=C2=A0{{indexDocs()}}= =C2=A0but rather loop through docs?=C2=A0 {quote} Not sure about this one. I need a batch=C2=A0of updates on a same=C2=A0Solr= node to=C2=A0see problems when=C2=A0same instance of {{AddUpdateCommand}} = is reused=C2=A0for different updates. So it's like \{{add(Collection docs)}} is must have here.=C2=A0 =C2=A0 > AddUpdateCommand#prevVersion is not cleared which may lead to problem for= in-place updates of non existed documents > -------------------------------------------------------------------------= ------------------------------------------ > > Key: SOLR-11459 > URL: https://issues.apache.org/jira/browse/SOLR-11459 > Project: Solr > Issue Type: Bug > Security Level: Public(Default Security Level. Issues are Public)=20 > Components: SolrCloud > Affects Versions: 7.0 > Reporter: Andrey Kudryavtsev > Assignee: Ishan Chattopadhyaya > Priority: Minor > > I have a 1_shard / *m*_replicas SolrCloud cluster with Solr 6.6.0 and run= batches of 5 - 10k in-place updates from time to time.=20 > Once I noticed that job "hangs" - it started and couldn't finish for a a = while. > Logs were full of messages like: > {code} Missing update, on which current in-place update depends on, hasn'= t arrived. id=3D__, looking for version=3D___, last found version=3D0" {co= de} > {code}=20 > Tried to fetch document ___ from the leader, but the leader says document= has been deleted. Deleting the document here and skipping this update: Las= t found version: 0, was looking for: ___",24,0,"but the leader says documen= t has been deleted. Deleting the document here and skipping this update: La= st found version: 0 > {code} > Further analysis shows that: > * There are 100-500 updates for non-existed documents among other updates= (something that I have to deal with) > * Leader receives bunch of updates and executes this updates one by one. = {{JavabinLoader}} which is used by processing documents reuses same instanc= e of {{AddUpdateCommand}} for every update and just [clearing its state at = the end|https://github.com/apache/lucene-solr/blob/e2521b2a8baabdaf43b92192= 588f51e042d21e97/solr/core/src/java/org/apache/solr/handler/loader/JavabinL= oader.java#L99]. Field [AddUpdateCommand#prevVersion| https://github.com/ap= ache/lucene-solr/blob/6396cb759f8c799f381b0730636fa412761030ce/solr/core/sr= c/java/org/apache/solr/update/AddUpdateCommand.java#L76] is not cleared. = =20 > * In case of update is in-place update, but specified document does not e= xist, this update is processed as a regular atomic update (i.e. new doc is = created), but {{prevVersion}} is used as a {{distrib.inplace.prevversion}} = parameter in sequential calls to every slave in DistributedUpdateProcessor.= {{prevVersion}} wasn't cleared, so it may contain version from previous pr= ocessed update. > * Slaves checks it's own version of documents which is 0 (cause doc does = not exist), slave thinks that some updates were missed and spends 5 seconds= in [DistributedUpdateProcessor#waitForDependentUpdates|https://github.com/= apache/lucene-solr/blob/e2521b2a8baabdaf43b92192588f51e042d21e97/solr/core/= src/java/org/apache/solr/handler/loader/JavabinLoader.java#L99] waiting for= missed updates (no luck) and also tries to get "correct" version from lead= er (no luck as well)=20 > * So update for non existed document costs *m* * 5 sec each > I workarounded this by explicit check of doc existence, but it probably s= hould be fixed. > Obviously first guess is that prevVersion should be cleared in {{AddUpda= teCommand#clear}}, but have no clue how to test it. > {code} > +++ solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java=09(re= vision ) > @@ -78,6 +78,7 @@ > updateTerm =3D null; > isLastDocInBatch =3D false; > version =3D 0; > + prevVersion =3D -1; > } > {code} -- 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