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 2021/03/31 22:29:16 UTC

[GitHub] [geode] gesterzhou opened a new pull request #6246: GEODE-9060: Remove the member from a copy of replicates as GII candid…

gesterzhou opened a new pull request #6246:
URL: https://github.com/apache/geode/pull/6246


   …ate if
   
   it's not part of the same distributed system, but leave original replicates
   unchanged.
   
   Thank you for submitting a contribution to Apache Geode.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [ ] Does `gradlew build` run cleanly?
   
   - [ ] Have you written or updated unit tests to verify your changes?
   
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   ### Note:
   Please ensure that once the PR is submitted, check Concourse for build issues and
   submit an update to your PR as soon as possible. If you need help, please send an
   email to dev@geode.apache.org.
   


-- 
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



[GitHub] [geode] dschneider-pivotal commented on a change in pull request #6246: GEODE-9060: Remove the member from a copy of replicates as GII candid…

Posted by GitBox <gi...@apache.org>.
dschneider-pivotal commented on a change in pull request #6246:
URL: https://github.com/apache/geode/pull/6246#discussion_r605821565



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PersistenceAdvisorImpl.java
##########
@@ -510,18 +510,18 @@ public PersistentMembershipView getMembershipView() {
   public boolean checkMyStateOnMembers(Set<InternalDistributedMember> replicates)
       throws ReplyException {
     PersistentStateQueryResults remoteStates = getMyStateOnMembers(replicates);
+    Set<InternalDistributedMember> copyOfReplicates = new HashSet<>(replicates);

Review comment:
       Instead of always having this code create a copy every time it is called, start the copyofReplicates out as null. Then, in the exceptional case when we need to remove from it (line 540), you can ask if it is null and then make it a copy of  replicates.




-- 
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



[GitHub] [geode] kirklund commented on a change in pull request #6246: GEODE-9060: Remove the member from a copy of replicates as GII candid…

Posted by GitBox <gi...@apache.org>.
kirklund commented on a change in pull request #6246:
URL: https://github.com/apache/geode/pull/6246#discussion_r605281830



##########
File path: geode-core/src/distributedTest/java/org/apache/geode/internal/cache/persistence/PersistentRecoveryOrderDUnitTest.java
##########
@@ -877,10 +877,42 @@ public void testSplitBrain() {
           createReplicateRegion(regionName, getDiskDirs(getVMId()));
         });
         assertThat(thrown).isInstanceOf(ConflictingPersistentDataException.class);
+        assertThat(thrown.getMessage())
+            .contains("was not part of the same distributed system as the local data");

Review comment:
       Typically you should just use `thrown` as the subject for the assertion rather than `thrown.getMessage()`:
   ```
   assertThat(thrown).hasMessageContaining("was not part of the same distributed system as the local data");
   ```
   That way you can chain together multiple details:
   ```
   assertThat(thrown)
       .isInstanceOf(ConflictingPersistentDataException.class)
       .hasMessageContaining("was not part of the same distributed system as the local data");
   ```
   ...and you could even check `hasCauseInstanceOf` or other options.

##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PersistenceAdvisorImpl.java
##########
@@ -510,18 +510,19 @@ public PersistentMembershipView getMembershipView() {
   public boolean checkMyStateOnMembers(Set<InternalDistributedMember> replicates)
       throws ReplyException {
     PersistentStateQueryResults remoteStates = getMyStateOnMembers(replicates);
+    Set<InternalDistributedMember> copyOfReplicates = new HashSet<>();
+    copyOfReplicates.addAll(replicates);

Review comment:
       You can shrink this down to one statement:
   ```
   Set<InternalDistributedMember> copyOfReplicates = new HashSet<>(replicates);
   ```




-- 
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



[GitHub] [geode] gesterzhou merged pull request #6246: GEODE-9060: Remove the member from a copy of replicates as GII candid…

Posted by GitBox <gi...@apache.org>.
gesterzhou merged pull request #6246:
URL: https://github.com/apache/geode/pull/6246


   


-- 
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



[GitHub] [geode] gesterzhou commented on a change in pull request #6246: GEODE-9060: Remove the member from a copy of replicates as GII candid…

Posted by GitBox <gi...@apache.org>.
gesterzhou commented on a change in pull request #6246:
URL: https://github.com/apache/geode/pull/6246#discussion_r605289584



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/persistence/PersistenceAdvisorImpl.java
##########
@@ -510,18 +510,19 @@ public PersistentMembershipView getMembershipView() {
   public boolean checkMyStateOnMembers(Set<InternalDistributedMember> replicates)
       throws ReplyException {
     PersistentStateQueryResults remoteStates = getMyStateOnMembers(replicates);
+    Set<InternalDistributedMember> copyOfReplicates = new HashSet<>();
+    copyOfReplicates.addAll(replicates);

Review comment:
       all fixed




-- 
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