Issue:
Ma'am, in the simulator code, we think that one extra NETWORK_DELAY
constant is added, in the case of an InconsistencyEvent
.
Ma'am, in lines 310 and 322 in the file megha_sim.py
in the branch Code-Documentation
(branch referred throughout the issue), we have:
self.simulation.event_queue.put((current_time+NETWORK_DELAY,InconsistencyEvent(task,gm,InconsistencyType.EXTERNAL_INCONSISTENCY,self.simulation)))
self.simulation.event_queue.put((current_time+NETWORK_DELAY,InconsistencyEvent(task,gm,InconsistencyType.INTERNAL_INCONSISTENCY,self.simulation)))
Ma'am, currently we are at the local master and this NETWORK_DELAY
constant is for sending the inconsistency event message to the global master along with the updated cluster state, but on following the chain of events, we reached the LMUpdateEvent where we are sending an updated view of the cluster state to that global master which caused the inconsistency event. In the LMUpdateEvent, in lines 149-150:
if not self.periodic:
self.gm.update_status(current_time+NETWORK_DELAY)
Ma'am, here we are again adding another NETWORK_DELAY
constant for sending the updated cluster state to the global master when we have already accounted for this NETWORK_DELAY
before when handling the InconsistencyEvent
.
Possible Fix:
Remove the NETWORK_DELAY
constant added in the lines 310 and 322, making them:
self.simulation.event_queue.put((current_time,InconsistencyEvent(task,gm,InconsistencyType.EXTERNAL_INCONSISTENCY,self.simulation)))
self.simulation.event_queue.put((current_time,InconsistencyEvent(task,gm,InconsistencyType.INTERNAL_INCONSISTENCY,self.simulation)))
Ma'am, requesting you to let us know if this error is valid and if the possible fix suggested is correct.
Thank You,
Rishit.C