You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by gesterzhou <gi...@git.apache.org> on 2017/06/08 21:59:54 UTC

[GitHub] geode pull request #570: GEODE-3055: waitUntilFlush should use data region's...

GitHub user gesterzhou opened a pull request:

    https://github.com/apache/geode/pull/570

    GEODE-3055: waitUntilFlush should use data region's bucketid list. So…

    @upthewaterspout @boglesby 
    
    …me of the buckets maybe not initialized, then wait for tempQueue to be empty.
    
    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, you check travis-ci 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.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/geode feature/GEM-1483

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/geode/pull/570.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #570
    
----
commit e07b513f3c564d9a4f6c69ca47fbddf70bb76563
Author: zhouxh <gz...@pivotal.io>
Date:   2017-06-08T21:52:56Z

    GEODE-3055: waitUntilFlush should use data region's bucketid list. Some of the buckets maybe not initialized, then wait for tempQueue to be empty.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] geode pull request #570: GEODE-3055: waitUntilFlush should use data region's...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/geode/pull/570


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] geode pull request #570: GEODE-3055: waitUntilFlush should use data region's...

Posted by boglesby <gi...@git.apache.org>.
Github user boglesby commented on a diff in the pull request:

    https://github.com/apache/geode/pull/570#discussion_r130937683
  
    --- Diff: geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java ---
    @@ -494,6 +494,18 @@ CreateBucketResult grabFreeBucket(final int possiblyFreeBucketId, final Distribu
     
           return result;
     
    +    } catch (RuntimeException validationException) {
    +      // GEODE-3055
    +      PartitionedRegion leader = ColocationHelper.getLeaderRegion(this.partitionedRegion);
    +      boolean isLeader = leader.equals(this.partitionedRegion);
    --- End diff --
    
    What if there is more than one colocated child region and one of the child buckets is successfully created, but the other is not. This code will remove the parent bucket. Will the one that was successfully created also get removed?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] geode pull request #570: GEODE-3055: waitUntilFlush should use data region's...

Posted by boglesby <gi...@git.apache.org>.
Github user boglesby commented on a diff in the pull request:

    https://github.com/apache/geode/pull/570#discussion_r130941287
  
    --- Diff: geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java ---
    @@ -494,6 +494,18 @@ CreateBucketResult grabFreeBucket(final int possiblyFreeBucketId, final Distribu
     
           return result;
     
    +    } catch (RuntimeException validationException) {
    +      // GEODE-3055
    +      PartitionedRegion leader = ColocationHelper.getLeaderRegion(this.partitionedRegion);
    +      boolean isLeader = leader.equals(this.partitionedRegion);
    --- End diff --
    
    Nice. Thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] geode issue #570: GEODE-3055: waitUntilFlush should use data region's bucket...

Posted by gesterzhou <gi...@git.apache.org>.
Github user gesterzhou commented on the issue:

    https://github.com/apache/geode/pull/570
  
    The forceRemovePrimary was useless and it can be removed because it always use "false".
    
    But when I added the logic to remove the leader region bucket (when the shadow bucket failed to initialize), I have to call the removeBucket(xxx, forceRemovePrimary=true) by myself.
    
    When removing leader bucket in the error handling, I have to skip a few "return false" exit points, because at this time the leader bucket is not logically ready and not qualified to be removed unless I force to remove it.
    
    So I make use of the forceRemovePrimary parameter. Maybe I should change it to better name, such as forceToRemove, though. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] geode pull request #570: GEODE-3055: waitUntilFlush should use data region's...

Posted by gesterzhou <gi...@git.apache.org>.
Github user gesterzhou commented on a diff in the pull request:

    https://github.com/apache/geode/pull/570#discussion_r130729615
  
    --- Diff: geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java ---
    @@ -1472,6 +1472,19 @@ public boolean removeBucket(int bucketId, boolean forceRemovePrimary) {
           }
     
           BucketAdvisor bucketAdvisor = bucketRegion.getBucketAdvisor();
    +      InternalDistributedMember primary = bucketAdvisor.getPrimary();
    +      InternalDistributedMember myId =
    +          this.partitionedRegion.getDistributionManager().getDistributionManagerId();
    +      if (primary == null || myId.equals(primary)) {
    --- End diff --
    
    The forceRemovePrimary WAS useless and it can be removed because it always use "false".
    
    But when I added the logic to remove the leader region bucket (when the shadow bucket failed to initialize), then I have to call the removeBucket(xxx, true) by myself. 
    
    The shadow bucket was removed first by the exception handling. But I added the logic to remove leader bucket, I have to skip a few "return false" exit points, because at this time the leader bucket is not logically ready and not qualified to be removed unless I force to remove it. 
    
    So I make use of the forceRemovePrimary parameter. Maybe I should change it to better name, such as forceToRemove.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] geode pull request #570: GEODE-3055: waitUntilFlush should use data region's...

Posted by upthewaterspout <gi...@git.apache.org>.
Github user upthewaterspout commented on a diff in the pull request:

    https://github.com/apache/geode/pull/570#discussion_r122085382
  
    --- Diff: geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java ---
    @@ -1472,6 +1472,19 @@ public boolean removeBucket(int bucketId, boolean forceRemovePrimary) {
           }
     
           BucketAdvisor bucketAdvisor = bucketRegion.getBucketAdvisor();
    +      InternalDistributedMember primary = bucketAdvisor.getPrimary();
    +      InternalDistributedMember myId =
    +          this.partitionedRegion.getDistributionManager().getDistributionManagerId();
    +      if (primary == null || myId.equals(primary)) {
    --- End diff --
    
    This seems similar to the logic a few lines down where we say "if (!forceRemovePrimary && bucketAdvisor.isPrimary()) {..."
    
    Unlike that line, your new logic doesn't honor the forceRemovePrimary flag. Should it? I don't actually see any cases where that is passed in as true, so maybe we should just remove that flag?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] geode pull request #570: GEODE-3055: waitUntilFlush should use data region's...

Posted by gesterzhou <gi...@git.apache.org>.
Github user gesterzhou commented on a diff in the pull request:

    https://github.com/apache/geode/pull/570#discussion_r130938862
  
    --- Diff: geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java ---
    @@ -494,6 +494,18 @@ CreateBucketResult grabFreeBucket(final int possiblyFreeBucketId, final Distribu
     
           return result;
     
    +    } catch (RuntimeException validationException) {
    +      // GEODE-3055
    +      PartitionedRegion leader = ColocationHelper.getLeaderRegion(this.partitionedRegion);
    +      boolean isLeader = leader.equals(this.partitionedRegion);
    --- End diff --
    
    Remove the leader will remove all its children. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---