Repository: trafodion Updated Branches: refs/heads/master 33325b65c -> 6185132a8
TRAFODION-2877 restart DCSServer when switch to backup-master Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/25959982 Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/25959982 Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/25959982 Branch: refs/heads/master Commit: 2595998299e1a6bb281544e00faab1f7c7ceddda Parents: 6be0b22 Author: aven <[email protected]> Authored: Thu Jan 4 18:15:54 2018 +0800 Committer: aven <[email protected]> Committed: Thu Jan 4 18:15:54 2018 +0800 ---------------------------------------------------------------------- .../org/trafodion/dcs/master/ServerManager.java | 21 ++++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafodion/blob/25959982/dcs/src/main/java/org/trafodion/dcs/master/ServerManager.java ---------------------------------------------------------------------- diff --git a/dcs/src/main/java/org/trafodion/dcs/master/ServerManager.java b/dcs/src/main/java/org/trafodion/dcs/master/ServerManager.java index 8594c36..a9407f9 100644 --- a/dcs/src/main/java/org/trafodion/dcs/master/ServerManager.java +++ b/dcs/src/main/java/org/trafodion/dcs/master/ServerManager.java @@ -176,8 +176,8 @@ public class ServerManager implements Callable { // But, if we are DcsMaster follower that is taking over from // failed one then ignore timestamp issues described above. // See MasterLeaderElection.elect() - if ((master.isFollower() == false) - && (serverStartTimestamp > startupTimestamp)) { + if ((master.isFollower() == false && serverStartTimestamp > startupTimestamp) + || (master.isFollower() && runningServers.size() < configuredServers.size())) { scriptContext.setHostName(hostName); scriptContext .setScriptName(Constants.SYS_SHELL_SCRIPT_NAME); @@ -240,15 +240,14 @@ public class ServerManager implements Callable { } } } else { - if (LOG.isDebugEnabled()) - LOG.debug("No restart for " - + znodePath - + "\nbecause DcsServer start time [" - + DateFormat.getDateTimeInstance().format( - new Date(serverStartTimestamp)) - + "] was before DcsMaster start time [" - + DateFormat.getDateTimeInstance().format( - new Date(startupTimestamp)) + "]"); + LOG.info("No restart for " + + znodePath + + "\nbecause DcsServer start time [" + + DateFormat.getDateTimeInstance().format( + new Date(serverStartTimestamp)) + + "] was before DcsMaster start time [" + + DateFormat.getDateTimeInstance().format( + new Date(startupTimestamp)) + "]"); } } catch (Exception e) { e.printStackTrace();
