Skip to content

Commit

Permalink
Indy 1180 fix none finalised (hyperledger#581)
Browse files Browse the repository at this point in the history
* Fix none finalised reqs in case of not participating

Signed-off-by: dsurnin <dmitry.surnin@dsr-corporation.com>

* Move add instruction after apply

Signed-off-by: dsurnin <dmitry.surnin@dsr-corporation.com>

* Do not raise error in case of commit for previous view, simply remove it

Signed-off-by: dsurnin <dmitry.surnin@dsr-corporation.com>

* Reduce amount of logging; and some trace; check for already ordered based on last_ordered_3pc compare

Signed-off-by: dsurnin <dmitry.surnin@dsr-corporation.com>

* Fix flake errors

Signed-off-by: dsurnin <dmitry.surnin@dsr-corporation.com>
  • Loading branch information
dsurnin authored and Andrew Nikitin committed Apr 9, 2018
1 parent 7185572 commit 6e3ae1e
Showing 1 changed file with 10 additions and 4 deletions.
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

0 comments on commit 6e3ae1e

Please sign in to comment.