}
/* Start syncing this node to the new group master */
masterStatus.sync();
/* Copy status to hold it stable against concurrent updates. */
MasterStatus status = (MasterStatus) masterStatus.clone();
if (status.isNodeMaster()) {
repImpl.getVLSNIndex().initAsMaster();
replica.masterTransitionCleanup();
try {
serviceDispatcher.register
(new GroupService(serviceDispatcher, this));
/* Master is ready for business. */
nodeState.changeAndNotify
(MASTER, status.getNodeMasterNameId());
feederManager.runFeeders();
} finally {
serviceDispatcher.cancel(GroupService.SERVICE_NAME);
}
} else {
nodeState.changeAndNotify
(REPLICA, status.getNodeMasterNameId());
replica.runReplicaLoop();
}
}
} catch (InterruptedException e) {
LoggerUtils.fine(logger, repImpl,