You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by mikezaccardo <gi...@git.apache.org> on 2015/11/24 02:30:01 UTC

[GitHub] incubator-brooklyn pull request: Ensure deterministic DynamicClust...

GitHub user mikezaccardo opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/1058

    Ensure deterministic DynamicCluster member removal order

    

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

    $ git pull https://github.com/mikezaccardo/incubator-brooklyn fix/dynamic-cluster-member-removal

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

    https://github.com/apache/incubator-brooklyn/pull/1058.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 #1058
    
----
commit 19be474cc784d5d20910686429d5519fe2de98e1
Author: Mike Zaccardo <mi...@cloudsoftcorp.com>
Date:   2015-11-24T01:29:38Z

    Ensure deterministic DynamicCluster member removal order

----


---
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] incubator-brooklyn pull request: Ensure deterministic DynamicClust...

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

    https://github.com/apache/incubator-brooklyn/pull/1058#discussion_r45702693
  
    --- Diff: core/src/main/java/org/apache/brooklyn/entity/group/DynamicClusterImpl.java ---
    @@ -139,18 +139,21 @@ public ZoneFailureDetector apply(final String input) {
     
         private static final Function<Collection<Entity>, Entity> defaultRemovalStrategy = new Function<Collection<Entity>, Entity>() {
             @Override public Entity apply(Collection<Entity> contenders) {
    -            // choose newest entity that is stoppable, or if none are stoppable take the newest non-stoppable
    -            long newestTime = 0;
    +            // choose last-added (largest cluster member ID) entity that is stoppable, or if none are stoppable take the newest non-stoppable
    +            int largestClusterMemberId = -1;
                 Entity newest = null;
     
                 for (Entity contender : contenders) {
    -                boolean newer = contender.getCreationTime() > newestTime;
    +                int contenderClusterMemberId = contender.config().get(CLUSTER_MEMBER_ID);
    --- End diff --
    
    I'd fall back to timestamps in case the member id is missing - for example when upgrading older installations.


---
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] incubator-brooklyn pull request: Ensure deterministic DynamicClust...

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

    https://github.com/apache/incubator-brooklyn/pull/1058


---
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] incubator-brooklyn pull request: Ensure deterministic DynamicClust...

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1058#issuecomment-159313857
  
    LGTM


---
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] incubator-brooklyn pull request: Ensure deterministic DynamicClust...

Posted by neykov <gi...@git.apache.org>.
Github user neykov commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1058#issuecomment-159314106
  
    This was haunting the CIs for quite some time, thanks for taking the time to fix.


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