1
0
Fork 0

Joining now redirects to leader if necessary

master
Philip O'Toole 10 months ago
parent ec789840c0
commit 84c284c2eb

@ -338,41 +338,47 @@ func (c *Client) Notify(nr *command.NotifyRequest, nodeAddr string, timeout time
// Join joins this node to a cluster at the remote address nodeAddr.
func (c *Client) Join(jr *command.JoinRequest, nodeAddr string, timeout time.Duration) error {
conn, err := c.dial(nodeAddr, c.timeout)
if err != nil {
return err
}
defer conn.Close()
// Create the request.
command := &Command{
Type: Command_COMMAND_TYPE_JOIN,
Request: &Command_JoinRequest{
JoinRequest: jr,
},
}
for {
conn, err := c.dial(nodeAddr, c.timeout)
if err != nil {
return err
}
defer conn.Close()
// Create the request.
command := &Command{
Type: Command_COMMAND_TYPE_JOIN,
Request: &Command_JoinRequest{
JoinRequest: jr,
},
}
if err := writeCommand(conn, command, timeout); err != nil {
handleConnError(conn)
return err
}
if err := writeCommand(conn, command, timeout); err != nil {
handleConnError(conn)
return err
}
p, err := readResponse(conn, timeout)
if err != nil {
handleConnError(conn)
return err
}
p, err := readResponse(conn, timeout)
if err != nil {
handleConnError(conn)
return err
}
a := &CommandJoinResponse{}
err = proto.Unmarshal(p, a)
if err != nil {
return err
}
a := &CommandJoinResponse{}
err = proto.Unmarshal(p, a)
if err != nil {
return err
}
if a.Error != "" {
return errors.New(a.Error)
if a.Error != "" {
if a.Error == "not leader" {
nodeAddr = a.Leader
continue
}
return errors.New(a.Error)
}
return nil
}
return nil
}
// Stats returns stats on the Client instance

@ -2,7 +2,7 @@
// versions:
// protoc-gen-go v1.31.0
// protoc v3.6.1
// source: message.proto
// source: cluster/message.proto
package cluster
@ -78,11 +78,11 @@ func (x Command_Type) String() string {
}
func (Command_Type) Descriptor() protoreflect.EnumDescriptor {
return file_message_proto_enumTypes[0].Descriptor()
return file_cluster_message_proto_enumTypes[0].Descriptor()
}
func (Command_Type) Type() protoreflect.EnumType {
return &file_message_proto_enumTypes[0]
return &file_cluster_message_proto_enumTypes[0]
}
func (x Command_Type) Number() protoreflect.EnumNumber {
@ -91,7 +91,7 @@ func (x Command_Type) Number() protoreflect.EnumNumber {
// Deprecated: Use Command_Type.Descriptor instead.
func (Command_Type) EnumDescriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{2, 0}
return file_cluster_message_proto_rawDescGZIP(), []int{2, 0}
}
type Credentials struct {
@ -106,7 +106,7 @@ type Credentials struct {
func (x *Credentials) Reset() {
*x = Credentials{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[0]
mi := &file_cluster_message_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -119,7 +119,7 @@ func (x *Credentials) String() string {
func (*Credentials) ProtoMessage() {}
func (x *Credentials) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[0]
mi := &file_cluster_message_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -132,7 +132,7 @@ func (x *Credentials) ProtoReflect() protoreflect.Message {
// Deprecated: Use Credentials.ProtoReflect.Descriptor instead.
func (*Credentials) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{0}
return file_cluster_message_proto_rawDescGZIP(), []int{0}
}
func (x *Credentials) GetUsername() string {
@ -160,7 +160,7 @@ type Address struct {
func (x *Address) Reset() {
*x = Address{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[1]
mi := &file_cluster_message_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -173,7 +173,7 @@ func (x *Address) String() string {
func (*Address) ProtoMessage() {}
func (x *Address) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[1]
mi := &file_cluster_message_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -186,7 +186,7 @@ func (x *Address) ProtoReflect() protoreflect.Message {
// Deprecated: Use Address.ProtoReflect.Descriptor instead.
func (*Address) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{1}
return file_cluster_message_proto_rawDescGZIP(), []int{1}
}
func (x *Address) GetUrl() string {
@ -220,7 +220,7 @@ type Command struct {
func (x *Command) Reset() {
*x = Command{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[2]
mi := &file_cluster_message_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -233,7 +233,7 @@ func (x *Command) String() string {
func (*Command) ProtoMessage() {}
func (x *Command) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[2]
mi := &file_cluster_message_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -246,7 +246,7 @@ func (x *Command) ProtoReflect() protoreflect.Message {
// Deprecated: Use Command.ProtoReflect.Descriptor instead.
func (*Command) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{2}
return file_cluster_message_proto_rawDescGZIP(), []int{2}
}
func (x *Command) GetType() Command_Type {
@ -403,7 +403,7 @@ type CommandExecuteResponse struct {
func (x *CommandExecuteResponse) Reset() {
*x = CommandExecuteResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[3]
mi := &file_cluster_message_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -416,7 +416,7 @@ func (x *CommandExecuteResponse) String() string {
func (*CommandExecuteResponse) ProtoMessage() {}
func (x *CommandExecuteResponse) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[3]
mi := &file_cluster_message_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -429,7 +429,7 @@ func (x *CommandExecuteResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CommandExecuteResponse.ProtoReflect.Descriptor instead.
func (*CommandExecuteResponse) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{3}
return file_cluster_message_proto_rawDescGZIP(), []int{3}
}
func (x *CommandExecuteResponse) GetError() string {
@ -458,7 +458,7 @@ type CommandQueryResponse struct {
func (x *CommandQueryResponse) Reset() {
*x = CommandQueryResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[4]
mi := &file_cluster_message_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -471,7 +471,7 @@ func (x *CommandQueryResponse) String() string {
func (*CommandQueryResponse) ProtoMessage() {}
func (x *CommandQueryResponse) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[4]
mi := &file_cluster_message_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -484,7 +484,7 @@ func (x *CommandQueryResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CommandQueryResponse.ProtoReflect.Descriptor instead.
func (*CommandQueryResponse) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{4}
return file_cluster_message_proto_rawDescGZIP(), []int{4}
}
func (x *CommandQueryResponse) GetError() string {
@ -513,7 +513,7 @@ type CommandRequestResponse struct {
func (x *CommandRequestResponse) Reset() {
*x = CommandRequestResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[5]
mi := &file_cluster_message_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -526,7 +526,7 @@ func (x *CommandRequestResponse) String() string {
func (*CommandRequestResponse) ProtoMessage() {}
func (x *CommandRequestResponse) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[5]
mi := &file_cluster_message_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -539,7 +539,7 @@ func (x *CommandRequestResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CommandRequestResponse.ProtoReflect.Descriptor instead.
func (*CommandRequestResponse) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{5}
return file_cluster_message_proto_rawDescGZIP(), []int{5}
}
func (x *CommandRequestResponse) GetError() string {
@ -568,7 +568,7 @@ type CommandBackupResponse struct {
func (x *CommandBackupResponse) Reset() {
*x = CommandBackupResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[6]
mi := &file_cluster_message_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -581,7 +581,7 @@ func (x *CommandBackupResponse) String() string {
func (*CommandBackupResponse) ProtoMessage() {}
func (x *CommandBackupResponse) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[6]
mi := &file_cluster_message_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -594,7 +594,7 @@ func (x *CommandBackupResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CommandBackupResponse.ProtoReflect.Descriptor instead.
func (*CommandBackupResponse) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{6}
return file_cluster_message_proto_rawDescGZIP(), []int{6}
}
func (x *CommandBackupResponse) GetError() string {
@ -622,7 +622,7 @@ type CommandLoadResponse struct {
func (x *CommandLoadResponse) Reset() {
*x = CommandLoadResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[7]
mi := &file_cluster_message_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -635,7 +635,7 @@ func (x *CommandLoadResponse) String() string {
func (*CommandLoadResponse) ProtoMessage() {}
func (x *CommandLoadResponse) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[7]
mi := &file_cluster_message_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -648,7 +648,7 @@ func (x *CommandLoadResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CommandLoadResponse.ProtoReflect.Descriptor instead.
func (*CommandLoadResponse) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{7}
return file_cluster_message_proto_rawDescGZIP(), []int{7}
}
func (x *CommandLoadResponse) GetError() string {
@ -669,7 +669,7 @@ type CommandLoadChunkResponse struct {
func (x *CommandLoadChunkResponse) Reset() {
*x = CommandLoadChunkResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[8]
mi := &file_cluster_message_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -682,7 +682,7 @@ func (x *CommandLoadChunkResponse) String() string {
func (*CommandLoadChunkResponse) ProtoMessage() {}
func (x *CommandLoadChunkResponse) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[8]
mi := &file_cluster_message_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -695,7 +695,7 @@ func (x *CommandLoadChunkResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CommandLoadChunkResponse.ProtoReflect.Descriptor instead.
func (*CommandLoadChunkResponse) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{8}
return file_cluster_message_proto_rawDescGZIP(), []int{8}
}
func (x *CommandLoadChunkResponse) GetError() string {
@ -716,7 +716,7 @@ type CommandRemoveNodeResponse struct {
func (x *CommandRemoveNodeResponse) Reset() {
*x = CommandRemoveNodeResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[9]
mi := &file_cluster_message_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -729,7 +729,7 @@ func (x *CommandRemoveNodeResponse) String() string {
func (*CommandRemoveNodeResponse) ProtoMessage() {}
func (x *CommandRemoveNodeResponse) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[9]
mi := &file_cluster_message_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -742,7 +742,7 @@ func (x *CommandRemoveNodeResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CommandRemoveNodeResponse.ProtoReflect.Descriptor instead.
func (*CommandRemoveNodeResponse) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{9}
return file_cluster_message_proto_rawDescGZIP(), []int{9}
}
func (x *CommandRemoveNodeResponse) GetError() string {
@ -763,7 +763,7 @@ type CommandNotifyResponse struct {
func (x *CommandNotifyResponse) Reset() {
*x = CommandNotifyResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[10]
mi := &file_cluster_message_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -776,7 +776,7 @@ func (x *CommandNotifyResponse) String() string {
func (*CommandNotifyResponse) ProtoMessage() {}
func (x *CommandNotifyResponse) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[10]
mi := &file_cluster_message_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -789,7 +789,7 @@ func (x *CommandNotifyResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CommandNotifyResponse.ProtoReflect.Descriptor instead.
func (*CommandNotifyResponse) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{10}
return file_cluster_message_proto_rawDescGZIP(), []int{10}
}
func (x *CommandNotifyResponse) GetError() string {
@ -804,13 +804,14 @@ type CommandJoinResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
Error string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
Leader string `protobuf:"bytes,2,opt,name=leader,proto3" json:"leader,omitempty"`
}
func (x *CommandJoinResponse) Reset() {
*x = CommandJoinResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_message_proto_msgTypes[11]
mi := &file_cluster_message_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -823,7 +824,7 @@ func (x *CommandJoinResponse) String() string {
func (*CommandJoinResponse) ProtoMessage() {}
func (x *CommandJoinResponse) ProtoReflect() protoreflect.Message {
mi := &file_message_proto_msgTypes[11]
mi := &file_cluster_message_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -836,7 +837,7 @@ func (x *CommandJoinResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use CommandJoinResponse.ProtoReflect.Descriptor instead.
func (*CommandJoinResponse) Descriptor() ([]byte, []int) {
return file_message_proto_rawDescGZIP(), []int{11}
return file_cluster_message_proto_rawDescGZIP(), []int{11}
}
func (x *CommandJoinResponse) GetError() string {
@ -846,141 +847,150 @@ func (x *CommandJoinResponse) GetError() string {
return ""
}
var File_message_proto protoreflect.FileDescriptor
var file_message_proto_rawDesc = []byte{
0x0a, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
0x45, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x1a,
0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61,
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61,
0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x1b, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73,
0x73, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x75, 0x72, 0x6c, 0x22, 0x8b, 0x08, 0x0a, 0x07, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12,
0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e,
0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e,
0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x42, 0x0a, 0x0f, 0x65, 0x78,
0x65, 0x63, 0x75, 0x74, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78,
0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e,
0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c,
0x0a, 0x0d, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18,
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e,
0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0c,
0x71, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e,
0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x05,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x42,
0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0d,
0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a,
0x0c, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4c, 0x6f,
0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x6c, 0x6f, 0x61,
0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4c, 0x0a, 0x13, 0x72, 0x65, 0x6d, 0x6f,
0x76, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18,
0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e,
0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x48, 0x00, 0x52, 0x11, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79,
0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16,
0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x0c, 0x6a, 0x6f, 0x69, 0x6e, 0x5f,
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e,
0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x6a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x52, 0x0a, 0x15, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x5f, 0x71, 0x75,
0x65, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63,
0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48,
0x00, 0x52, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49, 0x0a, 0x12, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x63,
0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x0b, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4c, 0x6f, 0x61,
0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52,
0x10, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x36, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73,
0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72,
0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x0b, 0x63, 0x72,
0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x22, 0xaa, 0x02, 0x0a, 0x04, 0x54, 0x79,
0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59,
0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d,
0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x45, 0x54,
0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x41, 0x50, 0x49, 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x01, 0x12,
0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, 0x4d,
0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10,
0x03, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50,
0x45, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f,
0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x10,
0x05, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50,
0x45, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x06, 0x12,
0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x4e, 0x4f, 0x54, 0x49, 0x46, 0x59, 0x10, 0x07, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d,
0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x4f, 0x49, 0x4e, 0x10, 0x08, 0x12,
0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10, 0x09, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4d,
0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x43,
0x48, 0x55, 0x4e, 0x4b, 0x10, 0x0a, 0x42, 0x09, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x22, 0x60, 0x0a, 0x16, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63,
0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f,
0x72, 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03,
0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65,
0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x73, 0x22, 0x54, 0x0a, 0x14, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x51, 0x75,
0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f,
0x72, 0x12, 0x26, 0x0a, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52,
0x6f, 0x77, 0x73, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x22, 0x69, 0x0a, 0x16, 0x43, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
func (x *CommandJoinResponse) GetLeader() string {
if x != nil {
return x.Leader
}
return ""
}
var File_cluster_message_proto protoreflect.FileDescriptor
var file_cluster_message_proto_rawDesc = []byte{
0x0a, 0x15, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72,
0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x45, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x64, 0x65,
0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x1b,
0x0a, 0x07, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x8b, 0x08, 0x0a, 0x07,
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e,
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79,
0x70, 0x65, 0x12, 0x42, 0x0a, 0x0f, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x5f, 0x72, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0d, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f,
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e,
0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x71, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x72,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63,
0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x0c, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x72, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x48, 0x00, 0x52, 0x0b, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x4c, 0x0a, 0x13, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f,
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f,
0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x11, 0x72, 0x65, 0x6d,
0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f,
0x0a, 0x0e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00,
0x52, 0x0d, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x39, 0x0a, 0x0c, 0x6a, 0x6f, 0x69, 0x6e, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18,
0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e,
0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x6a,
0x6f, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x52, 0x0a, 0x15, 0x65, 0x78,
0x65, 0x63, 0x75, 0x74, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75,
0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x49,
0x0a, 0x12, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x72, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x10, 0x6c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75,
0x6e, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x0b, 0x63, 0x72, 0x65,
0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14,
0x2e, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74,
0x69, 0x61, 0x6c, 0x73, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c,
0x73, 0x22, 0xaa, 0x02, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f,
0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f,
0x57, 0x4e, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x45, 0x54, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x41, 0x50,
0x49, 0x5f, 0x55, 0x52, 0x4c, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41,
0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, 0x10,
0x02, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50,
0x45, 0x5f, 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4d,
0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x43, 0x4b, 0x55, 0x50,
0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59,
0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x10, 0x05, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x4f, 0x4d,
0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45,
0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x06, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4d, 0x4d, 0x41,
0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x59, 0x10, 0x07,
0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45,
0x5f, 0x4a, 0x4f, 0x49, 0x4e, 0x10, 0x08, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, 0x4d, 0x4d, 0x41,
0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x10,
0x09, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x54, 0x59, 0x50,
0x45, 0x5f, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x43, 0x48, 0x55, 0x4e, 0x4b, 0x10, 0x0a, 0x42, 0x09,
0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x60, 0x0a, 0x16, 0x43, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x39, 0x0a, 0x08, 0x72, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f,
0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65,
0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x42,
0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a,
0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72,
0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2b, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x61,
0x6e, 0x64, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14,
0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x22, 0x30, 0x0a, 0x18, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c,
0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x31, 0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
0x64, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x07, 0x72, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x54, 0x0a, 0x14, 0x43,
0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2d, 0x0a, 0x15, 0x43, 0x6f, 0x6d,
0x6d, 0x61, 0x6e, 0x64, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2b, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d,
0x61, 0x6e, 0x64, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x26, 0x0a, 0x04, 0x72, 0x6f, 0x77,
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
0x64, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x6f, 0x77, 0x73, 0x52, 0x04, 0x72, 0x6f, 0x77,
0x73, 0x22, 0x69, 0x0a, 0x16, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f,
0x72, 0x12, 0x39, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x45, 0x78,
0x65, 0x63, 0x75, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0x0a, 0x15,
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x64,
0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22,
0x2b, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c, 0x6f, 0x61, 0x64, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x30, 0x0a, 0x18,
0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c, 0x6f, 0x61, 0x64, 0x43, 0x68, 0x75, 0x6e, 0x6b,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f,
0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x31,
0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e,
0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65,
0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f,
0x72, 0x22, 0x2d, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4e, 0x6f, 0x74, 0x69,
0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72,
0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72,
0x22, 0x43, 0x0a, 0x13, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4a, 0x6f, 0x69, 0x6e, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x16, 0x0a,
0x06, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c,
0x65, 0x61, 0x64, 0x65, 0x72, 0x42, 0x22, 0x5a, 0x20, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74, 0x65, 0x2f, 0x72, 0x71, 0x6c, 0x69, 0x74,
0x65, 0x2f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
file_message_proto_rawDescOnce sync.Once
file_message_proto_rawDescData = file_message_proto_rawDesc
file_cluster_message_proto_rawDescOnce sync.Once
file_cluster_message_proto_rawDescData = file_cluster_message_proto_rawDesc
)
func file_message_proto_rawDescGZIP() []byte {
file_message_proto_rawDescOnce.Do(func() {
file_message_proto_rawDescData = protoimpl.X.CompressGZIP(file_message_proto_rawDescData)
func file_cluster_message_proto_rawDescGZIP() []byte {
file_cluster_message_proto_rawDescOnce.Do(func() {
file_cluster_message_proto_rawDescData = protoimpl.X.CompressGZIP(file_cluster_message_proto_rawDescData)
})
return file_message_proto_rawDescData
return file_cluster_message_proto_rawDescData
}
var file_message_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_message_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_message_proto_goTypes = []interface{}{
var file_cluster_message_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_cluster_message_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_cluster_message_proto_goTypes = []interface{}{
(Command_Type)(0), // 0: cluster.Command.Type
(*Credentials)(nil), // 1: cluster.Credentials
(*Address)(nil), // 2: cluster.Address
@ -1007,7 +1017,7 @@ var file_message_proto_goTypes = []interface{}{
(*command.QueryRows)(nil), // 23: command.QueryRows
(*command.ExecuteQueryResponse)(nil), // 24: command.ExecuteQueryResponse
}
var file_message_proto_depIdxs = []int32{
var file_cluster_message_proto_depIdxs = []int32{
0, // 0: cluster.Command.type:type_name -> cluster.Command.Type
13, // 1: cluster.Command.execute_request:type_name -> command.ExecuteRequest
14, // 2: cluster.Command.query_request:type_name -> command.QueryRequest
@ -1029,13 +1039,13 @@ var file_message_proto_depIdxs = []int32{
0, // [0:14] is the sub-list for field type_name
}
func init() { file_message_proto_init() }
func file_message_proto_init() {
if File_message_proto != nil {
func init() { file_cluster_message_proto_init() }
func file_cluster_message_proto_init() {
if File_cluster_message_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
file_cluster_message_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Credentials); i {
case 0:
return &v.state
@ -1047,7 +1057,7 @@ func file_message_proto_init() {
return nil
}
}
file_message_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
file_cluster_message_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Address); i {
case 0:
return &v.state
@ -1059,7 +1069,7 @@ func file_message_proto_init() {
return nil
}
}
file_message_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
file_cluster_message_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Command); i {
case 0:
return &v.state
@ -1071,7 +1081,7 @@ func file_message_proto_init() {
return nil
}
}
file_message_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
file_cluster_message_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommandExecuteResponse); i {
case 0:
return &v.state
@ -1083,7 +1093,7 @@ func file_message_proto_init() {
return nil
}
}
file_message_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
file_cluster_message_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommandQueryResponse); i {
case 0:
return &v.state
@ -1095,7 +1105,7 @@ func file_message_proto_init() {
return nil
}
}
file_message_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
file_cluster_message_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommandRequestResponse); i {
case 0:
return &v.state
@ -1107,7 +1117,7 @@ func file_message_proto_init() {
return nil
}
}
file_message_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
file_cluster_message_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommandBackupResponse); i {
case 0:
return &v.state
@ -1119,7 +1129,7 @@ func file_message_proto_init() {
return nil
}
}
file_message_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
file_cluster_message_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommandLoadResponse); i {
case 0:
return &v.state
@ -1131,7 +1141,7 @@ func file_message_proto_init() {
return nil
}
}
file_message_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
file_cluster_message_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommandLoadChunkResponse); i {
case 0:
return &v.state
@ -1143,7 +1153,7 @@ func file_message_proto_init() {
return nil
}
}
file_message_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
file_cluster_message_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommandRemoveNodeResponse); i {
case 0:
return &v.state
@ -1155,7 +1165,7 @@ func file_message_proto_init() {
return nil
}
}
file_message_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
file_cluster_message_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommandNotifyResponse); i {
case 0:
return &v.state
@ -1167,7 +1177,7 @@ func file_message_proto_init() {
return nil
}
}
file_message_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
file_cluster_message_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CommandJoinResponse); i {
case 0:
return &v.state
@ -1180,7 +1190,7 @@ func file_message_proto_init() {
}
}
}
file_message_proto_msgTypes[2].OneofWrappers = []interface{}{
file_cluster_message_proto_msgTypes[2].OneofWrappers = []interface{}{
(*Command_ExecuteRequest)(nil),
(*Command_QueryRequest)(nil),
(*Command_BackupRequest)(nil),
@ -1195,19 +1205,19 @@ func file_message_proto_init() {
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_message_proto_rawDesc,
RawDescriptor: file_cluster_message_proto_rawDesc,
NumEnums: 1,
NumMessages: 12,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_message_proto_goTypes,
DependencyIndexes: file_message_proto_depIdxs,
EnumInfos: file_message_proto_enumTypes,
MessageInfos: file_message_proto_msgTypes,
GoTypes: file_cluster_message_proto_goTypes,
DependencyIndexes: file_cluster_message_proto_depIdxs,
EnumInfos: file_cluster_message_proto_enumTypes,
MessageInfos: file_cluster_message_proto_msgTypes,
}.Build()
File_message_proto = out.File
file_message_proto_rawDesc = nil
file_message_proto_goTypes = nil
file_message_proto_depIdxs = nil
File_cluster_message_proto = out.File
file_cluster_message_proto_rawDesc = nil
file_cluster_message_proto_goTypes = nil
file_cluster_message_proto_depIdxs = nil
}

@ -83,4 +83,5 @@ message CommandNotifyResponse {
message CommandJoinResponse {
string error = 1;
string leader = 2;
}

@ -96,6 +96,9 @@ type Database interface {
// Manager is the interface node-management systems must implement
type Manager interface {
// LeaderAddr returns the Raft address of the leader of the cluster.
LeaderAddr() (string, error)
// Remove removes the node, given by id, from the cluster
Remove(rn *command.RemoveNodeRequest) error
@ -453,6 +456,14 @@ func (s *Service) handleConn(conn net.Conn) {
} else {
if err := s.mgr.Join(jr); err != nil {
resp.Error = err.Error()
if err.Error() == "not leader" {
laddr, err := s.mgr.LeaderAddr()
if err != nil {
resp.Error = err.Error()
} else {
resp.Leader = laddr
}
}
}
}
marshalAndWrite(conn, resp)

@ -498,6 +498,79 @@ func Test_ServiceJoinNode(t *testing.T) {
}
}
// Test_ServiceJoinNodeForwarded ensures that a JoinNode request is forwarded
// to the leader if the node receiving the request is not the leader.
func Test_ServiceJoinNodeForwarded(t *testing.T) {
headerByte := byte(1)
cred := mustNewMockCredentialStore()
c := NewClient(mustNewDialer(headerByte, false, false), 30*time.Second)
leaderJoinCalled := false
// Create the Leader service.
lnL, muxL := mustNewMux()
go muxL.Serve()
tnL := muxL.Listen(headerByte)
dbL := mustNewMockDatabase()
mgrL := mustNewMockManager()
sL := New(tnL, dbL, mgrL, cred)
if sL == nil {
t.Fatalf("failed to create cluster service for Leader")
}
mgrL.joinFn = func(jr *command.JoinRequest) error {
leaderJoinCalled = true
return nil
}
if err := sL.Open(); err != nil {
t.Fatalf("failed to open cluster service on Leader: %s", err.Error())
}
// Create the Follower service.
lnF, muxF := mustNewMux()
go muxF.Serve()
tnF := muxF.Listen(headerByte)
dbF := mustNewMockDatabase()
mgrF := mustNewMockManager()
sF := New(tnF, dbF, mgrF, cred)
if sL == nil {
t.Fatalf("failed to create cluster service for Follower")
}
mgrF.joinFn = func(jr *command.JoinRequest) error {
return fmt.Errorf("not leader")
}
mgrF.leaderAddrFn = func() (string, error) {
return sL.Addr(), nil
}
if err := sF.Open(); err != nil {
t.Fatalf("failed to open cluster service on Follower: %s", err.Error())
}
req := &command.JoinRequest{
Address: "some client",
}
err := c.Join(req, sF.Addr(), longWait)
if err != nil {
t.Fatalf("failed to join node: %s", err.Error())
}
if !leaderJoinCalled {
t.Fatal("JoinNode not called on leader")
}
// Clean up resources
if err := lnL.Close(); err != nil {
t.Fatalf("failed to close Mux's listener: %s", err)
}
if err := sL.Close(); err != nil {
t.Fatalf("failed to close cluster service")
}
if err := lnF.Close(); err != nil {
t.Fatalf("failed to close Mux's listener: %s", err)
}
if err := sF.Close(); err != nil {
t.Fatalf("failed to close cluster service")
}
}
// Test_BinaryEncoding_Backwards ensures that software earlier than v6.6.2
// can communicate with v6.6.2+ releases. v6.6.2 increased the maximum size
// of cluster responses.

@ -468,6 +468,7 @@ type MockManager struct {
removeNodeFn func(rn *command.RemoveNodeRequest) error
notifyFn func(n *command.NotifyRequest) error
joinFn func(j *command.JoinRequest) error
leaderAddrFn func() (string, error)
}
func (m *MockManager) Remove(rn *command.RemoveNodeRequest) error {
@ -491,6 +492,13 @@ func (m *MockManager) Join(j *command.JoinRequest) error {
return m.joinFn(j)
}
func (m *MockManager) LeaderAddr() (string, error) {
if m.leaderAddrFn == nil {
return "", nil
}
return m.leaderAddrFn()
}
func mustNewMockManager() *MockManager {
return &MockManager{}
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save