From issues-return-101555-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Mon Nov 18 06:25:02 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 A0A64180657 for ; Mon, 18 Nov 2019 07:25:02 +0100 (CET) Received: (qmail 2381 invoked by uid 500); 18 Nov 2019 06:25:01 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 2372 invoked by uid 99); 18 Nov 2019 06:25:01 -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, 18 Nov 2019 06:25:01 +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 B71D5E0F34 for ; Mon, 18 Nov 2019 06:25: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 0C22F78047E for ; Mon, 18 Nov 2019 06:25:00 +0000 (UTC) Date: Mon, 18 Nov 2019 06:25:00 +0000 (UTC) From: "Matija Polajnar (Jira)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IGNITE-12375) Inconsistent persistent cache behaviour: containsKey returns false on a key returned by iterator 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/IGNITE-12375?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 976308#comment-16976308 ]=20 Matija Polajnar commented on IGNITE-12375: ------------------------------------------ Thank you for this comment. We are considering moving away from using the r= elational (SQL) schema, and then we could also switch to TRANSACTIONAL atom= icity, if I understand the documentation correctly. Thus we could avoid thi= s problem in the future. If you know of any workaround in case this happens= until we finish that transition, even if it involves using reflection to t= inker with Ignite internals, please let me know. > Inconsistent persistent cache behaviour: containsKey returns false on a k= ey returned by iterator > -------------------------------------------------------------------------= ----------------------- > > Key: IGNITE-12375 > URL: https://issues.apache.org/jira/browse/IGNITE-12375 > Project: Ignite > Issue Type: Bug > Affects Versions: 2.7, 2.7.6 > Reporter: Matija Polajnar > Priority: Major > Attachments: ignite-bug.zip > > > On a fairly complex spring boot application using embedded Ignite persist= ent storage, we've managed (multiple times) to get into a situation where s= ome persistent caches start behaving weirdly.=C2=A0The symptoms are such: c= aches'=C2=A0{{iterator()}}=C2=A0method returns the elements we previously p= ut into caches as expected. {{size()}} also returns the expected value. But= {{containsKey(...)}} and {{get(...)}} return {{false}} and {{null}} respec= tively for some (or all) keys that are expected to be in the cache and are = even returned by the {{iterator()}}. > The problem never starts occurring mid-run, but always after cluster rest= arts; not at all always, and we suspect a necessary precondition is that ca= che configurations are slightly changed, like having modified QueryEntities= and such. We also suspect this only happens on single-node clusters, so it= might be related to=C2=A0IGNITE-12297, but the workaround that works for t= hat problem does not fix the problem described here. > The caches in question then cannot be repaired short of destroying and re= -creating them and re-importing data. > =C2=A0 > We tried and failed to reproduce the problem from scratch in a small demo= application. We managed, however, to grab a {{work}} directory from our ap= plication after corruption and then create a demo application with a minima= l set of classes needed to demonstrate the issue on reading (after corrupti= on is already present). > I'm attaching a zip file with the code (along with a maven pom.xml) and t= he corrupted work directory. You can directly execute the demo by issuing {= {mvn compile exec:java}}, which will execute the {{care.better.demo.igniteb= ug.BugApp}}=C2=A0class. In this class there's this method: > {code:java} > private static void replicateProblem(IgniteCache cach= e) { > int seen =3D 0; > Iterator> entryIterator =3D cache.ite= rator(); > while (entryIterator.hasNext()) { > Object key =3D entryIterator.next().getKey(); > if (!cache.containsKey(key) || cache.get(key) =3D=3D null) { > LOG.error("UNSEEN KEY: {}", key); > } else { > seen++; > } > } > LOG.info("Size {}, seen {}.", cache.size(), seen); > } > {code} > =C2=A0 > After execution you will note log records like this one: > {code} > ERROR care.better.demo.ignitebug.BugApp.replicateProblem - UNSEEN KEY: Qu= eueKey{affinityKey=3DPartyIdArg{namespace=3D'=D0=AD=D0=9C=D0=98=D0=90=D0=A1= =D0=9C=D0=B5=D0=B4=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BD=D0=B8=D0=BA=D0=B8',= id=3D'222'}, entryId=3Dc059b587-78d3-4c75-b64f-8575ae3d2318} > {code} > We had no success in trying to find any lead while debugging through Igni= te source code so we kindly ask your assistance in hunting down this bug an= d, until it is fixed, suggesting any possible work-around should this occur= in a production environment (it has not so far) where it is not practical = to dump all data from some cache into a file to be able to destroy, re-crea= te and re-import it. -- This message was sent by Atlassian Jira (v8.3.4#803005)