Skip to content

Commit

Permalink
[INDY-1116] fix IstanceChanges queue cleanup while view change comple…
Browse files Browse the repository at this point in the history
…ted (#518)

* [INDY-1116] fix IstanceChanges queue cleanup while view change completed

Signed-off-by: Andrew Nikitin <[email protected]>

* [INDY-1116] Freezing list of keys for iterating

Signed-off-by: Andrew Nikitin <[email protected]>
  • Loading branch information
anikitinDSR authored and ashcherbakov committed Feb 7, 2018
1 parent c1420a9 commit a4dfa67
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plenum/server/view_change/view_changer.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,14 @@ def _start_selection(self):
if self.view_change_in_progress:
self.view_change_in_progress = False
self.node.on_view_change_complete()
self.instanceChanges.pop(self.view_no - 1, None)
# when we had INSTANCE_CHANGE message, they added into instanceChanges
# by msg.view_no. When view change was occured and view_no is changed,
# then we should delete all INSTANCE_CHANGE messages with current (already changed)
# view_no (which used in corresponded INSTANCE_CHANGE messages)
# Therefore we delete all INSTANCE_CHANGE messages from previous and current view number
for view_number in list(self.instanceChanges.keys()):
if view_number <= self.view_no:
self.instanceChanges.pop(view_number, None)
self.previous_master_primary = None
self.propagate_primary = False

Expand Down

0 comments on commit a4dfa67

Please sign in to comment.