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

Do not check freshness in a catchup. #1179

Merged
merged 3 commits into from
Apr 26, 2019

Conversation

Toktar
Copy link
Contributor

@Toktar Toktar commented Apr 23, 2019

Signed-off-by: toktar renata.toktar@dsr-corporation.com

Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
@@ -754,4 +754,5 @@ def propose_view_change(self, suspicion=Suspicions.PRIMARY_DEGRADED):

def is_state_fresh_enough(self):
threshold = self.config.ACCEPTABLE_FRESHNESS_INTERVALS_COUNT * self.config.STATE_FRESHNESS_UPDATE_INTERVAL
return self.provider.state_freshness() < threshold
return self.provider.state_freshness() < threshold or (not self.view_change_in_progress and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we require participating mode only?

@@ -754,4 +754,5 @@ def propose_view_change(self, suspicion=Suspicions.PRIMARY_DEGRADED):

def is_state_fresh_enough(self):
threshold = self.config.ACCEPTABLE_FRESHNESS_INTERVALS_COUNT * self.config.STATE_FRESHNESS_UPDATE_INTERVAL
return self.provider.state_freshness() < threshold
return self.provider.state_freshness() < threshold or (not self.view_change_in_progress and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the condition would be much more readable if write as follows:

if self.provider.state_freshness() < threshold:
    return True
if not self.view_change_in_progress and self.provider.node_mode() != Mode.participating:
    return True
return False

tconf, ):
"""
Check that InstanceChange with reason "State signatures are not updated for too long"
are not sends in catchup without view change.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is not sent

lagging_node.start_catchup()
looper.runFor(tconf.ACCEPTABLE_FRESHNESS_INTERVALS_COUNT * tconf.STATE_FRESHNESS_UPDATE_INTERVAL + 5)

print(lagging_node.view_changer.instance_changes._cache)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the print

@ashcherbakov ashcherbakov merged commit 168cad9 into hyperledger:master Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants