-
Notifications
You must be signed in to change notification settings - Fork 684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GEODE-7678: Support for cache-listener and client-notification for Partitioned Region Clear operation. #4987
Conversation
Co-authored-by: Xiaojian Zhou <gzhou@pivotal.io> GEODE-7684: Create messaging class for PR Clear (apache#4689) * Added new message class and test Co-authored-by: Benjamin Ross <bross@pivotal.io> Co-authored-by: Donal Evans <doevans@pivotal.io>
* GEODE-7683: introduce BR.cmnClearRegion Co-authored-by: Xiaojian Zhou <gzhou@pivotal.io>
* GEODE-7857: PR.clear's event id should be created and used in BR
Co-authored-by: Anil <agingade@pivotal.io> Co-authored-by: Xiaojian Zhou <gzhou@pivotal.io>
Added distributed tests to verify the clear operation on Partitioned Regions works as expected when expiration is configured. - Added unit and distributed tests. - Fixed LocalRegion class to clear the entryExpiryTasks Map whenever the cancelAllEntryExpiryTasks method is invoked.
…r PR clear The changes are made to PR clear messaging and locking mechanism to preserve cache-listener and client-events ordering during concurrent cache operation while clear in progress.
This pull request introduces 1 alert when merging 90928f3 into e87b3b7 - view on LGTM.com new alerts:
|
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegion.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegion.java
Outdated
Show resolved
Hide resolved
Add check for client interests with local filter.
This pull request introduces 1 alert when merging 65cdf02 into e87b3b7 - view on LGTM.com new alerts:
|
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegion.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegion.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegion.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegion.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegion.java
Outdated
Show resolved
Hide resolved
Added wait for secondary buckets to become primary.
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegion.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly just some code cleanup and typos, but I have a couple of questions inline as well.
geode-core/src/distributedTest/java/org/apache/geode/cache/PRCacheListenerDistributedTest.java
Outdated
Show resolved
Hide resolved
...e/src/distributedTest/java/org/apache/geode/cache/ReplicateCacheListenerDistributedTest.java
Show resolved
Hide resolved
...t/java/org/apache/geode/internal/cache/PartitionedRegionAfterClearNotificationDUnitTest.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/BucketRegion.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegion.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegion.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegionMessage.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegionMessage.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegionMessage.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegionMessage.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java
Outdated
Show resolved
Hide resolved
geode-core/src/distributedTest/java/org/apache/geode/cache/PRCacheListenerDistributedTest.java
Outdated
Show resolved
Hide resolved
...e/src/distributedTest/java/org/apache/geode/cache/ReplicateCacheListenerDistributedTest.java
Show resolved
Hide resolved
...t/java/org/apache/geode/internal/cache/PartitionedRegionAfterClearNotificationDUnitTest.java
Outdated
Show resolved
Hide resolved
...t/java/org/apache/geode/internal/cache/PartitionedRegionAfterClearNotificationDUnitTest.java
Outdated
Show resolved
Hide resolved
...t/java/org/apache/geode/internal/cache/PartitionedRegionAfterClearNotificationDUnitTest.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegion.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/ClearPartitionedRegion.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/InternalRegion.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java
Outdated
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RegionAdvisor.java
Outdated
Show resolved
Hide resolved
Add PartitionedRegionPartialClearException.java Add check to verify primary buckets are available for all the local secondary buckets before clear.
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionClear.java
Show resolved
Hide resolved
geode-core/src/main/java/org/apache/geode/internal/cache/InternalRegion.java
Show resolved
Hide resolved
Add validation to check the buckets cleared after clear completed on all nodes. Throw CacheWriterException during netSearch timeout failure with cache write.
geode-core/src/main/java/org/apache/geode/cache/PartitionedRegionPartialClearException.java
Show resolved
Hide resolved
...Test/java/org/apache/geode/internal/cache/PartitionedRegionClearWithExpirationDUnitTest.java
Show resolved
Hide resolved
62858e2
to
56679c6
Compare
...t/java/org/apache/geode/internal/cache/PartitionedRegionAfterClearNotificationDUnitTest.java
Show resolved
Hide resolved
geode-core/src/distributedTest/java/org/apache/geode/cache/PRCacheListenerDistributedTest.java
Outdated
Show resolved
Hide resolved
geode-core/src/distributedTest/java/org/apache/geode/cache/PRCacheListenerDistributedTest.java
Outdated
Show resolved
Hide resolved
geode-core/src/distributedTest/java/org/apache/geode/cache/PRCacheListenerDistributedTest.java
Outdated
Show resolved
Hide resolved
...e/src/distributedTest/java/org/apache/geode/cache/ReplicateCacheListenerDistributedTest.java
Show resolved
Hide resolved
...e/src/distributedTest/java/org/apache/geode/cache/ReplicateCacheListenerDistributedTest.java
Show resolved
Hide resolved
...t/java/org/apache/geode/internal/cache/PartitionedRegionAfterClearNotificationDUnitTest.java
Outdated
Show resolved
Hide resolved
...t/java/org/apache/geode/internal/cache/PartitionedRegionAfterClearNotificationDUnitTest.java
Outdated
Show resolved
Hide resolved
...t/java/org/apache/geode/internal/cache/PartitionedRegionAfterClearNotificationDUnitTest.java
Show resolved
Hide resolved
...utedTest/java/org/apache/geode/internal/cache/PartitionedRegionPersistentClearDUnitTest.java
Outdated
Show resolved
Hide resolved
...t/java/org/apache/geode/internal/cache/PartitionedRegionAfterClearNotificationDUnitTest.java
Show resolved
Hide resolved
RegionShortcut shortcut = getRegionShortCut(); | ||
if (shortcut.isPersistent()) { | ||
if (shortcut == RegionShortcut.PARTITION_PERSISTENT) { | ||
shortcut = RegionShortcut.PARTITION; | ||
} else if (shortcut == RegionShortcut.PARTITION_PERSISTENT_OVERFLOW) { | ||
shortcut = RegionShortcut.PARTITION_OVERFLOW; | ||
} else if (shortcut == RegionShortcut.PARTITION_REDUNDANT_PERSISTENT) { | ||
shortcut = RegionShortcut.PARTITION_REDUNDANT; | ||
} else if (shortcut == RegionShortcut.PARTITION_REDUNDANT_PERSISTENT_OVERFLOW) { | ||
shortcut = RegionShortcut.PARTITION_REDUNDANT_OVERFLOW; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this test, RegionShortcut
is always PARTITION_REDUNDANT
so this check is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch :)
...rc/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionClearDUnitTest.java
Outdated
Show resolved
Hide resolved
...rc/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionClearDUnitTest.java
Outdated
Show resolved
Hide resolved
...t/java/org/apache/geode/internal/cache/PartitionedRegionAfterClearNotificationDUnitTest.java
Show resolved
Hide resolved
// TODO: notify register clients | ||
// client2.invoke(()->verifyRegionSize(true, expectedNum)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these comments be removed?
@Test(expected = UnsupportedOperationException.class) | ||
public void localClearIsNotSupportedOnReplicatedRegion() { | ||
RegionEventImpl event = createClearRegionEvent(); | ||
DistributedRegion region = (DistributedRegion) event.getRegion(); | ||
region.basicLocalClear(event); | ||
fail("Expect UnsupportedOperationException"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this test instead assert that the UnsupportedOperationException
is thrown from the basicLocalClear()
call, rather than using an expected exception?
@Override | ||
public void clear() { | ||
throw new UnsupportedOperationException(); | ||
/* @Override */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this commented out section be removed?
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionClear.java
Show resolved
Hide resolved
This pull request introduces 122 alerts and fixes 2 when merging 17f3903 into 81102ce - view on LGTM.com new alerts:
fixed alerts:
|
The changes are made to PR clear messaging and locking mechanism to preserve
cache-listener and client-events ordering during concurrent cache operation
while clear in progress.
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:
[Y] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
[Y] Has your PR been rebased against the latest commit within the target branch (typically
develop
)?[Y] Is your initial contribution a single, squashed commit?
[Y] Does
gradlew build
run cleanly?[Y] Have you written or updated unit tests to verify your changes?
[NA] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
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.