brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: HA uses shared timestamp (last mo...
Date Thu, 26 Jun 2014 11:20:41 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/12#discussion_r14235192
  
    --- Diff: core/src/main/java/brooklyn/management/ha/HighAvailabilityManagerImpl.java ---
    @@ -384,24 +418,39 @@ protected void checkMaster(boolean initializing) {
                 return;
             }
             
    +        if (demotingSelfInFavourOfOtherMaster) {
    +            LOG.debug("Master-change for this node only, demoting "+ownNodeMemento.toVerboseString()+"
in favour of official master "+newMasterRecord);
    +            demoteToStandby();
    +            return;
    +        }
    +        
             // Need to choose a new master
    -        ManagementNodeSyncRecord newMasterRecord = masterChooser.choose(memento, heartbeatTimeout,
ownNodeId, now);
    +        newMasterRecord = masterChooser.choose(memento, heartbeatTimeout, ownNodeId);
    +        
             String newMasterNodeId = (newMasterRecord == null) ? null : newMasterRecord.getNodeId();
             URI newMasterNodeUri = (newMasterRecord == null) ? null : newMasterRecord.getUri();
             boolean newMasterIsSelf = ownNodeId.equals(newMasterNodeId);
             
    -        LOG.debug("Management node master-promotion required: newMaster={}; oldMaster={};
plane={}, self={}; heartbeatTimeout={}", 
    -            new Object[] {
    -            (newMasterRecord == null ? "<none>" : newMasterRecord.toVerboseString()),
    -            (masterNodeMemento == null ? masterNodeId+" (no memento)": masterNodeMemento.toVerboseString()),
    -            memento,
    -            ownNodeMemento.toVerboseString(), 
    -            heartbeatTimeout
    -        });
    +        if (LOG.isDebugEnabled()) {
    +            LOG.debug("Management node master-change required: newMaster={}; oldMaster={};
plane={}, self={}; heartbeatTimeout={}", 
    +                new Object[] {
    +                    (newMasterRecord == null ? "<none>" : newMasterRecord.toVerboseString()),
    +                    (masterNodeMemento == null ? masterNodeId+" (no memento)": masterNodeMemento.toVerboseString()),
    +                    memento,
    +                    ownNodeMemento.toVerboseString(), 
    +                    heartbeatTimeout
    +                });
    +        }
             if (!initializing) {
    -            LOG.warn("HA subsystem detected change of master from "+masterNodeId+" to
"
    -                + (newMasterNodeId == null ? "<unknown>" : 
    -                    newMasterNodeId + (newMasterNodeUri!=null ? " "+newMasterNodeUri
: "")));
    +            if (!demotingSelfInFavourOfOtherMaster) {
    --- End diff --
    
    should have returned above if `demotingSelfInFavourOfOtherMaster`, but no harm checking
again.


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

Mime
View raw message