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

Properly handle ticks when waiting for In-Flight view to finish #486

Merged
merged 5 commits into from
Jan 5, 2022

Conversation

yacovm
Copy link
Contributor

@yacovm yacovm commented Jan 3, 2022

No description provided.

… commit

This commit fixes a bug in which a node is unaware of a proposal being committed
by the rest of the nodes, and it attempts a view change which fails, and triggers
a view change timeout, which in turn triggers a sync.

the asynchronous sync procedure may then commit that proposal, and the proposal
will later on be attempted to be committed again once the view change resumes
its operation, because the two procedures are parallel.

The easy and trivial way of solving this would be to make the view change
block until the sync process has ended. While this might work, it makes
the single-threaded view change be dependant on network I/O, which is
might slow down view change for other nodes due to votes being late.

Instead, this commit highjacks the view change commit process and:
1) Waits for any active sync to finish and prevents any syncs from occuring
2) Checks the latest sequence committed and if the proposal being attempted
   to be committed by the view change is stale, it calls sync which
   would return either the last proposal committed, or a later one.

Signed-off-by: Yacov Manevich <[email protected]>
@yacovm yacovm marked this pull request as draft January 3, 2022 14:33
@yacovm yacovm changed the title In flight Properly handle ticks when waiting for In-Flight view to finish Jan 3, 2022
@yacovm yacovm force-pushed the InFlight branch 3 times, most recently from 89705ed to 0123da0 Compare January 4, 2022 16:03
@yacovm yacovm marked this pull request as ready for review January 4, 2022 16:06
@yacovm yacovm force-pushed the InFlight branch 3 times, most recently from bc75790 to e318ff1 Compare January 4, 2022 16:31
Due to a bug, When the view changer initializes an in-flight view it only waits for a single tick
before resuming view change standard operation.

Another part of the bug is that it anyway returns success, which in turn makes the sequence of the controller
be initialized to an old sequence.

Signed-off-by: Yacov Manevich <[email protected]>
@C0rWin C0rWin merged commit 57ed2ce into hyperledger-labs:v2 Jan 5, 2022
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.

2 participants