config ack sender and receiver#985
Open
MayRosenbaum wants to merge 2 commits into
Open
Conversation
aa672cd to
6eb8a25
Compare
6eb8a25 to
8c78389
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces initial sender/receiver components for the ConfigAck flow intended to coordinate consenter restart after a config block, per issue #641.
Changes:
- Adds a
ConfigAckerclient with retry/backoff to deliverAckConfigRPCs to the consenter. - Adds a
ConfigAckHandlerreceiver to collect per-client acknowledgments and allow waiting for all acks at a given config sequence. - Adds unit tests for sender retry behavior and receiver ack collection logic.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| node/consensus/consensus.go | Alters the AckConfig RPC handler stub behavior. |
| common/configack/config_ack_sender.go | Adds the ConfigAck sender with retry/backoff and TLS dialing. |
| common/configack/config_ack_sender_test.go | Adds tests for sender success, retry, and stop/cancel behavior. |
| common/configack/config_ack_receiver.go | Adds an ack-collection handler with blocking wait for all clients. |
| common/configack/config_ack_receiver_test.go | Adds tests for receiver sequencing, concurrency, and stop behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+82
to
+101
| func (ca *ConfigAckHandler) AddAck(request *protos.ConfigAck) error { | ||
| ca.lock.Lock() | ||
| defer ca.lock.Unlock() | ||
|
|
||
| clientID := ClientID{ | ||
| NodeType: request.NodeType, | ||
| Shard: types.ShardID(request.Shard), | ||
| } | ||
|
|
||
| if uint64(request.ConfigSeq) != ca.acks[clientID]+1 { | ||
| ca.logger.Warnf("config ack has been received on sequence %d but the last acknowledged sequence is %d", request.ConfigSeq, ca.acks[clientID]) | ||
| return fmt.Errorf("config ack has been received on sequence %d but the last acknowledged sequence is %d", request.ConfigSeq, ca.acks[clientID]) | ||
| } | ||
|
|
||
| ca.acks[clientID] = uint64(request.ConfigSeq) | ||
| ca.logger.Infof("config ack has been received on sequence %d", request.ConfigSeq) | ||
|
|
||
| ca.signalChan <- struct{}{} | ||
| return nil | ||
| } |
Contributor
Author
There was a problem hiding this comment.
I will check the identity of the sender (including its certificate) before AddAck is called in the consensus side.
Comment on lines
+103
to
+105
| func (ca *ConfigAckHandler) ExpectAck(configSeq uint64) bool { | ||
| for { | ||
| select { |
Contributor
Author
There was a problem hiding this comment.
AddAck send a signal to signalChan
Signed-off-by: May.Buzaglo <May.Buzaglo@ibm.com>
8c78389 to
108918a
Compare
Signed-off-by: May.Buzaglo <May.Buzaglo@ibm.com>
108918a to
12d2997
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
issue #641