Ayaka Koshibe

minor role relinquishment fix

Change-Id: I8fb2d65795b6bba6c0838c5efcf17d6f6528ea65
...@@ -99,8 +99,8 @@ implements MastershipService, MastershipAdminService { ...@@ -99,8 +99,8 @@ implements MastershipService, MastershipAdminService {
99 @Override 99 @Override
100 public void relinquishMastership(DeviceId deviceId) { 100 public void relinquishMastership(DeviceId deviceId) {
101 MastershipEvent event = null; 101 MastershipEvent event = null;
102 - event = store.relinquishRole( 102 + event = store.relinquishRole(
103 - clusterService.getLocalNode().id(), deviceId); 103 + clusterService.getLocalNode().id(), deviceId);
104 104
105 if (event != null) { 105 if (event != null) {
106 post(event); 106 post(event);
......
...@@ -257,6 +257,8 @@ public class DeviceManager ...@@ -257,6 +257,8 @@ public class DeviceManager
257 // temporarily request for Master Role and mark offline. 257 // temporarily request for Master Role and mark offline.
258 if (!mastershipService.getLocalRole(deviceId).equals(MastershipRole.MASTER)) { 258 if (!mastershipService.getLocalRole(deviceId).equals(MastershipRole.MASTER)) {
259 log.debug("Device {} disconnected, but I am not the master", deviceId); 259 log.debug("Device {} disconnected, but I am not the master", deviceId);
260 + //let go of any role anyways
261 + mastershipService.relinquishMastership(deviceId);
260 return; 262 return;
261 } 263 }
262 DeviceEvent event = store.markOffline(deviceId); 264 DeviceEvent event = store.markOffline(deviceId);
......