From issues-return-5317-archive-asf-public=cust-asf.ponee.io@lucene.apache.org Mon Nov 25 01:34:03 2019 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4EB8F180643 for ; Mon, 25 Nov 2019 02:34:03 +0100 (CET) Received: (qmail 26028 invoked by uid 500); 25 Nov 2019 01:34:02 -0000 Mailing-List: contact issues-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 issues@lucene.apache.org Received: (qmail 26015 invoked by uid 99); 25 Nov 2019 01:34:02 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Nov 2019 01:34:02 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 3AA41E2C44 for ; Mon, 25 Nov 2019 01:34:00 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 1FCF97803FE for ; Mon, 25 Nov 2019 01:34:00 +0000 (UTC) Date: Mon, 25 Nov 2019 01:34:00 +0000 (UTC) From: "Ishan Chattopadhyaya (Jira)" To: issues@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SOLR-13963) JavaBinCodec has concurrent modification of CharArr resulting in corrupt intranode updates 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-13963?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1698= 1240#comment-16981240 ]=20 Ishan Chattopadhyaya commented on SOLR-13963: --------------------------------------------- Does it warrant a 8.3.1 release? > JavaBinCodec has concurrent modification of CharArr resulting in corrupt = intranode updates > -------------------------------------------------------------------------= ----------------- > > Key: SOLR-13963 > URL: https://issues.apache.org/jira/browse/SOLR-13963 > Project: Solr > Issue Type: Bug > Security Level: Public(Default Security Level. Issues are Public)=20 > Affects Versions: 8.3 > Reporter: Colvin Cowie > Assignee: Noble Paul > Priority: Major > Attachments: JavaBinCodec.java, SOLR-13963.patch, SOLR-13963.patc= h > > > Discussed on the mailing list "Possible data corruption in JavaBinCodec i= n Solr 8.3 during distributed update?" > =C2=A0 > In summary, after moving to 8.3 we had a consistent (but non-deterministi= c) set of failing tests where the data being sent in intranode requests was= _sometimes_ corrupted. For example if the well formed data was > _'fieldName':"this is a long string"_ > The error we saw from Solr might be that > unknown field _+'fieldNamis a long string"+_=20 > =C2=A0 > The change that indirectly caused to this issue to materialize was from = SOLR-13682 which meant that org.apache.solr.common.SolrInputDocument.writeM= ap(EntryWriter) would call org.apache.solr.common.SolrInputField.getValue()= rather than org.apache.solr.common.SolrInputField.getRawValue() as it had = before. > =C2=A0 > getRawValue for a string calls org.apache.solr.common.util.ByteArrayUtf8= CharSequence._getStr() which in this context calls > org.apache.solr.common.util.JavaBinCodec.getStringProvider() > =C2=A0 > JavaBinCodec has a CharArr, _arr_, which is modified in two different lo= cations, but only one of which is protected with a synchronized block > =C2=A0 > getStringProvider() synchronizes on _arr_: > [https://github.com/apache/lucene-solr/blob/master/solr/solrj/src/java/o= rg/apache/solr/common/util/JavaBinCodec.java#L966] > =C2=A0 > but=C2=A0 _readStr() doesn't: > [https://github.com/apache/lucene-solr/blob/master/solr/solrj/src/java/o= rg/apache/solr/common/util/JavaBinCodec.java#L930] > =C2=A0 > The two methods are called concurrently, but wheren't prior to SOLR-1368= 2. > =C2=A0 > Adding a synchronized block into _readStr() around the modification of= =C2=A0_arr_ fixes the problem as far as I can see. > =C2=A0 > Also, the problem does not seem to occur when using the dynamic schema mo= de of=C2=A0autoCreateFields=3Dtrue in the updateRequestProcessorChain. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org For additional commands, e-mail: issues-help@lucene.apache.org