You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by zh...@apache.org on 2020/02/28 00:44:47 UTC

[geode] branch feature/GEODE-7682 updated (471d8b4 -> f6516a7)

This is an automated email from the ASF dual-hosted git repository.

zhouxj pushed a change to branch feature/GEODE-7682
in repository https://gitbox.apache.org/repos/asf/geode.git.


 discard 471d8b4  fix-2
 discard 21dacaf  fix-3
 discard 17e2887  fix-2
     new f6516a7  fix-4

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (471d8b4)
            \
             N -- N -- N   refs/heads/feature/GEODE-7682 (f6516a7)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../cache/PartitionedRegionClearDUnitTest.java      | 18 ++++++------------
 .../internal/cache/DistributedCacheOperation.java   |  2 --
 .../geode/internal/cache/PartitionedRegion.java     | 21 +++++++--------------
 .../geode/internal/cache/RegionEventImpl.java       |  6 ++++++
 .../internal/cache/partitioned/ClearPRMessage.java  | 21 +++++++++++++--------
 5 files changed, 32 insertions(+), 36 deletions(-)


[geode] 01/01: fix-4

Posted by zh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zhouxj pushed a commit to branch feature/GEODE-7682
in repository https://gitbox.apache.org/repos/asf/geode.git

commit f6516a71cb69650cf6373d8809e121e526682a5d
Author: zhouxh <gz...@pivotal.io>
AuthorDate: Thu Feb 27 16:43:45 2020 -0800

    fix-4
---
 .../apache/geode/internal/cache/PartitionedRegion.java |  8 ++++++++
 .../apache/geode/internal/cache/RegionEventImpl.java   |  6 ++++++
 .../internal/cache/partitioned/ClearPRMessage.java     | 18 +++++++++++++-----
 3 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
index 2f30cf8..2a58cb6 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
@@ -2280,6 +2280,9 @@ public class PartitionedRegion extends LocalRegion
             result = response.waitForResult();
           }
         }
+        if (result) {
+          return;
+        }
       } catch (ForceReattemptException prce) {
         checkReadiness();
         InternalDistributedMember lastTarget = currentTarget;
@@ -2329,6 +2332,11 @@ public class PartitionedRegion extends LocalRegion
     ArrayList<ClearPRMessage> clearMsgList = new ArrayList<>();
     for (int bucketId = 0; bucketId < this.totalNumberOfBuckets; bucketId++) {
       ClearPRMessage clearPRMessage = new ClearPRMessage(bucketId);
+      BucketRegion bucketRegion = this.getDataStore().getLocalBucketById(bucketId);
+      RegionEventImpl bucketRegionEventImpl =
+          new RegionEventImpl(bucketRegion, Operation.REGION_CLEAR, null, false,
+              getMyId(), generateEventID());
+      clearPRMessage.setRegionEvent(bucketRegionEventImpl);
       clearMsgList.add(clearPRMessage);
     }
     return clearMsgList;
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/RegionEventImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/RegionEventImpl.java
index 402b7f2..6110636 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/RegionEventImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/RegionEventImpl.java
@@ -119,6 +119,12 @@ public class RegionEventImpl
     return region;
   }
 
+  public void setRegionIfAbsent(LocalRegion region) {
+    if (this.region == null) {
+      this.region = region;
+    }
+  }
+
   @Override
   public Operation getOperation() {
     return this.op;
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ClearPRMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ClearPRMessage.java
index 07bb311..fb2b5fb 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ClearPRMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/ClearPRMessage.java
@@ -58,7 +58,9 @@ public class ClearPRMessage extends PartitionMessageWithDirectReply {
 
   private Integer bucketId;
 
-  /** The time in ms to wait for a lock to be obtained during doLocalClear() */
+  /**
+   * The time in ms to wait for a lock to be obtained during doLocalClear()
+   */
   public static final int LOCK_WAIT_TIMEOUT_MS = 1000;
   public static final String BUCKET_NON_PRIMARY_MESSAGE =
       "The bucket region on target member is no longer primary";
@@ -115,8 +117,7 @@ public class ClearPRMessage extends PartitionMessageWithDirectReply {
 
   public ClearResponse send(DistributedMember recipient, PartitionedRegion region)
       throws ForceReattemptException {
-    Set<InternalDistributedMember> recipients =
-        Collections.singleton((InternalDistributedMember) recipient);
+    Set recipients = Collections.singleton(recipient);
     ClearResponse clearResponse = new ClearResponse(region.getSystem(), recipients);
     initMessage(region, recipients, clearResponse);
     if (logger.isDebugEnabled()) {
@@ -195,6 +196,7 @@ public class ClearPRMessage extends PartitionMessageWithDirectReply {
       throw new ForceReattemptException(BUCKET_NON_PRIMARY_MESSAGE);
     }
     try {
+      regionEvent.setRegionIfAbsent(bucketRegion);
       bucketRegion.cmnClearRegion(regionEvent, true, true);
     } catch (Exception ex) {
       throw new ForceReattemptException(
@@ -261,12 +263,16 @@ public class ClearPRMessage extends PartitionMessageWithDirectReply {
     appendFields(buff);
     buff.append(" ,distTx=");
     buff.append(this.isTransactionDistributed);
+    buff.append(",event=");
+    buff.append(regionEvent);
     buff.append(")");
     return buff.toString();
   }
 
   public static class ClearReplyMessage extends ReplyMessage {
-    /** Result of the Clear operation */
+    /**
+     * Result of the Clear operation
+     */
     boolean result;
 
     @Override
@@ -287,7 +293,9 @@ public class ClearPRMessage extends PartitionMessageWithDirectReply {
       setException(ex);
     }
 
-    /** Send an ack */
+    /**
+     * Send an ack
+     */
     public static void send(InternalDistributedMember recipient, int processorId,
         ReplySender replySender,
         boolean result, ReplyException ex) {