-
Notifications
You must be signed in to change notification settings - Fork 23
Conversation
core/commit.go
Outdated
|
||
// FIXME: Only stop the request timer if the request | ||
// identifier it was started for matches the one of | ||
// the request accepted for execution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this, thank you for spotting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a possibility that a timer is left without stopping forever? I am not sure how a timer is stopped certainly at some point if stopReqTimer()
doesn't stop the timer at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since correct clients only send their requests sequentially, a replica need to maintain one prepare and one request timer per client. If a newer request is received, the replica can assume the former request was completed and the client timers should be reused. In other words, replicas only maintain timers for the most recent request of each client.
Similar to prepareTimerStarter, change definition of prepareTimerStopper to receive a Request message as parameter. Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
The purpose of the prepare timer is to trigger relaying of the Request message to the primary. So there is no point in starting prepare timer when the Request is handled by the primary replica itself. Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
Similar to prepareTimerStarter/prepareTimerStopper, pass Request message to requestTimerStarter/requestTimerStopper. This makes the both timers' abstractions similar to each other. As opposed to passing just client identifier, this will allow to check request identifier without further changing those definitions. Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
It may happen that a replica receives a newer client request before it has received Prepare for a former request from that client or accepts such request for execution. In that case, request and prepare timers started for the newer request should not be stopped. Tag request/prepare timers with a request identifier when started and stop the timer only when the same request identifier supplied. Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
5066756
to
eeeb504
Compare
Summary of changes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing and improving test coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explanation.
This pull request fixes some issues with prepare timer that were missed when reviewing #127.
Depending on how we decide to solve the issue noted in "WIP: core: Check request ID before stopping request/prepare timer", we might decide to do the opposite of what "RFC: core: Pass client ID to prepareTimerStarter" suggests.