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/08 06:37:13 UTC

[GitHub] [geode] gesterzhou opened a new pull request #5354: Feature/geode 8334

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


   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] agingade commented on a change in pull request #5354: Feature/geode 8334

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



##########
File path: geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/PutAllPRMessageTest.java
##########
@@ -119,4 +122,34 @@ public void removeAndNotifyKeysIsNotInvokedIfKeysNotLocked() throws Exception {
         eq(regionDestroyedException));
   }
 
+  @Test
+  public void rvvLockedAfterKeysAreLockedAndUnlockRVVBeforeKeys() throws Exception {
+    PutAllPRMessage message = spy(new PutAllPRMessage(bucketId, 1, false, false, false, null));
+    message.addEntry(entryData);
+    doReturn(keys).when(message).getKeysToBeLocked();
+    when(bucketRegion.waitUntilLocked(keys)).thenReturn(true);
+    when(bucketRegion.doLockForPrimary(false)).thenThrow(new PrimaryBucketException());
+    doNothing().when(bucketRegion).lockRVVForBulkOp();
+    doNothing().when(bucketRegion).unlockRVVForBulkOp();
+
+    InternalCache cache = mock(InternalCache.class);
+    InternalDistributedSystem ids = mock(InternalDistributedSystem.class);
+    when(bucketRegion.getCache()).thenReturn(cache);
+    when(cache.getDistributedSystem()).thenReturn(ids);
+    when(ids.getOffHeapStore()).thenReturn(null);
+
+    try {
+      message.doLocalPutAll(partitionedRegion, mock(InternalDistributedMember.class), 1);
+      fail("Expect PrimaryBucketException");
+    } catch (Exception e) {
+      assertThat(e instanceof PrimaryBucketException);
+    }
+
+    InOrder inOrder = inOrder(bucketRegion);
+    inOrder.verify(bucketRegion).waitUntilLocked(keys);
+    inOrder.verify(bucketRegion).lockRVVForBulkOp();
+    inOrder.verify(bucketRegion).unlockRVVForBulkOp();

Review comment:
       We should verify that put is called while holding the lock.
   - lockRVV
   - r.getDataView().putEntryOnRemote
   - unlockRVV




----------------------------------------------------------------
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 closed pull request #5354: Feature/geode 8334

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


   


----------------------------------------------------------------
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 #5354: Feature/geode 8334

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



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveAllPRMessage.java
##########
@@ -532,6 +537,9 @@ public boolean doLocalRemoveAll(PartitionedRegion r, InternalDistributedMember e
         } catch (RegionDestroyedException e) {
           ds.checkRegionDestroyedOnBucket(bucketRegion, true, e);
         } finally {
+          if (rvvLocked) {
+            bucketRegion.unlockRVVForBulkOp();
+          }

Review comment:
       good idea




----------------------------------------------------------------
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] agingade commented on a change in pull request #5354: Feature/geode 8334

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



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java
##########
@@ -582,6 +579,9 @@ public void cmnClearRegion(RegionEventImpl regionEvent, boolean cacheWrite, bool
       if (!isLockedAlready) {
         obtainWriteLocksForClear(regionEvent, participants);
       }
+      if (enableRVV) {
+        rvv = getVersionVector().getCloneForTransmission();

Review comment:
       Why is this needed. In Partitioned Region all the operation happens first on Primary and then secondary. And in case clear; other operations are blocked till clear is finished or clear is blocked till other operations are completed on both primary secondary.
   By sending RVV; impacts the performance of clear operation; it will iterate one entry at a time and removes it.




----------------------------------------------------------------
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] mhansonp commented on a change in pull request #5354: Feature/geode 8334

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



##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RemoveAllPRMessage.java
##########
@@ -532,6 +537,9 @@ public boolean doLocalRemoveAll(PartitionedRegion r, InternalDistributedMember e
         } catch (RegionDestroyedException e) {
           ds.checkRegionDestroyedOnBucket(bucketRegion, true, e);
         } finally {
+          if (rvvLocked) {
+            bucketRegion.unlockRVVForBulkOp();
+          }

Review comment:
       Should you be setting rvvLocked to false?

##########
File path: geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PutAllPRMessage.java
##########
@@ -523,6 +528,9 @@ public boolean doLocalPutAll(PartitionedRegion r, InternalDistributedMember even
         } catch (RegionDestroyedException e) {
           ds.checkRegionDestroyedOnBucket(bucketRegion, true, e);
         } finally {
+          if (rvvLocked) {
+            bucketRegion.unlockRVVForBulkOp();
+          }

Review comment:
       should rvvLocked be set to false?




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