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-1883: add documentation for Message Requests #1027

Merged
merged 3 commits into from
Dec 13, 2018

Conversation

Toktar
Copy link
Contributor

@Toktar Toktar commented Dec 12, 2018

No description provided.

Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
@@ -0,0 +1,30 @@
# Message Requests

In BFT protocols you can lose no more than a certain count of messages. But it may happen in following valid cases:
Copy link
Contributor

Choose a reason for hiding this comment

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

number of messages

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -0,0 +1,30 @@
# Message Requests

In BFT protocols you can lose no more than a certain count of messages. But it may happen in following valid cases:
Copy link
Contributor

Choose a reason for hiding this comment

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

In Plenum it may happen in the following valid cases

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


###Three-phase commit messages

If a node lost a lot of messages for three-phase commit, ordering can stop for ever for this node. The problem is successfully solved via message request mechanism.
Copy link
Contributor

Choose a reason for hiding this comment

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

ordering can stop for this node until a catch-up is triggered by a checkpoint.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


If a node lost a lot of messages for three-phase commit, ordering can stop for ever for this node. The problem is successfully solved via message request mechanism.
A node requests lost messages from other nodes in follow cases:
- A node received not next PrePrepare -> ask PrePrepares, Prepares, Commits from the node last pp_seq_no to received PrePrepare (pp_seq_no - 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

All PrePrepares need to be applied sequentially, without any gaps. If a node receives a PrePrepare where previous PrePrepare(s) are not received yet (lost?), it asks .....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

If a node lost a lot of messages for three-phase commit, ordering can stop for ever for this node. The problem is successfully solved via message request mechanism.
A node requests lost messages from other nodes in follow cases:
- A node received not next PrePrepare -> ask PrePrepares, Prepares, Commits from the node last pp_seq_no to received PrePrepare (pp_seq_no - 1)
- A node received not next Prepare -> ask PrePrepares for pp_seq_no from received Prepare
Copy link
Contributor

Choose a reason for hiding this comment

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

A node receives a Prepare for which it doesn't have the corresponding PrePrepare.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

A node requests lost messages from other nodes in follow cases:
- A node received not next PrePrepare -> ask PrePrepares, Prepares, Commits from the node last pp_seq_no to received PrePrepare (pp_seq_no - 1)
- A node received not next Prepare -> ask PrePrepares for pp_seq_no from received Prepare
- A node received PrePrepare for not finalized request -> ask Propagates for not finalize requests from PrePrepare
Copy link
Contributor

Choose a reason for hiding this comment

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

A node receives a PrePrepare for a not finalized request (that is request for which the Node doesn't have a quorum of Propagates)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


Lost messages may delay catchup for a long time. The node message requests mechanism is used in follow cases:
- A node requests a LedgerStatus in a start of catchup process to compare with self ledger.
- With the first message request for a LedgerStatus the node is scheduling a new message request in config.LedgerStatusTimeout for case the answer to the first request will not be received.
Copy link
Contributor

Choose a reason for hiding this comment

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

the answer to the first request is not received.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

- A node requests a LedgerStatus in a start of catchup process to compare with self ledger.
- With the first message request for a LedgerStatus the node is scheduling a new message request in config.LedgerStatusTimeout for case the answer to the first request will not be received.
- A node requests a ConsistencyProof with median rate of ledger size on other nodes.
- With the first message request for a ConsistencyProof the node is scheduling a new message request in config.ConsistencyProofTimeout for case the answer to the first request will not be received.
Copy link
Contributor

Choose a reason for hiding this comment

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

the answer to the first request is not received.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


If a node lost a lot of messages for three-phase commit, ordering can stop for ever for this node. The problem is successfully solved via message request mechanism.
A node requests lost messages from other nodes in follow cases:
- A node received not next PrePrepare -> ask PrePrepares, Prepares, Commits from the node last pp_seq_no to received PrePrepare (pp_seq_no - 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

If the number of messages to be requested is more than CHK_FREQ, that is the size of Checkpoint, then nothing is requested since the Node is falling behind and is going to start a catch-up in any case because of a quorum of stashed stable checkpoints.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Signed-off-by: toktar <renata.toktar@dsr-corporation.com>
@ashcherbakov ashcherbakov merged commit 1786b24 into hyperledger:master Dec 13, 2018
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