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 2022/05/10 21:19:02 UTC

[GitHub] [geode] nabarunnag commented on a diff in pull request #7670: [Don't review]: GEODE-10290: GII requester should remove departed members

nabarunnag commented on code in PR #7670:
URL: https://github.com/apache/geode/pull/7670#discussion_r869687159


##########
geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java:
##########
@@ -1052,19 +1052,23 @@ protected RegionVersionVector getRVVFromProvider(final ClusterDistributionManage
   /**
    * Compare the received RVV with local RVV and return a set of keys for unfinished operations.
    *
-   * @param remoteRVV RVV from provider
+   * @param remoteRVV RVV from provider to be filled with unfinished operations
    * @param localRVV RVV recovered from disk
+   * @param receivedRVV original RVV from provider to remove departed members
    * @return set for keys of unfinished operations.
    */
   protected Set<Object> processReceivedRVV(RegionVersionVector remoteRVV,
-      RegionVersionVector localRVV) {
+      RegionVersionVector localRVV, RegionVersionVector receivedRVV) {
     if (remoteRVV == null) {
       return null;
     }
     // calculate keys for unfinished ops
+    Set<VersionSource> foundIds = new HashSet<>();
+    foundIds.add(region.getVersionMember());
     HashSet<Object> keys = new HashSet<>();
-    if (region.getDataPolicy().withPersistence()
-        && localRVV.isNewerThanOrCanFillExceptionsFor(remoteRVV)) {
+    boolean isPersistentRegion = region.getDataPolicy().withPersistence();
+    if ((isPersistentRegion && localRVV.isNewerThanOrCanFillExceptionsFor(remoteRVV))
+        || !remoteRVV.getDepartedMembersSet().isEmpty()) {

Review Comment:
   It will hit the condition that Jianxia mentions below and the id may be added
   



##########
geode-core/src/main/java/org/apache/geode/internal/cache/InitialImageOperation.java:
##########
@@ -1052,19 +1052,23 @@ protected RegionVersionVector getRVVFromProvider(final ClusterDistributionManage
   /**
    * Compare the received RVV with local RVV and return a set of keys for unfinished operations.
    *
-   * @param remoteRVV RVV from provider
+   * @param remoteRVV RVV from provider to be filled with unfinished operations
    * @param localRVV RVV recovered from disk
+   * @param receivedRVV original RVV from provider to remove departed members
    * @return set for keys of unfinished operations.
    */
   protected Set<Object> processReceivedRVV(RegionVersionVector remoteRVV,
-      RegionVersionVector localRVV) {
+      RegionVersionVector localRVV, RegionVersionVector receivedRVV) {
     if (remoteRVV == null) {
       return null;
     }
     // calculate keys for unfinished ops
+    Set<VersionSource> foundIds = new HashSet<>();
+    foundIds.add(region.getVersionMember());
     HashSet<Object> keys = new HashSet<>();
-    if (region.getDataPolicy().withPersistence()
-        && localRVV.isNewerThanOrCanFillExceptionsFor(remoteRVV)) {
+    boolean isPersistentRegion = region.getDataPolicy().withPersistence();
+    if ((isPersistentRegion && localRVV.isNewerThanOrCanFillExceptionsFor(remoteRVV))
+        || !remoteRVV.getDepartedMembersSet().isEmpty()) {

Review Comment:
   Previously this blocked is accessed by only persistent region. But now it can be accessed by non-persistent region when the second condition is true.



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

To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org

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