Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indy 1180 fix none finalised #581

Merged
merged 8 commits into from
Mar 21, 2018
14 changes: 10 additions & 4 deletions plenum/server/replica.py
Original file line number Diff line number Diff line change
Expand Up @@ -1533,13 +1533,14 @@ def process_stashed_out_of_order_commits(self):
# This method is called periodically to check for any commits that
# were stashed due to lack of commits before them and orders them if it
# can
self.logger.debug('{} trying to order from out of order commits. {} {}'.format(
self, self.ordered, self.stashed_out_of_order_commits))
self.logger.debug('{} trying to order from out of order commits. '
'Len(stashed_out_of_order_commits) == {}'
.format(self, len(self.stashed_out_of_order_commits)))
if self.last_ordered_3pc:
lastOrdered = self.last_ordered_3pc
vToRemove = set()
for v in self.stashed_out_of_order_commits:
if v < lastOrdered[0] and self.stashed_out_of_order_commits[v]:
if v < lastOrdered[0]:
self.logger.debug(
"{} found commits {} from previous view {}"
" that were not ordered but last ordered"
Expand All @@ -1549,7 +1550,8 @@ def process_stashed_out_of_order_commits(self):
continue
pToRemove = set()
for p, commit in self.stashed_out_of_order_commits[v].items():
if (v, p) in self.ordered:
if (v, p) in self.ordered or\
self.has_already_ordered(*(commit.viewNo, commit.ppSeqNo)):
pToRemove.add(p)
continue
if (v == lastOrdered[0] and lastOrdered == (v, p - 1)) or \
Expand All @@ -1569,6 +1571,10 @@ def process_stashed_out_of_order_commits(self):

if not self.stashed_out_of_order_commits:
self.stopRepeating(self.process_stashed_out_of_order_commits)
else:
self.logger.debug('{} last_ordered_3pc if False. '
'Len(stashed_out_of_order_commits) == {}'
.format(self, len(self.stashed_out_of_order_commits)))

def isLowestCommitInView(self, commit):
view_no = commit.viewNo
Expand Down