Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D4B7A200C7E for ; Tue, 23 May 2017 20:54:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D355B160BC3; Tue, 23 May 2017 18:54:38 +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 F26C6160BA4 for ; Tue, 23 May 2017 20:54:37 +0200 (CEST) Received: (qmail 61386 invoked by uid 500); 23 May 2017 18:54:37 -0000 Mailing-List: contact dev-help@geode.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.apache.org Delivered-To: mailing list dev@geode.apache.org Received: (qmail 61374 invoked by uid 99); 23 May 2017 18:54:36 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 May 2017 18:54:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 7CB701AFCA5 for ; Tue, 23 May 2017 18:54:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.38 X-Spam-Level: ** X-Spam-Status: No, score=2.38 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id tLqjQ6X2ITT7 for ; Tue, 23 May 2017 18:54:34 +0000 (UTC) Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.161.174]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id C04115F23E for ; Tue, 23 May 2017 18:54:33 +0000 (UTC) Received: by mail-yw0-f174.google.com with SMTP id l74so79098404ywe.2 for ; Tue, 23 May 2017 11:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=hjyDl4ImHI4Ur2+2leDsGeamUzcp0HAIW+nC6aAVgEM=; b=rGHrM66D1cQL2CCmdZDisrwPui3FfIgn1LMyHAMNlZ/QuTiKpQYdMXVa0PwUaKBv6D nP2KJD4lmjyjiskgF9LV1rgyWi0Hgd1iWBKb5OyuKeK0jh76/Z+2CPRZFefl376IRUMl IkIYzfCZQ0at7l8q8ClDR3BpLf2JoRGGv1A6lTduBryP9OVlKh2MGUqz7GS5eS0u87pP 689RUXiFZ2TKHc3ToAQWencssl/o4PSDOWu6tmHRrQmrfFtY9Druz9YjV+r4fHt6xB9q WIsZ2gKuDqReKo+nIAqfctLDsAVclub2recAzoJIZR1KMycp4EThwjQI0lRRCGvymkBA ZOmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=hjyDl4ImHI4Ur2+2leDsGeamUzcp0HAIW+nC6aAVgEM=; b=GFwU545XDA5BzlXaganIGqbENdh2QHjXI4FDTR1PepNBkV9EtFkYWGR14XQRftW6B8 bWM/Q+rIHscKwqLCIhZ+3WEwHmXeqoii67+1zRGiJ4XhNIsfQNLlZK6eQI/LEkRkP+ka q4KC3fqpJrgTK3Ha7AwcJTZZO2VVqpSUC4P0Fn16VmiRBF/dKmJF0BgVdvwjig+QfvGz 8vEmvddc+qrAo511eEGRZ+nJ+Y4vQXAY4hg/Y0UnD8qAwFCpOomno+itdZrMXXIDazZO u3LqzAxLssoRdFZ3m1/Xm9xJp4HxZDHPfMv87E0n7J1uijInOovJ3TNC9byq756HV+Eu gBaA== X-Gm-Message-State: AODbwcA6aipZESZ3kiVZlKCP8JdAlfAJppCWOerah/1G0BxbEo3j6p4C STMnaEVuSsLYIt9luRrj50kLlX7NNg== X-Received: by 10.129.53.143 with SMTP id c137mr26262739ywa.14.1495565667210; Tue, 23 May 2017 11:54:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.38.197 with HTTP; Tue, 23 May 2017 11:54:26 -0700 (PDT) In-Reply-To: References: From: Suranjan Kumar Date: Wed, 24 May 2017 00:24:26 +0530 Message-ID: Subject: Re: Issues due to Special exceptions in RVV To: dev@geode.apache.org Content-Type: multipart/alternative; boundary="001a1142263a554694055035848d" archived-at: Tue, 23 May 2017 18:54:39 -0000 --001a1142263a554694055035848d Content-Type: text/plain; charset="UTF-8" Hi Darrel, Actually, I reproduced the issue in unit test that was seen in one of the runs and initializeVersionHolder doesn't fix the issue. The initializeFrom is used to initialize a member's RVV from a GII provider. It turns out if a member has already recorded higher version then while initializing a version holder from a member with lower version, we introduce an special exception. But in future when new versions are recorded by the same member, the special exception is not handled properly and that leads to version holder data structure corruption leading to holder#contains(version) error. In fact, I see that in this case an exception can remain permanently in the version holder even though the version has been recorded. I have a fix, which I will send for review soon. However, I just wanted to understand the issue and why it is not caught in delta GII. Moreover, if you look at the method initializeFrom, then already recorded versions are ignored? Isn't that an issue? If not then why? I will file a JIRA if you suggest. On Tue, May 23, 2017 at 10:49 PM, Darrel Schneider wrote: > I see that this test directly calls initializeFrom but the product never > does this. > The product always calls it through this method: > > org.apache.geode.internal.cache.versions.RegionVersionVector. > initializeVersionHolder(T, > RegionVersionHolder) > > I can see that initializeVersionHolder checks a memberToVersion map and on > a miss does not call initializeFrom but instead add the new member's RVV to > the memberToVersion map. Have you considered if calling > initializeVersionHolder would fix the issues you are seeing? > > > On Tue, May 23, 2017 at 10:04 AM, Darrel Schneider > wrote: > > > I made these modifications and the following compiles, runs, and fails on > > geode. > > I added the following to RegionVersionVectorJUnitTest: > > @Test > > public void testInitialized() { > > > > RegionVersionHolder vh1 = new RegionVersionHolder<>("vh1"); > > vh1.recordVersion(56); > > vh1.recordVersion(57); > > vh1.recordVersion(58); > > vh1.recordVersion(59); > > vh1.recordVersion(60); > > assertTrue(vh1.contains(57)); > > vh1 = vh1.clone(); > > assertTrue(vh1.contains(57)); > > System.out.println("This node init, vh1="+vh1); > > > > RegionVersionHolder vh2 = new RegionVersionHolder<>("vh2"); > > for(int i=1;i<57;i++) { > > vh2.recordVersion(i); > > } > > vh2 = vh2.clone(); > > System.out.println("GII node init, vh2="+vh2); > > > > vh1.initializeFrom(vh2); > > // assertTrue(vh1.contains(57)); // fails > > vh1 = vh1.clone(); > > System.out.println("After initialize, vh1="+vh1); > > > > vh1.recordVersion(58); > > vh1.recordVersion(59); > > vh1.recordVersion(60); > > > > System.out.println("After initialize and record version, vh1="+vh1); > > > > vh1 = vh1.clone(); > > vh1.recordVersion(57); > > System.out.println("After initialize and record version after clone, > > vh1="+vh1); > > > > assertTrue(vh1.contains(57)); //FAILS > > } > > > > > > On Tue, May 23, 2017 at 9:37 AM, Kirk Lund wrote: > > > >> Are you sure you're using Geode? The signature of > >> RegionVersionHolder#recordVersion > >> in Geode is: > >> > >> RegionVersionHolder#recordVersion(long) > >> > >> I recommend checking out develop branch of Geode, write a test to > confirm > >> your bug and then submit that test with a Jira ticket. > >> > >> On Tue, May 23, 2017 at 7:10 AM, Suranjan Kumar < > suranjan.kumar@gmail.com > >> > > >> wrote: > >> > >> > Hi Bruce/Dan, > >> > > >> > #1. I see some issues due to introduction of special exceptions in > the > >> > RegionVersionHolder. In some cases, it is leading to > RegionVersionHolder > >> > data structure corruption causing wrong contains(version) results. > >> > > >> > This happens because we set the version to max of currentVersion or > >> newly > >> > recorded one. But do not try to fix the special exception present if > >> any. > >> > > >> > It is easily reproducible even in junit tests. > >> > The corruption of holder data stricture causes even future record > >> operation > >> > to fail. > >> > For example the following test fails: > >> > > >> > public void testInitialized() { > >> > > >> > RegionVersionHolder vh1 = new RegionVersionHolder(member); > >> > vh1.recordVersion(56, null); > >> > vh1.recordVersion(57, null); > >> > vh1.recordVersion(58, null); > >> > vh1.recordVersion(59, null); > >> > vh1.recordVersion(60, null); > >> > vh1 = vh1.clone(); > >> > System.out.println("This node init, vh1="+vh1); > >> > > >> > RegionVersionHolder vh2 = new RegionVersionHolder(member); > >> > for(int i=1;i<57;i++) { > >> > vh2.recordVersion(i,null); > >> > } > >> > vh2 = vh2.clone(); > >> > System.out.println("GII node init, vh2="+vh2); > >> > > >> > vh1.initializeFrom(vh2); > >> > vh1 = vh1.clone(); > >> > System.out.println("After initialize, vh1="+vh1); > >> > > >> > > >> > vh1.recordVersion(58,null); > >> > vh1.recordVersion(59,null); > >> > vh1.recordVersion(60,null); > >> > > >> > System.out.println("After initialize and record version, vh1="+vh1); > >> > > >> > vh1 = vh1.clone(); > >> > vh1.recordVersion(57,null); > >> > System.out.println("After initialize and record version after clone, > >> > vh1="+vh1); > >> > > >> > assertTrue(vh1.contains(57)); //FAILS > >> > } > >> > > >> > > >> > #2. I have observed that > >> > RegionVersionHolder#initializeFrom(RegionVersionHolder source) > >> > doesn't not record already recorded version in itself contrary to what > >> > the comment above the method claims. In fact the junit tests also > >> > verifies the same so I couldn't understand the rationale behind it. It > >> > just adds an special exception if any higher version was already > >> > recorded by self. > >> > Shouldn't the resulting holder after initializing from a source > >> > contain records for both the holders? If not then why do we even need > >> > special exception. > >> > > >> > If possible could you please let me know your thoughts on this. > >> > > >> > Regards, > >> > Suranjan Kumar > >> > > >> > > > > > --001a1142263a554694055035848d--