You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/07/01 19:20:30 UTC

[GitHub] [geode] Bill commented on a change in pull request #5334: GEODE-8240: Back-Port to 1.12

Bill commented on a change in pull request #5334:
URL: https://github.com/apache/geode/pull/5334#discussion_r448568318



##########
File path: geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/membership/GMSJoinLeaveJUnitTest.java
##########
@@ -1589,6 +1590,36 @@ public void testMulticastDiscoveryNotAllowed() {
     }
   }
 
+  // GEODE-8240 could cause this member's identifier to have the wrong version so patch it up
+  @Test
+  public void repairWrongVersionInView() throws Exception {
+
+    initMocks();
+
+    List<MemberIdentifier> viewmembers =
+        Arrays.asList(new MemberIdentifier[] {mockMembers[0], gmsJoinLeaveMemberId});
+
+    final GMSMembershipView<MemberIdentifier> viewWithWrongVersion =
+        new GMSMembershipView<>(mockMembers[0], 2, viewmembers);
+
+    // clone member ID
+    final MemberIdentifierImpl myMemberIDWithWrongVersion =
+        new MemberIdentifierImpl(gmsJoinLeaveMemberId.getMemberData());
+
+    // this test must live in the 1.12 and later lines so pick a pre-1.12 version
+    final Version oldVersion = Version.GEODE_1_11_0;
+    myMemberIDWithWrongVersion.setVersionObjectForTest(oldVersion);
+
+    viewWithWrongVersion.remove(gmsJoinLeaveMemberId);
+    viewWithWrongVersion.add(myMemberIDWithWrongVersion);
+
+    gmsJoinLeave.installView(viewWithWrongVersion);
+
+    assertThat(
+        gmsJoinLeave.getView().getCanonicalID(gmsJoinLeaveMemberId).getVersionOrdinalObject())
+            .isEqualTo(Version.getCurrentVersion());
+  }

Review comment:
       this is the new unit test for GEODE-8240




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org