Skip to content

Commit

Permalink
Implement idempotency for sdk terminators. Fixes #1446
Browse files Browse the repository at this point in the history
  • Loading branch information
plorenz committed Nov 29, 2023
1 parent 8c75d0b commit a2b5373
Show file tree
Hide file tree
Showing 45 changed files with 2,937 additions and 1,037 deletions.
1,205 changes: 750 additions & 455 deletions common/pb/ctrl_pb/ctrl.pb.go

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions common/pb/ctrl_pb/ctrl.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ enum ContentType {
RemoveTerminatorsRequestType = 1038;
QuiesceRouterRequestType = 1039;
DequiesceRouterRequestType = 1040;
ValidateTerminatorsV2RequestType = 1041;
ValidateTerminatorsV2ResponseType = 1042;

PeerStateChangeRequestType = 1050;

Expand Down Expand Up @@ -108,6 +110,26 @@ message ValidateTerminatorsRequest {
repeated Terminator terminators = 1;
}

message ValidateTerminatorsV2Request {
repeated Terminator terminators = 1;
}

enum TerminatorInvalidReason {
UnknownBinding = 0;
UnknownTerminator = 1;
BadState = 2;
}

message RouterTerminatorState {
bool valid = 1;
TerminatorInvalidReason reason = 2;
string detail = 3; // inspect info if valid
}

message ValidateTerminatorsV2Response {
map<string, RouterTerminatorState> states = 1;
}

message UpdateTerminatorRequest {
string terminatorId = 1;
bool updatePrecedence = 2;
Expand Down
8 changes: 8 additions & 0 deletions common/pb/ctrl_pb/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ func (request *ValidateTerminatorsRequest) GetContentType() int32 {
return int32(ContentType_ValidateTerminatorsRequestType)
}

func (request *ValidateTerminatorsV2Request) GetContentType() int32 {
return int32(ContentType_ValidateTerminatorsV2RequestType)
}

func (request *ValidateTerminatorsV2Response) GetContentType() int32 {
return int32(ContentType_ValidateTerminatorsV2ResponseType)
}

func (request *Dial) GetContentType() int32 {
return int32(ContentType_DialType)
}
Expand Down
12 changes: 12 additions & 0 deletions common/pb/mgmt_pb/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ func (request *InspectResponse) GetContentType() int32 {
func (request *RaftMemberListResponse) GetContentType() int32 {
return int32(ContentType_RaftListMembersResponseType)
}

func (request *ValidateTerminatorsRequest) GetContentType() int32 {
return int32(ContentType_ValidateTerminatorsRequestType)
}

func (request *ValidateTerminatorsResponse) GetContentType() int32 {
return int32(ContentType_ValidateTerminatorResponseType)
}

func (request *TerminatorDetail) GetContentType() int32 {
return int32(ContentType_ValidateTerminatorResultType)
}
Loading

0 comments on commit a2b5373

Please sign in to comment.