Skip to content
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

Closed
wants to merge 20 commits into from

Conversation

agingade
Copy link

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.

gesterzhou and others added 7 commits March 16, 2020 14:36
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.
@lgtm-com
Copy link

lgtm-com bot commented Apr 22, 2020

This pull request introduces 1 alert when merging 90928f3 into e87b3b7 - view on LGTM.com

new alerts:

  • 1 for Non-synchronized override of synchronized method

Add check for client interests with local filter.
@lgtm-com
Copy link

lgtm-com bot commented Apr 23, 2020

This pull request introduces 1 alert when merging 65cdf02 into e87b3b7 - view on LGTM.com

new alerts:

  • 1 for Non-synchronized override of synchronized method

Added wait for secondary buckets to become primary.
Copy link
Contributor

@DonalEvans DonalEvans left a 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.

anilkumar gingade added 2 commits April 29, 2020 19:19
Add PartitionedRegionPartialClearException.java
Add check to verify primary buckets are available for all the local secondary buckets before clear.
anilkumar gingade added 3 commits May 3, 2020 16:08
Add validation to check the buckets cleared after clear completed on all nodes.
Throw CacheWriterException during netSearch timeout failure with cache write.
Comment on lines +132 to +143
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;
}
}
Copy link
Contributor

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch :)

Comment on lines 158 to 159
// TODO: notify register clients
// client2.invoke(()->verifyRegionSize(true, expectedNum));
Copy link
Contributor

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?

Comment on lines 259 to 265
@Test(expected = UnsupportedOperationException.class)
public void localClearIsNotSupportedOnReplicatedRegion() {
RegionEventImpl event = createClearRegionEvent();
DistributedRegion region = (DistributedRegion) event.getRegion();
region.basicLocalClear(event);
fail("Expect UnsupportedOperationException");
}
Copy link
Contributor

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 */
Copy link
Contributor

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?

@lgtm-com
Copy link

lgtm-com bot commented May 15, 2020

This pull request introduces 122 alerts and fixes 2 when merging 17f3903 into 81102ce - view on LGTM.com

new alerts:

  • 49 for Useless null check
  • 29 for Missing space in string literal
  • 19 for Non-synchronized override of synchronized method
  • 4 for Implicit conversion from array to string
  • 3 for Equals method does not inspect argument type
  • 3 for Dereferenced variable may be null
  • 3 for Implicit narrowing conversion in compound assignment
  • 2 for Container contents are never accessed
  • 2 for Result of multiplication cast to wider type
  • 2 for Potential database resource leak
  • 2 for Spurious Javadoc @param tags
  • 1 for Information exposure through a stack trace
  • 1 for Potential output resource leak
  • 1 for Boxed variable is never null
  • 1 for Race condition in double-checked locking object initialization

fixed alerts:

  • 1 for Useless null check
  • 1 for Disabled Spring CSRF protection

@mhansonp mhansonp closed this May 15, 2020
@mhansonp mhansonp reopened this May 15, 2020
@agingade agingade closed this May 27, 2020
@agingade agingade deleted the feature/GEODE-7678 branch May 27, 2020 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants