log message fixes in DeviceManager
Change-Id: Ia07cfa936d171a31c619e1ee13d6df5f80d7e629
diff --git a/core/net/src/main/java/org/onlab/onos/net/device/impl/DeviceManager.java b/core/net/src/main/java/org/onlab/onos/net/device/impl/DeviceManager.java
index 33200b9..32ab007 100644
--- a/core/net/src/main/java/org/onlab/onos/net/device/impl/DeviceManager.java
+++ b/core/net/src/main/java/org/onlab/onos/net/device/impl/DeviceManager.java
@@ -259,9 +259,13 @@
final NodeId myNodeId = clusterService.getLocalNode().id();
if (!myNodeId.equals(term.master())) {
// lost mastership after requestRole told this instance was MASTER.
- log.info("lost mastership before getting term info.");
+ log.info("Role of this node is STANDBY for {}", deviceId);
+ // TODO: Do we need to explicitly tell the Provider that
+ // this instance is no longer the MASTER?
+ //applyRole(deviceId, MastershipRole.STANDBY);
return;
}
+ log.info("Role of this node is MASTER for {}", deviceId);
// tell clock provider if this instance is the master
deviceClockProviderService.setMastershipTerm(deviceId, term);
@@ -295,6 +299,7 @@
checkNotNull(deviceId, DEVICE_ID_NULL);
checkValidity();
+ log.info("Device {} disconnected from this node", deviceId);
DeviceEvent event = null;
try {
@@ -318,18 +323,18 @@
final NodeId myNodeId = clusterService.getLocalNode().id();
// TODO: Move this type of check inside device clock manager, etc.
if (myNodeId.equals(term.master())) {
- log.info("Marking {} offline", deviceId);
+ log.info("Retry marking {} offline", deviceId);
deviceClockProviderService.setMastershipTerm(deviceId, term);
event = store.markOffline(deviceId);
} else {
- log.error("Failed again marking {} offline. {}", deviceId, role);
+ log.info("Failed again marking {} offline. {}", deviceId, role);
}
} finally {
//relinquish master role and ability to be backup.
mastershipService.relinquishMastership(deviceId);
if (event != null) {
- log.info("Device {} disconnected", deviceId);
+ log.info("Device {} disconnected from cluster", deviceId);
post(event);
}
}