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 [email protected] or file a JIRA ticket
with INFRA.
---