From 8b1f3170b708db2279119500beb00c98366e3b70 Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Thu, 28 Jan 2021 22:39:23 -0500 Subject: [PATCH 01/16] Add reparent RPCs, run generators, add server stubs Signed-off-by: Andrew Mason --- go/vt/proto/vtctldata/vtctldata.pb.go | 6075 +++++++++++++------ go/vt/proto/vtctlservice/vtctlservice.pb.go | 264 +- go/vt/vtctl/grpcvtctldclient/client_gen.go | 36 + go/vt/vtctl/grpcvtctldserver/server.go | 20 + proto/vtctldata.proto | 97 + proto/vtctlservice.proto | 22 + 6 files changed, 4758 insertions(+), 1756 deletions(-) diff --git a/go/vt/proto/vtctldata/vtctldata.pb.go b/go/vt/proto/vtctldata/vtctldata.pb.go index 0c231f5ab3f..0e090bb1d3b 100644 --- a/go/vt/proto/vtctldata/vtctldata.pb.go +++ b/go/vt/proto/vtctldata/vtctldata.pb.go @@ -881,6 +881,172 @@ func (m *DeleteTabletsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_DeleteTabletsResponse proto.InternalMessageInfo +type EmergencyReparentShardRequest struct { + // Keyspace is the name of the keyspace to perform the Emergency Reparent in. + Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` + // Shard is the name of the shard to perform the Emergency Reparent in. + Shard string `protobuf:"bytes,2,opt,name=shard,proto3" json:"shard,omitempty"` + // Optional alias of a tablet that should become the new shard primary. If not + // not specified, the vtctld will select the most up-to-date canditate to + // promote. + NewPrimary *topodata.TabletAlias `protobuf:"bytes,3,opt,name=new_primary,json=newPrimary,proto3" json:"new_primary,omitempty"` + // List of replica aliases to ignore during the Emergency Reparent. The vtctld + // will not attempt to stop replication on these tablets, nor attempt to + // demote any that may think they are the shard primary. + IgnoreReplicas []*topodata.TabletAlias `protobuf:"bytes,4,rep,name=ignore_replicas,json=ignoreReplicas,proto3" json:"ignore_replicas,omitempty"` + // WaitReplicasTimeout is the duration of time to wait for replicas to catch + // up in reparenting. + WaitReplicasTimeout *vttime.Duration `protobuf:"bytes,5,opt,name=wait_replicas_timeout,json=waitReplicasTimeout,proto3" json:"wait_replicas_timeout,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EmergencyReparentShardRequest) Reset() { *m = EmergencyReparentShardRequest{} } +func (m *EmergencyReparentShardRequest) String() string { return proto.CompactTextString(m) } +func (*EmergencyReparentShardRequest) ProtoMessage() {} +func (*EmergencyReparentShardRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f41247b323a1ab2e, []int{14} +} +func (m *EmergencyReparentShardRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EmergencyReparentShardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EmergencyReparentShardRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EmergencyReparentShardRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_EmergencyReparentShardRequest.Merge(m, src) +} +func (m *EmergencyReparentShardRequest) XXX_Size() int { + return m.Size() +} +func (m *EmergencyReparentShardRequest) XXX_DiscardUnknown() { + xxx_messageInfo_EmergencyReparentShardRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_EmergencyReparentShardRequest proto.InternalMessageInfo + +func (m *EmergencyReparentShardRequest) GetKeyspace() string { + if m != nil { + return m.Keyspace + } + return "" +} + +func (m *EmergencyReparentShardRequest) GetShard() string { + if m != nil { + return m.Shard + } + return "" +} + +func (m *EmergencyReparentShardRequest) GetNewPrimary() *topodata.TabletAlias { + if m != nil { + return m.NewPrimary + } + return nil +} + +func (m *EmergencyReparentShardRequest) GetIgnoreReplicas() []*topodata.TabletAlias { + if m != nil { + return m.IgnoreReplicas + } + return nil +} + +func (m *EmergencyReparentShardRequest) GetWaitReplicasTimeout() *vttime.Duration { + if m != nil { + return m.WaitReplicasTimeout + } + return nil +} + +type EmergencyReparentShardResponse struct { + // Keyspace is the name of the keyspace the Emergency Reparent took place in. + Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` + // Shard is the name of the shard the Emergency Reparent took place in. + Shard string `protobuf:"bytes,2,opt,name=shard,proto3" json:"shard,omitempty"` + // PromotedPrimary is the alias of the tablet that was promoted to shard + // primary. If NewPrimary was set in the request, then this will be the same + // alias. Otherwise, it will be the alias of the tablet found to be most + // up-to-date. + PromotedPrimary *topodata.TabletAlias `protobuf:"bytes,3,opt,name=promoted_primary,json=promotedPrimary,proto3" json:"promoted_primary,omitempty"` + Events []*logutil.Event `protobuf:"bytes,4,rep,name=events,proto3" json:"events,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EmergencyReparentShardResponse) Reset() { *m = EmergencyReparentShardResponse{} } +func (m *EmergencyReparentShardResponse) String() string { return proto.CompactTextString(m) } +func (*EmergencyReparentShardResponse) ProtoMessage() {} +func (*EmergencyReparentShardResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f41247b323a1ab2e, []int{15} +} +func (m *EmergencyReparentShardResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EmergencyReparentShardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EmergencyReparentShardResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EmergencyReparentShardResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_EmergencyReparentShardResponse.Merge(m, src) +} +func (m *EmergencyReparentShardResponse) XXX_Size() int { + return m.Size() +} +func (m *EmergencyReparentShardResponse) XXX_DiscardUnknown() { + xxx_messageInfo_EmergencyReparentShardResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_EmergencyReparentShardResponse proto.InternalMessageInfo + +func (m *EmergencyReparentShardResponse) GetKeyspace() string { + if m != nil { + return m.Keyspace + } + return "" +} + +func (m *EmergencyReparentShardResponse) GetShard() string { + if m != nil { + return m.Shard + } + return "" +} + +func (m *EmergencyReparentShardResponse) GetPromotedPrimary() *topodata.TabletAlias { + if m != nil { + return m.PromotedPrimary + } + return nil +} + +func (m *EmergencyReparentShardResponse) GetEvents() []*logutil.Event { + if m != nil { + return m.Events + } + return nil +} + type GetBackupsRequest struct { Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` Shard string `protobuf:"bytes,2,opt,name=shard,proto3" json:"shard,omitempty"` @@ -893,7 +1059,7 @@ func (m *GetBackupsRequest) Reset() { *m = GetBackupsRequest{} } func (m *GetBackupsRequest) String() string { return proto.CompactTextString(m) } func (*GetBackupsRequest) ProtoMessage() {} func (*GetBackupsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{14} + return fileDescriptor_f41247b323a1ab2e, []int{16} } func (m *GetBackupsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -947,7 +1113,7 @@ func (m *GetBackupsResponse) Reset() { *m = GetBackupsResponse{} } func (m *GetBackupsResponse) String() string { return proto.CompactTextString(m) } func (*GetBackupsResponse) ProtoMessage() {} func (*GetBackupsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{15} + return fileDescriptor_f41247b323a1ab2e, []int{17} } func (m *GetBackupsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -993,7 +1159,7 @@ func (m *GetCellInfoNamesRequest) Reset() { *m = GetCellInfoNamesRequest func (m *GetCellInfoNamesRequest) String() string { return proto.CompactTextString(m) } func (*GetCellInfoNamesRequest) ProtoMessage() {} func (*GetCellInfoNamesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{16} + return fileDescriptor_f41247b323a1ab2e, []int{18} } func (m *GetCellInfoNamesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1033,7 +1199,7 @@ func (m *GetCellInfoNamesResponse) Reset() { *m = GetCellInfoNamesRespon func (m *GetCellInfoNamesResponse) String() string { return proto.CompactTextString(m) } func (*GetCellInfoNamesResponse) ProtoMessage() {} func (*GetCellInfoNamesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{17} + return fileDescriptor_f41247b323a1ab2e, []int{19} } func (m *GetCellInfoNamesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1080,7 +1246,7 @@ func (m *GetCellInfoRequest) Reset() { *m = GetCellInfoRequest{} } func (m *GetCellInfoRequest) String() string { return proto.CompactTextString(m) } func (*GetCellInfoRequest) ProtoMessage() {} func (*GetCellInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{18} + return fileDescriptor_f41247b323a1ab2e, []int{20} } func (m *GetCellInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1127,7 +1293,7 @@ func (m *GetCellInfoResponse) Reset() { *m = GetCellInfoResponse{} } func (m *GetCellInfoResponse) String() string { return proto.CompactTextString(m) } func (*GetCellInfoResponse) ProtoMessage() {} func (*GetCellInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{19} + return fileDescriptor_f41247b323a1ab2e, []int{21} } func (m *GetCellInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1173,7 +1339,7 @@ func (m *GetCellsAliasesRequest) Reset() { *m = GetCellsAliasesRequest{} func (m *GetCellsAliasesRequest) String() string { return proto.CompactTextString(m) } func (*GetCellsAliasesRequest) ProtoMessage() {} func (*GetCellsAliasesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{20} + return fileDescriptor_f41247b323a1ab2e, []int{22} } func (m *GetCellsAliasesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1213,7 +1379,7 @@ func (m *GetCellsAliasesResponse) Reset() { *m = GetCellsAliasesResponse func (m *GetCellsAliasesResponse) String() string { return proto.CompactTextString(m) } func (*GetCellsAliasesResponse) ProtoMessage() {} func (*GetCellsAliasesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{21} + return fileDescriptor_f41247b323a1ab2e, []int{23} } func (m *GetCellsAliasesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1259,7 +1425,7 @@ func (m *GetKeyspacesRequest) Reset() { *m = GetKeyspacesRequest{} } func (m *GetKeyspacesRequest) String() string { return proto.CompactTextString(m) } func (*GetKeyspacesRequest) ProtoMessage() {} func (*GetKeyspacesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{22} + return fileDescriptor_f41247b323a1ab2e, []int{24} } func (m *GetKeyspacesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1299,7 +1465,7 @@ func (m *GetKeyspacesResponse) Reset() { *m = GetKeyspacesResponse{} } func (m *GetKeyspacesResponse) String() string { return proto.CompactTextString(m) } func (*GetKeyspacesResponse) ProtoMessage() {} func (*GetKeyspacesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{23} + return fileDescriptor_f41247b323a1ab2e, []int{25} } func (m *GetKeyspacesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1346,7 +1512,7 @@ func (m *GetKeyspaceRequest) Reset() { *m = GetKeyspaceRequest{} } func (m *GetKeyspaceRequest) String() string { return proto.CompactTextString(m) } func (*GetKeyspaceRequest) ProtoMessage() {} func (*GetKeyspaceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{24} + return fileDescriptor_f41247b323a1ab2e, []int{26} } func (m *GetKeyspaceRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1393,7 +1559,7 @@ func (m *GetKeyspaceResponse) Reset() { *m = GetKeyspaceResponse{} } func (m *GetKeyspaceResponse) String() string { return proto.CompactTextString(m) } func (*GetKeyspaceResponse) ProtoMessage() {} func (*GetKeyspaceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{25} + return fileDescriptor_f41247b323a1ab2e, []int{27} } func (m *GetKeyspaceResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1455,7 +1621,7 @@ func (m *GetSchemaRequest) Reset() { *m = GetSchemaRequest{} } func (m *GetSchemaRequest) String() string { return proto.CompactTextString(m) } func (*GetSchemaRequest) ProtoMessage() {} func (*GetSchemaRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{26} + return fileDescriptor_f41247b323a1ab2e, []int{28} } func (m *GetSchemaRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1537,7 +1703,7 @@ func (m *GetSchemaResponse) Reset() { *m = GetSchemaResponse{} } func (m *GetSchemaResponse) String() string { return proto.CompactTextString(m) } func (*GetSchemaResponse) ProtoMessage() {} func (*GetSchemaResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{27} + return fileDescriptor_f41247b323a1ab2e, []int{29} } func (m *GetSchemaResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1585,7 +1751,7 @@ func (m *GetShardRequest) Reset() { *m = GetShardRequest{} } func (m *GetShardRequest) String() string { return proto.CompactTextString(m) } func (*GetShardRequest) ProtoMessage() {} func (*GetShardRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{28} + return fileDescriptor_f41247b323a1ab2e, []int{30} } func (m *GetShardRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1639,7 +1805,7 @@ func (m *GetShardResponse) Reset() { *m = GetShardResponse{} } func (m *GetShardResponse) String() string { return proto.CompactTextString(m) } func (*GetShardResponse) ProtoMessage() {} func (*GetShardResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{29} + return fileDescriptor_f41247b323a1ab2e, []int{31} } func (m *GetShardResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1686,7 +1852,7 @@ func (m *GetSrvVSchemaRequest) Reset() { *m = GetSrvVSchemaRequest{} } func (m *GetSrvVSchemaRequest) String() string { return proto.CompactTextString(m) } func (*GetSrvVSchemaRequest) ProtoMessage() {} func (*GetSrvVSchemaRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{30} + return fileDescriptor_f41247b323a1ab2e, []int{32} } func (m *GetSrvVSchemaRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1733,7 +1899,7 @@ func (m *GetSrvVSchemaResponse) Reset() { *m = GetSrvVSchemaResponse{} } func (m *GetSrvVSchemaResponse) String() string { return proto.CompactTextString(m) } func (*GetSrvVSchemaResponse) ProtoMessage() {} func (*GetSrvVSchemaResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{31} + return fileDescriptor_f41247b323a1ab2e, []int{33} } func (m *GetSrvVSchemaResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1780,7 +1946,7 @@ func (m *GetTabletRequest) Reset() { *m = GetTabletRequest{} } func (m *GetTabletRequest) String() string { return proto.CompactTextString(m) } func (*GetTabletRequest) ProtoMessage() {} func (*GetTabletRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{32} + return fileDescriptor_f41247b323a1ab2e, []int{34} } func (m *GetTabletRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1827,7 +1993,7 @@ func (m *GetTabletResponse) Reset() { *m = GetTabletResponse{} } func (m *GetTabletResponse) String() string { return proto.CompactTextString(m) } func (*GetTabletResponse) ProtoMessage() {} func (*GetTabletResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{33} + return fileDescriptor_f41247b323a1ab2e, []int{35} } func (m *GetTabletResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1881,7 +2047,7 @@ func (m *GetTabletsRequest) Reset() { *m = GetTabletsRequest{} } func (m *GetTabletsRequest) String() string { return proto.CompactTextString(m) } func (*GetTabletsRequest) ProtoMessage() {} func (*GetTabletsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{34} + return fileDescriptor_f41247b323a1ab2e, []int{36} } func (m *GetTabletsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1942,7 +2108,7 @@ func (m *GetTabletsResponse) Reset() { *m = GetTabletsResponse{} } func (m *GetTabletsResponse) String() string { return proto.CompactTextString(m) } func (*GetTabletsResponse) ProtoMessage() {} func (*GetTabletsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{35} + return fileDescriptor_f41247b323a1ab2e, []int{37} } func (m *GetTabletsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1989,7 +2155,7 @@ func (m *GetVSchemaRequest) Reset() { *m = GetVSchemaRequest{} } func (m *GetVSchemaRequest) String() string { return proto.CompactTextString(m) } func (*GetVSchemaRequest) ProtoMessage() {} func (*GetVSchemaRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{36} + return fileDescriptor_f41247b323a1ab2e, []int{38} } func (m *GetVSchemaRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2036,7 +2202,7 @@ func (m *GetVSchemaResponse) Reset() { *m = GetVSchemaResponse{} } func (m *GetVSchemaResponse) String() string { return proto.CompactTextString(m) } func (*GetVSchemaResponse) ProtoMessage() {} func (*GetVSchemaResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{37} + return fileDescriptor_f41247b323a1ab2e, []int{39} } func (m *GetVSchemaResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2087,7 +2253,7 @@ func (m *InitShardPrimaryRequest) Reset() { *m = InitShardPrimaryRequest func (m *InitShardPrimaryRequest) String() string { return proto.CompactTextString(m) } func (*InitShardPrimaryRequest) ProtoMessage() {} func (*InitShardPrimaryRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{38} + return fileDescriptor_f41247b323a1ab2e, []int{40} } func (m *InitShardPrimaryRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2162,7 +2328,7 @@ func (m *InitShardPrimaryResponse) Reset() { *m = InitShardPrimaryRespon func (m *InitShardPrimaryResponse) String() string { return proto.CompactTextString(m) } func (*InitShardPrimaryResponse) ProtoMessage() {} func (*InitShardPrimaryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{39} + return fileDescriptor_f41247b323a1ab2e, []int{41} } func (m *InitShardPrimaryResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2198,33 +2364,46 @@ func (m *InitShardPrimaryResponse) GetEvents() []*logutil.Event { return nil } -type RemoveKeyspaceCellRequest struct { +type PlannedReparentShardRequest struct { + // Keyspace is the name of the keyspace to perform the Planned Reparent in. Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` - Cell string `protobuf:"bytes,2,opt,name=cell,proto3" json:"cell,omitempty"` - // Force proceeds even if the cell's topology server cannot be reached. This - // should only be set if a cell has been shut down entirely, and the global - // topology data just needs to be updated. - Force bool `protobuf:"varint,3,opt,name=force,proto3" json:"force,omitempty"` - // Recursive also deletes all tablets in that cell belonging to the specified - // keyspace. - Recursive bool `protobuf:"varint,4,opt,name=recursive,proto3" json:"recursive,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // Shard is the name of the shard to perform teh Planned Reparent in. + Shard string `protobuf:"bytes,2,opt,name=shard,proto3" json:"shard,omitempty"` + // NewPrimary is the alias of the tablet to promote to shard primary. If not + // specified, the vtctld will select the most up-to-date candidate to promote. + // + // It is an error to set NewPrimary and AvoidPrimary to the same alias. + NewPrimary *topodata.TabletAlias `protobuf:"bytes,3,opt,name=new_primary,json=newPrimary,proto3" json:"new_primary,omitempty"` + // AvoidPrimary is the alias of the tablet to demote. In other words, + // specifying an AvoidPrimary alias tells the vtctld to promote any replica + // other than this one. A shard whose current primary is not this one is then + // a no-op. + // + // It is an error to set NewPrimary and AvoidPrimary to the same alias. + AvoidPrimary *topodata.TabletAlias `protobuf:"bytes,4,opt,name=avoid_primary,json=avoidPrimary,proto3" json:"avoid_primary,omitempty"` + // WaitReplicasTimeout is the duration of time to wait for replicas to catch + // up in replication both before and after the reparent. The timeout is not + // cumulative across both wait periods, meaning that the replicas have + // WaitReplicasTimeout time to catch up before the reparent, and an additional + // WaitReplicasTimeout time to catch up after the reparent. + WaitReplicasTimeout *vttime.Duration `protobuf:"bytes,5,opt,name=wait_replicas_timeout,json=waitReplicasTimeout,proto3" json:"wait_replicas_timeout,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RemoveKeyspaceCellRequest) Reset() { *m = RemoveKeyspaceCellRequest{} } -func (m *RemoveKeyspaceCellRequest) String() string { return proto.CompactTextString(m) } -func (*RemoveKeyspaceCellRequest) ProtoMessage() {} -func (*RemoveKeyspaceCellRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{40} +func (m *PlannedReparentShardRequest) Reset() { *m = PlannedReparentShardRequest{} } +func (m *PlannedReparentShardRequest) String() string { return proto.CompactTextString(m) } +func (*PlannedReparentShardRequest) ProtoMessage() {} +func (*PlannedReparentShardRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f41247b323a1ab2e, []int{42} } -func (m *RemoveKeyspaceCellRequest) XXX_Unmarshal(b []byte) error { +func (m *PlannedReparentShardRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RemoveKeyspaceCellRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *PlannedReparentShardRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RemoveKeyspaceCellRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_PlannedReparentShardRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2234,64 +2413,81 @@ func (m *RemoveKeyspaceCellRequest) XXX_Marshal(b []byte, deterministic bool) ([ return b[:n], nil } } -func (m *RemoveKeyspaceCellRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveKeyspaceCellRequest.Merge(m, src) +func (m *PlannedReparentShardRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlannedReparentShardRequest.Merge(m, src) } -func (m *RemoveKeyspaceCellRequest) XXX_Size() int { +func (m *PlannedReparentShardRequest) XXX_Size() int { return m.Size() } -func (m *RemoveKeyspaceCellRequest) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveKeyspaceCellRequest.DiscardUnknown(m) +func (m *PlannedReparentShardRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PlannedReparentShardRequest.DiscardUnknown(m) } -var xxx_messageInfo_RemoveKeyspaceCellRequest proto.InternalMessageInfo +var xxx_messageInfo_PlannedReparentShardRequest proto.InternalMessageInfo -func (m *RemoveKeyspaceCellRequest) GetKeyspace() string { +func (m *PlannedReparentShardRequest) GetKeyspace() string { if m != nil { return m.Keyspace } return "" } -func (m *RemoveKeyspaceCellRequest) GetCell() string { +func (m *PlannedReparentShardRequest) GetShard() string { if m != nil { - return m.Cell + return m.Shard } return "" } -func (m *RemoveKeyspaceCellRequest) GetForce() bool { +func (m *PlannedReparentShardRequest) GetNewPrimary() *topodata.TabletAlias { if m != nil { - return m.Force + return m.NewPrimary } - return false + return nil } -func (m *RemoveKeyspaceCellRequest) GetRecursive() bool { +func (m *PlannedReparentShardRequest) GetAvoidPrimary() *topodata.TabletAlias { if m != nil { - return m.Recursive + return m.AvoidPrimary } - return false + return nil } -type RemoveKeyspaceCellResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (m *PlannedReparentShardRequest) GetWaitReplicasTimeout() *vttime.Duration { + if m != nil { + return m.WaitReplicasTimeout + } + return nil } -func (m *RemoveKeyspaceCellResponse) Reset() { *m = RemoveKeyspaceCellResponse{} } -func (m *RemoveKeyspaceCellResponse) String() string { return proto.CompactTextString(m) } -func (*RemoveKeyspaceCellResponse) ProtoMessage() {} -func (*RemoveKeyspaceCellResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{41} +type PlannedReparentShardResponse struct { + // Keyspace is the name of the keyspace the Planned Reparent took place in. + Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` + // Shard is the name of the shard the Planned Reparent took place in. + Shard string `protobuf:"bytes,2,opt,name=shard,proto3" json:"shard,omitempty"` + // PromotedPrimary is the alias of the tablet that was promoted to shard + // primary. If NewPrimary was set in the request, then this will be the same + // alias. Otherwise, it will be the alias of the tablet found to be most + // up-to-date. + PromotedPrimary *topodata.TabletAlias `protobuf:"bytes,3,opt,name=promoted_primary,json=promotedPrimary,proto3" json:"promoted_primary,omitempty"` + Events []*logutil.Event `protobuf:"bytes,4,rep,name=events,proto3" json:"events,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *RemoveKeyspaceCellResponse) XXX_Unmarshal(b []byte) error { + +func (m *PlannedReparentShardResponse) Reset() { *m = PlannedReparentShardResponse{} } +func (m *PlannedReparentShardResponse) String() string { return proto.CompactTextString(m) } +func (*PlannedReparentShardResponse) ProtoMessage() {} +func (*PlannedReparentShardResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f41247b323a1ab2e, []int{43} +} +func (m *PlannedReparentShardResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RemoveKeyspaceCellResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *PlannedReparentShardResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RemoveKeyspaceCellResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_PlannedReparentShardResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2301,42 +2497,185 @@ func (m *RemoveKeyspaceCellResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *RemoveKeyspaceCellResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoveKeyspaceCellResponse.Merge(m, src) +func (m *PlannedReparentShardResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PlannedReparentShardResponse.Merge(m, src) } -func (m *RemoveKeyspaceCellResponse) XXX_Size() int { +func (m *PlannedReparentShardResponse) XXX_Size() int { return m.Size() } -func (m *RemoveKeyspaceCellResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RemoveKeyspaceCellResponse.DiscardUnknown(m) +func (m *PlannedReparentShardResponse) XXX_DiscardUnknown() { + xxx_messageInfo_PlannedReparentShardResponse.DiscardUnknown(m) } -var xxx_messageInfo_RemoveKeyspaceCellResponse proto.InternalMessageInfo +var xxx_messageInfo_PlannedReparentShardResponse proto.InternalMessageInfo -type RemoveShardCellRequest struct { - Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` - ShardName string `protobuf:"bytes,2,opt,name=shard_name,json=shardName,proto3" json:"shard_name,omitempty"` - Cell string `protobuf:"bytes,3,opt,name=cell,proto3" json:"cell,omitempty"` - // Force proceeds even if the cell's topology server cannot be reached. This - // should only be set if a cell has been shut down entirely, and the global - // topology data just needs to be updated. - Force bool `protobuf:"varint,4,opt,name=force,proto3" json:"force,omitempty"` - // Recursive also deletes all tablets in that cell belonging to the specified - // keyspace and shard. - Recursive bool `protobuf:"varint,5,opt,name=recursive,proto3" json:"recursive,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (m *PlannedReparentShardResponse) GetKeyspace() string { + if m != nil { + return m.Keyspace + } + return "" } -func (m *RemoveShardCellRequest) Reset() { *m = RemoveShardCellRequest{} } -func (m *RemoveShardCellRequest) String() string { return proto.CompactTextString(m) } -func (*RemoveShardCellRequest) ProtoMessage() {} -func (*RemoveShardCellRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{42} -} -func (m *RemoveShardCellRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) +func (m *PlannedReparentShardResponse) GetShard() string { + if m != nil { + return m.Shard + } + return "" +} + +func (m *PlannedReparentShardResponse) GetPromotedPrimary() *topodata.TabletAlias { + if m != nil { + return m.PromotedPrimary + } + return nil +} + +func (m *PlannedReparentShardResponse) GetEvents() []*logutil.Event { + if m != nil { + return m.Events + } + return nil +} + +type RemoveKeyspaceCellRequest struct { + Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` + Cell string `protobuf:"bytes,2,opt,name=cell,proto3" json:"cell,omitempty"` + // Force proceeds even if the cell's topology server cannot be reached. This + // should only be set if a cell has been shut down entirely, and the global + // topology data just needs to be updated. + Force bool `protobuf:"varint,3,opt,name=force,proto3" json:"force,omitempty"` + // Recursive also deletes all tablets in that cell belonging to the specified + // keyspace. + Recursive bool `protobuf:"varint,4,opt,name=recursive,proto3" json:"recursive,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RemoveKeyspaceCellRequest) Reset() { *m = RemoveKeyspaceCellRequest{} } +func (m *RemoveKeyspaceCellRequest) String() string { return proto.CompactTextString(m) } +func (*RemoveKeyspaceCellRequest) ProtoMessage() {} +func (*RemoveKeyspaceCellRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f41247b323a1ab2e, []int{44} +} +func (m *RemoveKeyspaceCellRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RemoveKeyspaceCellRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RemoveKeyspaceCellRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RemoveKeyspaceCellRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveKeyspaceCellRequest.Merge(m, src) +} +func (m *RemoveKeyspaceCellRequest) XXX_Size() int { + return m.Size() +} +func (m *RemoveKeyspaceCellRequest) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveKeyspaceCellRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveKeyspaceCellRequest proto.InternalMessageInfo + +func (m *RemoveKeyspaceCellRequest) GetKeyspace() string { + if m != nil { + return m.Keyspace + } + return "" +} + +func (m *RemoveKeyspaceCellRequest) GetCell() string { + if m != nil { + return m.Cell + } + return "" +} + +func (m *RemoveKeyspaceCellRequest) GetForce() bool { + if m != nil { + return m.Force + } + return false +} + +func (m *RemoveKeyspaceCellRequest) GetRecursive() bool { + if m != nil { + return m.Recursive + } + return false +} + +type RemoveKeyspaceCellResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RemoveKeyspaceCellResponse) Reset() { *m = RemoveKeyspaceCellResponse{} } +func (m *RemoveKeyspaceCellResponse) String() string { return proto.CompactTextString(m) } +func (*RemoveKeyspaceCellResponse) ProtoMessage() {} +func (*RemoveKeyspaceCellResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f41247b323a1ab2e, []int{45} +} +func (m *RemoveKeyspaceCellResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RemoveKeyspaceCellResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RemoveKeyspaceCellResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RemoveKeyspaceCellResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RemoveKeyspaceCellResponse.Merge(m, src) +} +func (m *RemoveKeyspaceCellResponse) XXX_Size() int { + return m.Size() +} +func (m *RemoveKeyspaceCellResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RemoveKeyspaceCellResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_RemoveKeyspaceCellResponse proto.InternalMessageInfo + +type RemoveShardCellRequest struct { + Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` + ShardName string `protobuf:"bytes,2,opt,name=shard_name,json=shardName,proto3" json:"shard_name,omitempty"` + Cell string `protobuf:"bytes,3,opt,name=cell,proto3" json:"cell,omitempty"` + // Force proceeds even if the cell's topology server cannot be reached. This + // should only be set if a cell has been shut down entirely, and the global + // topology data just needs to be updated. + Force bool `protobuf:"varint,4,opt,name=force,proto3" json:"force,omitempty"` + // Recursive also deletes all tablets in that cell belonging to the specified + // keyspace and shard. + Recursive bool `protobuf:"varint,5,opt,name=recursive,proto3" json:"recursive,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RemoveShardCellRequest) Reset() { *m = RemoveShardCellRequest{} } +func (m *RemoveShardCellRequest) String() string { return proto.CompactTextString(m) } +func (*RemoveShardCellRequest) ProtoMessage() {} +func (*RemoveShardCellRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f41247b323a1ab2e, []int{46} +} +func (m *RemoveShardCellRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) } func (m *RemoveShardCellRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { @@ -2407,7 +2746,7 @@ func (m *RemoveShardCellResponse) Reset() { *m = RemoveShardCellResponse func (m *RemoveShardCellResponse) String() string { return proto.CompactTextString(m) } func (*RemoveShardCellResponse) ProtoMessage() {} func (*RemoveShardCellResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{43} + return fileDescriptor_f41247b323a1ab2e, []int{47} } func (m *RemoveShardCellResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2436,26 +2775,27 @@ func (m *RemoveShardCellResponse) XXX_DiscardUnknown() { var xxx_messageInfo_RemoveShardCellResponse proto.InternalMessageInfo -type Keyspace struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Keyspace *topodata.Keyspace `protobuf:"bytes,2,opt,name=keyspace,proto3" json:"keyspace,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type ReparentTabletRequest struct { + // Tablet is the alias of the tablet that should be reparented under the + // current shard primary. + Tablet *topodata.TabletAlias `protobuf:"bytes,1,opt,name=tablet,proto3" json:"tablet,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *Keyspace) Reset() { *m = Keyspace{} } -func (m *Keyspace) String() string { return proto.CompactTextString(m) } -func (*Keyspace) ProtoMessage() {} -func (*Keyspace) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{44} +func (m *ReparentTabletRequest) Reset() { *m = ReparentTabletRequest{} } +func (m *ReparentTabletRequest) String() string { return proto.CompactTextString(m) } +func (*ReparentTabletRequest) ProtoMessage() {} +func (*ReparentTabletRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f41247b323a1ab2e, []int{48} } -func (m *Keyspace) XXX_Unmarshal(b []byte) error { +func (m *ReparentTabletRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Keyspace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ReparentTabletRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Keyspace.Marshal(b, m, deterministic) + return xxx_messageInfo_ReparentTabletRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2465,51 +2805,49 @@ func (m *Keyspace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Keyspace) XXX_Merge(src proto.Message) { - xxx_messageInfo_Keyspace.Merge(m, src) +func (m *ReparentTabletRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReparentTabletRequest.Merge(m, src) } -func (m *Keyspace) XXX_Size() int { +func (m *ReparentTabletRequest) XXX_Size() int { return m.Size() } -func (m *Keyspace) XXX_DiscardUnknown() { - xxx_messageInfo_Keyspace.DiscardUnknown(m) +func (m *ReparentTabletRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ReparentTabletRequest.DiscardUnknown(m) } -var xxx_messageInfo_Keyspace proto.InternalMessageInfo - -func (m *Keyspace) GetName() string { - if m != nil { - return m.Name - } - return "" -} +var xxx_messageInfo_ReparentTabletRequest proto.InternalMessageInfo -func (m *Keyspace) GetKeyspace() *topodata.Keyspace { +func (m *ReparentTabletRequest) GetTablet() *topodata.TabletAlias { if m != nil { - return m.Keyspace + return m.Tablet } return nil } -type FindAllShardsInKeyspaceRequest struct { - Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +type ReparentTabletResponse struct { + // Keyspace is the name of the keyspace the tablet was reparented in. + Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` + // Shard is the name of the shard the tablet was reparented in. + Shard string `protobuf:"bytes,2,opt,name=shard,proto3" json:"shard,omitempty"` + // Primary is the alias of the tablet that the tablet was reparented under. + Primary *topodata.TabletAlias `protobuf:"bytes,3,opt,name=primary,proto3" json:"primary,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *FindAllShardsInKeyspaceRequest) Reset() { *m = FindAllShardsInKeyspaceRequest{} } -func (m *FindAllShardsInKeyspaceRequest) String() string { return proto.CompactTextString(m) } -func (*FindAllShardsInKeyspaceRequest) ProtoMessage() {} -func (*FindAllShardsInKeyspaceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{45} +func (m *ReparentTabletResponse) Reset() { *m = ReparentTabletResponse{} } +func (m *ReparentTabletResponse) String() string { return proto.CompactTextString(m) } +func (*ReparentTabletResponse) ProtoMessage() {} +func (*ReparentTabletResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f41247b323a1ab2e, []int{49} } -func (m *FindAllShardsInKeyspaceRequest) XXX_Unmarshal(b []byte) error { +func (m *ReparentTabletResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *FindAllShardsInKeyspaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ReparentTabletResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_FindAllShardsInKeyspaceRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_ReparentTabletResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2519,44 +2857,60 @@ func (m *FindAllShardsInKeyspaceRequest) XXX_Marshal(b []byte, deterministic boo return b[:n], nil } } -func (m *FindAllShardsInKeyspaceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_FindAllShardsInKeyspaceRequest.Merge(m, src) +func (m *ReparentTabletResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ReparentTabletResponse.Merge(m, src) } -func (m *FindAllShardsInKeyspaceRequest) XXX_Size() int { +func (m *ReparentTabletResponse) XXX_Size() int { return m.Size() } -func (m *FindAllShardsInKeyspaceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_FindAllShardsInKeyspaceRequest.DiscardUnknown(m) +func (m *ReparentTabletResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ReparentTabletResponse.DiscardUnknown(m) } -var xxx_messageInfo_FindAllShardsInKeyspaceRequest proto.InternalMessageInfo +var xxx_messageInfo_ReparentTabletResponse proto.InternalMessageInfo -func (m *FindAllShardsInKeyspaceRequest) GetKeyspace() string { +func (m *ReparentTabletResponse) GetKeyspace() string { if m != nil { return m.Keyspace } return "" } -type FindAllShardsInKeyspaceResponse struct { - Shards map[string]*Shard `protobuf:"bytes,1,rep,name=shards,proto3" json:"shards,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (m *ReparentTabletResponse) GetShard() string { + if m != nil { + return m.Shard + } + return "" } -func (m *FindAllShardsInKeyspaceResponse) Reset() { *m = FindAllShardsInKeyspaceResponse{} } -func (m *FindAllShardsInKeyspaceResponse) String() string { return proto.CompactTextString(m) } -func (*FindAllShardsInKeyspaceResponse) ProtoMessage() {} -func (*FindAllShardsInKeyspaceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{46} +func (m *ReparentTabletResponse) GetPrimary() *topodata.TabletAlias { + if m != nil { + return m.Primary + } + return nil } -func (m *FindAllShardsInKeyspaceResponse) XXX_Unmarshal(b []byte) error { + +type TabletExternallyReparentedRequest struct { + // Tablet is the alias of the tablet that was promoted externally and should + // be updated to the shard primary in the topo. + Tablet *topodata.TabletAlias `protobuf:"bytes,1,opt,name=tablet,proto3" json:"tablet,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TabletExternallyReparentedRequest) Reset() { *m = TabletExternallyReparentedRequest{} } +func (m *TabletExternallyReparentedRequest) String() string { return proto.CompactTextString(m) } +func (*TabletExternallyReparentedRequest) ProtoMessage() {} +func (*TabletExternallyReparentedRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f41247b323a1ab2e, []int{50} +} +func (m *TabletExternallyReparentedRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *FindAllShardsInKeyspaceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TabletExternallyReparentedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_FindAllShardsInKeyspaceResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_TabletExternallyReparentedRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2566,27 +2920,247 @@ func (m *FindAllShardsInKeyspaceResponse) XXX_Marshal(b []byte, deterministic bo return b[:n], nil } } -func (m *FindAllShardsInKeyspaceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_FindAllShardsInKeyspaceResponse.Merge(m, src) +func (m *TabletExternallyReparentedRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TabletExternallyReparentedRequest.Merge(m, src) } -func (m *FindAllShardsInKeyspaceResponse) XXX_Size() int { +func (m *TabletExternallyReparentedRequest) XXX_Size() int { return m.Size() } -func (m *FindAllShardsInKeyspaceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_FindAllShardsInKeyspaceResponse.DiscardUnknown(m) +func (m *TabletExternallyReparentedRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TabletExternallyReparentedRequest.DiscardUnknown(m) } -var xxx_messageInfo_FindAllShardsInKeyspaceResponse proto.InternalMessageInfo +var xxx_messageInfo_TabletExternallyReparentedRequest proto.InternalMessageInfo -func (m *FindAllShardsInKeyspaceResponse) GetShards() map[string]*Shard { +func (m *TabletExternallyReparentedRequest) GetTablet() *topodata.TabletAlias { if m != nil { - return m.Shards + return m.Tablet } return nil } -type Shard struct { - Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` +type TabletExternallyReparentedResponse struct { + Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` + Shard string `protobuf:"bytes,2,opt,name=shard,proto3" json:"shard,omitempty"` + NewPrimary *topodata.TabletAlias `protobuf:"bytes,3,opt,name=new_primary,json=newPrimary,proto3" json:"new_primary,omitempty"` + OldPrimary *topodata.TabletAlias `protobuf:"bytes,4,opt,name=old_primary,json=oldPrimary,proto3" json:"old_primary,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TabletExternallyReparentedResponse) Reset() { *m = TabletExternallyReparentedResponse{} } +func (m *TabletExternallyReparentedResponse) String() string { return proto.CompactTextString(m) } +func (*TabletExternallyReparentedResponse) ProtoMessage() {} +func (*TabletExternallyReparentedResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f41247b323a1ab2e, []int{51} +} +func (m *TabletExternallyReparentedResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TabletExternallyReparentedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TabletExternallyReparentedResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TabletExternallyReparentedResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TabletExternallyReparentedResponse.Merge(m, src) +} +func (m *TabletExternallyReparentedResponse) XXX_Size() int { + return m.Size() +} +func (m *TabletExternallyReparentedResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TabletExternallyReparentedResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_TabletExternallyReparentedResponse proto.InternalMessageInfo + +func (m *TabletExternallyReparentedResponse) GetKeyspace() string { + if m != nil { + return m.Keyspace + } + return "" +} + +func (m *TabletExternallyReparentedResponse) GetShard() string { + if m != nil { + return m.Shard + } + return "" +} + +func (m *TabletExternallyReparentedResponse) GetNewPrimary() *topodata.TabletAlias { + if m != nil { + return m.NewPrimary + } + return nil +} + +func (m *TabletExternallyReparentedResponse) GetOldPrimary() *topodata.TabletAlias { + if m != nil { + return m.OldPrimary + } + return nil +} + +type Keyspace struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Keyspace *topodata.Keyspace `protobuf:"bytes,2,opt,name=keyspace,proto3" json:"keyspace,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Keyspace) Reset() { *m = Keyspace{} } +func (m *Keyspace) String() string { return proto.CompactTextString(m) } +func (*Keyspace) ProtoMessage() {} +func (*Keyspace) Descriptor() ([]byte, []int) { + return fileDescriptor_f41247b323a1ab2e, []int{52} +} +func (m *Keyspace) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Keyspace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Keyspace.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Keyspace) XXX_Merge(src proto.Message) { + xxx_messageInfo_Keyspace.Merge(m, src) +} +func (m *Keyspace) XXX_Size() int { + return m.Size() +} +func (m *Keyspace) XXX_DiscardUnknown() { + xxx_messageInfo_Keyspace.DiscardUnknown(m) +} + +var xxx_messageInfo_Keyspace proto.InternalMessageInfo + +func (m *Keyspace) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Keyspace) GetKeyspace() *topodata.Keyspace { + if m != nil { + return m.Keyspace + } + return nil +} + +type FindAllShardsInKeyspaceRequest struct { + Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FindAllShardsInKeyspaceRequest) Reset() { *m = FindAllShardsInKeyspaceRequest{} } +func (m *FindAllShardsInKeyspaceRequest) String() string { return proto.CompactTextString(m) } +func (*FindAllShardsInKeyspaceRequest) ProtoMessage() {} +func (*FindAllShardsInKeyspaceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f41247b323a1ab2e, []int{53} +} +func (m *FindAllShardsInKeyspaceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FindAllShardsInKeyspaceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FindAllShardsInKeyspaceRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FindAllShardsInKeyspaceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FindAllShardsInKeyspaceRequest.Merge(m, src) +} +func (m *FindAllShardsInKeyspaceRequest) XXX_Size() int { + return m.Size() +} +func (m *FindAllShardsInKeyspaceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_FindAllShardsInKeyspaceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_FindAllShardsInKeyspaceRequest proto.InternalMessageInfo + +func (m *FindAllShardsInKeyspaceRequest) GetKeyspace() string { + if m != nil { + return m.Keyspace + } + return "" +} + +type FindAllShardsInKeyspaceResponse struct { + Shards map[string]*Shard `protobuf:"bytes,1,rep,name=shards,proto3" json:"shards,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FindAllShardsInKeyspaceResponse) Reset() { *m = FindAllShardsInKeyspaceResponse{} } +func (m *FindAllShardsInKeyspaceResponse) String() string { return proto.CompactTextString(m) } +func (*FindAllShardsInKeyspaceResponse) ProtoMessage() {} +func (*FindAllShardsInKeyspaceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f41247b323a1ab2e, []int{54} +} +func (m *FindAllShardsInKeyspaceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FindAllShardsInKeyspaceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FindAllShardsInKeyspaceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FindAllShardsInKeyspaceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_FindAllShardsInKeyspaceResponse.Merge(m, src) +} +func (m *FindAllShardsInKeyspaceResponse) XXX_Size() int { + return m.Size() +} +func (m *FindAllShardsInKeyspaceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_FindAllShardsInKeyspaceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_FindAllShardsInKeyspaceResponse proto.InternalMessageInfo + +func (m *FindAllShardsInKeyspaceResponse) GetShards() map[string]*Shard { + if m != nil { + return m.Shards + } + return nil +} + +type Shard struct { + Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Shard *topodata.Shard `protobuf:"bytes,3,opt,name=shard,proto3" json:"shard,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -2598,7 +3172,7 @@ func (m *Shard) Reset() { *m = Shard{} } func (m *Shard) String() string { return proto.CompactTextString(m) } func (*Shard) ProtoMessage() {} func (*Shard) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{47} + return fileDescriptor_f41247b323a1ab2e, []int{55} } func (m *Shard) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2666,7 +3240,7 @@ func (m *TableMaterializeSettings) Reset() { *m = TableMaterializeSettin func (m *TableMaterializeSettings) String() string { return proto.CompactTextString(m) } func (*TableMaterializeSettings) ProtoMessage() {} func (*TableMaterializeSettings) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{48} + return fileDescriptor_f41247b323a1ab2e, []int{56} } func (m *TableMaterializeSettings) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2737,7 +3311,7 @@ func (m *MaterializeSettings) Reset() { *m = MaterializeSettings{} } func (m *MaterializeSettings) String() string { return proto.CompactTextString(m) } func (*MaterializeSettings) ProtoMessage() {} func (*MaterializeSettings) Descriptor() ([]byte, []int) { - return fileDescriptor_f41247b323a1ab2e, []int{49} + return fileDescriptor_f41247b323a1ab2e, []int{57} } func (m *MaterializeSettings) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2830,6 +3404,8 @@ func init() { proto.RegisterType((*DeleteShardsResponse)(nil), "vtctldata.DeleteShardsResponse") proto.RegisterType((*DeleteTabletsRequest)(nil), "vtctldata.DeleteTabletsRequest") proto.RegisterType((*DeleteTabletsResponse)(nil), "vtctldata.DeleteTabletsResponse") + proto.RegisterType((*EmergencyReparentShardRequest)(nil), "vtctldata.EmergencyReparentShardRequest") + proto.RegisterType((*EmergencyReparentShardResponse)(nil), "vtctldata.EmergencyReparentShardResponse") proto.RegisterType((*GetBackupsRequest)(nil), "vtctldata.GetBackupsRequest") proto.RegisterType((*GetBackupsResponse)(nil), "vtctldata.GetBackupsResponse") proto.RegisterType((*GetCellInfoNamesRequest)(nil), "vtctldata.GetCellInfoNamesRequest") @@ -2857,10 +3433,16 @@ func init() { proto.RegisterType((*GetVSchemaResponse)(nil), "vtctldata.GetVSchemaResponse") proto.RegisterType((*InitShardPrimaryRequest)(nil), "vtctldata.InitShardPrimaryRequest") proto.RegisterType((*InitShardPrimaryResponse)(nil), "vtctldata.InitShardPrimaryResponse") + proto.RegisterType((*PlannedReparentShardRequest)(nil), "vtctldata.PlannedReparentShardRequest") + proto.RegisterType((*PlannedReparentShardResponse)(nil), "vtctldata.PlannedReparentShardResponse") proto.RegisterType((*RemoveKeyspaceCellRequest)(nil), "vtctldata.RemoveKeyspaceCellRequest") proto.RegisterType((*RemoveKeyspaceCellResponse)(nil), "vtctldata.RemoveKeyspaceCellResponse") proto.RegisterType((*RemoveShardCellRequest)(nil), "vtctldata.RemoveShardCellRequest") proto.RegisterType((*RemoveShardCellResponse)(nil), "vtctldata.RemoveShardCellResponse") + proto.RegisterType((*ReparentTabletRequest)(nil), "vtctldata.ReparentTabletRequest") + proto.RegisterType((*ReparentTabletResponse)(nil), "vtctldata.ReparentTabletResponse") + proto.RegisterType((*TabletExternallyReparentedRequest)(nil), "vtctldata.TabletExternallyReparentedRequest") + proto.RegisterType((*TabletExternallyReparentedResponse)(nil), "vtctldata.TabletExternallyReparentedResponse") proto.RegisterType((*Keyspace)(nil), "vtctldata.Keyspace") proto.RegisterType((*FindAllShardsInKeyspaceRequest)(nil), "vtctldata.FindAllShardsInKeyspaceRequest") proto.RegisterType((*FindAllShardsInKeyspaceResponse)(nil), "vtctldata.FindAllShardsInKeyspaceResponse") @@ -2873,122 +3455,135 @@ func init() { func init() { proto.RegisterFile("vtctldata.proto", fileDescriptor_f41247b323a1ab2e) } var fileDescriptor_f41247b323a1ab2e = []byte{ - // 1831 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0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0xae, 0x7d, 0x67, 0x71, 0x27, 0xd7, 0xcd, 0x65, - 0xf4, 0x47, 0x50, 0xbb, 0x42, 0x04, 0x5b, 0x37, 0x92, 0xd5, 0x2a, 0x71, 0x23, 0xab, 0x8c, 0xa8, - 0xc4, 0xf5, 0x8f, 0xa0, 0x46, 0x3c, 0x14, 0x90, 0x6b, 0x9f, 0xf2, 0xd4, 0x69, 0x95, 0xb9, 0x6f, - 0xab, 0x5d, 0x99, 0x90, 0x2c, 0x73, 0xcc, 0xaa, 0x12, 0x61, 0x2b, 0x63, 0x00, 0x3b, 0x59, 0xbf, - 0xc9, 0xf0, 0xea, 0x41, 0x29, 0x56, 0x26, 0x22, 0x6b, 0xab, 0x9b, 0xd4, 0x92, 0x58, 0x3c, 0x16, - 0x32, 0xfe, 0xa2, 0x81, 0x2e, 0xce, 0x3a, 0x67, 0xb7, 0xa5, 0x02, 0xa0, 0x9d, 0x39, 0xa7, 0x9c, - 0x6c, 0xd1, 0xdf, 0x07, 0xe0, 0x37, 0x2b, 0xfc, 0x96, 0xe3, 0xdc, 0x32, 0xa7, 0x9c, 0xce, 0xc5, - 0x49, 0x3e, 0x1d, 0x27, 0x8f, 0xa1, 0xee, 0x78, 0xb6, 0x3b, 0x1d, 0x62, 0x2b, 0x40, 0x21, 0xcb, - 0xf0, 0x35, 0xce, 0xae, 0x49, 0xea, 0x19, 0x27, 0x1a, 0x7f, 0xd3, 0x60, 0x6b, 0x0e, 0xce, 0x5b, - 0xda, 0xa5, 0x3f, 0x81, 0x02, 0x87, 0x14, 0x67, 0x4a, 0x22, 0x2d, 0x4e, 0x16, 0xec, 0x38, 0x1c, - 0x2d, 0xe4, 0x86, 0x18, 0x0d, 0x23, 0x0b, 0xdf, 0x39, 0x84, 0x12, 0x09, 0x5e, 0x84, 0xd0, 0x81, - 0x60, 0xf5, 0x39, 0xc7, 0xf8, 0x35, 0x6c, 0x1f, 0x63, 0x17, 0x2f, 0x26, 0xcd, 0x7d, 0x77, 0xf6, -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7c, 0xd6, 0x70, 0xa8, 0x82, 0xb0, 0x2c, 0x28, 0xc7, 0x43, 0xd7, 0xf8, 0x47, 0x0e, 0xb6, 0x96, - 0xc1, 0x68, 0x43, 0xe9, 0xd6, 0x0f, 0x6f, 0x46, 0xae, 0x7f, 0xab, 0x4c, 0x57, 0x6b, 0xfd, 0x43, - 0xd8, 0x90, 0xfa, 0xe7, 0xa2, 0xaa, 0x6c, 0xd6, 0x05, 0x39, 0x8e, 0xc5, 0x0f, 0x61, 0x43, 0xda, - 0x12, 0x0b, 0x0a, 0x00, 0x75, 0x41, 0x3e, 0x49, 0x1e, 0x94, 0x1b, 0x84, 0xfa, 0x81, 0x25, 0xfe, - 0x86, 0xb1, 0xfd, 0x20, 0x52, 0x2f, 0x25, 0x46, 0x3e, 0x60, 0xd4, 0x23, 0x3f, 0x88, 0xf4, 0xcf, - 0xe5, 0xcb, 0xc7, 0x22, 0x12, 0x67, 0xab, 0xc0, 0xc3, 0xe7, 0x51, 0xca, 0x9d, 0xab, 0x6e, 0x56, - 0xbe, 0x83, 0x62, 0x0b, 0x55, 0x5e, 0x16, 0x53, 0x79, 0xf9, 0x41, 0xdc, 0x6f, 0x69, 0x14, 0x60, - 0xc2, 0xff, 0x87, 0x28, 0xab, 0xc6, 0x7a, 0xc1, 0x48, 0x87, 0xcf, 0xff, 0xf5, 0x6a, 0x57, 0xfb, - 0xf7, 0xab, 0x5d, 0xed, 0x3f, 0xaf, 0x76, 0xb5, 0xbf, 0xfe, 0x77, 0xf7, 0x7b, 0xbf, 0x7d, 0x32, - 0x73, 0x28, 0x26, 0xa4, 0xeb, 0xf8, 0x3d, 0xf1, 0xd5, 0x1b, 0xfb, 0xbd, 0x19, 0xed, 0xf1, 0x3f, - 0xfb, 0x7a, 0x31, 0xb0, 0xab, 0x22, 0x27, 0x7c, 0xfc, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa3, - 0x2e, 0x4b, 0x36, 0x80, 0x14, 0x00, 0x00, + // 2045 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xcb, 0x6f, 0xdb, 0xc8, + 0x19, 0x2f, 0xf5, 0xb2, 0xf4, 0xe9, 0xe5, 0xd0, 0xb2, 0xad, 0x68, 0x13, 0x37, 0x61, 0x1a, 0xaf, + 0x90, 0x76, 0xa5, 0x6c, 0x16, 0x0d, 0x82, 0x74, 0x5b, 0x24, 0xb1, 0x95, 0xc0, 0x9b, 0xad, 0xeb, + 0xd2, 0x46, 0x0a, 0xb4, 0x40, 0x09, 0x9a, 0x1c, 0x29, 0x44, 0x28, 0x92, 0xcb, 0x19, 0xc9, 0xe6, + 0xf6, 0xd0, 0x4b, 0x7b, 0x58, 0xa0, 0x40, 0xaf, 0x05, 0xf6, 0xd2, 0x53, 0x8f, 0x3d, 0xee, 0xa1, + 0x28, 0x7a, 0x2c, 0x7a, 0xec, 0x9f, 0x50, 0xa4, 0x7f, 0x46, 0x2f, 0xc5, 0xbc, 0x48, 0x8a, 0x7a, + 0xc4, 0x71, 0x02, 0x14, 0x3d, 0x59, 0xf3, 0x3d, 0xe6, 0xfb, 0x7d, 0x8f, 0xf9, 0xe6, 0x1b, 0x1a, + 0x9a, 0x53, 0x62, 0x11, 0xd7, 0x36, 0x89, 0xd9, 0x0b, 0x42, 0x9f, 0xf8, 0x6a, 0x25, 0x26, 0x74, + 0xea, 0xae, 0x3f, 0x9a, 0x10, 0xc7, 0xe5, 0x9c, 0x4e, 0x63, 0x1c, 0xe1, 0x2f, 0x5c, 0x8b, 0xc8, + 0xf5, 0x36, 0x31, 0x4f, 0x5d, 0x44, 0xc6, 0xa6, 0x67, 0x8e, 0x50, 0x98, 0x6c, 0xd1, 0x69, 0x10, + 0x3f, 0xf0, 0x53, 0xeb, 0xfa, 0x14, 0x5b, 0x2f, 0xd1, 0x58, 0x2e, 0x6b, 0x53, 0x42, 0x9c, 0x31, + 0xe2, 0x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7f, 0xf8, + 0xf7, 0xce, 0xb7, 0x7e, 0xbe, 0x3b, 0x75, 0x08, 0xc2, 0xb8, 0xe7, 0xf8, 0x7d, 0xfe, 0xab, 0x3f, + 0xf2, 0xfb, 0x53, 0xd2, 0x67, 0xff, 0x68, 0xe9, 0xc7, 0xc0, 0x4e, 0x4b, 0x8c, 0xf0, 0xc9, 0x7f, + 0x03, 0x00, 0x00, 0xff, 0xff, 0xca, 0xc4, 0x4c, 0xca, 0xfc, 0x19, 0x00, 0x00, } func (m *ExecuteVtctlCommandRequest) Marshal() (dAtA []byte, err error) { @@ -3688,7 +4283,7 @@ func (m *DeleteTabletsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *GetBackupsRequest) Marshal() (dAtA []byte, err error) { +func (m *EmergencyReparentShardRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3698,12 +4293,12 @@ func (m *GetBackupsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetBackupsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *EmergencyReparentShardRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetBackupsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EmergencyReparentShardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3712,6 +4307,44 @@ func (m *GetBackupsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if m.WaitReplicasTimeout != nil { + { + size, err := m.WaitReplicasTimeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.IgnoreReplicas) > 0 { + for iNdEx := len(m.IgnoreReplicas) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.IgnoreReplicas[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.NewPrimary != nil { + { + size, err := m.NewPrimary.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } if len(m.Shard) > 0 { i -= len(m.Shard) copy(dAtA[i:], m.Shard) @@ -3729,7 +4362,7 @@ func (m *GetBackupsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *GetBackupsResponse) Marshal() (dAtA []byte, err error) { +func (m *EmergencyReparentShardResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -3739,12 +4372,12 @@ func (m *GetBackupsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetBackupsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *EmergencyReparentShardResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetBackupsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *EmergencyReparentShardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -3753,10 +4386,10 @@ func (m *GetBackupsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Backups) > 0 { - for iNdEx := len(m.Backups) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Backups[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -3764,23 +4397,131 @@ func (m *GetBackupsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintVtctldata(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0xa + dAtA[i] = 0x22 } } - return len(dAtA) - i, nil -} - -func (m *GetCellInfoNamesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetCellInfoNamesRequest) MarshalTo(dAtA []byte) (int, error) { + if m.PromotedPrimary != nil { + { + size, err := m.PromotedPrimary.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Shard) > 0 { + i -= len(m.Shard) + copy(dAtA[i:], m.Shard) + i = encodeVarintVtctldata(dAtA, i, uint64(len(m.Shard))) + i-- + dAtA[i] = 0x12 + } + if len(m.Keyspace) > 0 { + i -= len(m.Keyspace) + copy(dAtA[i:], m.Keyspace) + i = encodeVarintVtctldata(dAtA, i, uint64(len(m.Keyspace))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetBackupsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetBackupsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetBackupsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Shard) > 0 { + i -= len(m.Shard) + copy(dAtA[i:], m.Shard) + i = encodeVarintVtctldata(dAtA, i, uint64(len(m.Shard))) + i-- + dAtA[i] = 0x12 + } + if len(m.Keyspace) > 0 { + i -= len(m.Keyspace) + copy(dAtA[i:], m.Keyspace) + i = encodeVarintVtctldata(dAtA, i, uint64(len(m.Keyspace))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GetBackupsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetBackupsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetBackupsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Backups) > 0 { + for iNdEx := len(m.Backups) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Backups[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *GetCellInfoNamesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetCellInfoNamesRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } @@ -4764,6 +5505,150 @@ func (m *InitShardPrimaryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *PlannedReparentShardRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PlannedReparentShardRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PlannedReparentShardRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.WaitReplicasTimeout != nil { + { + size, err := m.WaitReplicasTimeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.AvoidPrimary != nil { + { + size, err := m.AvoidPrimary.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.NewPrimary != nil { + { + size, err := m.NewPrimary.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Shard) > 0 { + i -= len(m.Shard) + copy(dAtA[i:], m.Shard) + i = encodeVarintVtctldata(dAtA, i, uint64(len(m.Shard))) + i-- + dAtA[i] = 0x12 + } + if len(m.Keyspace) > 0 { + i -= len(m.Keyspace) + copy(dAtA[i:], m.Keyspace) + i = encodeVarintVtctldata(dAtA, i, uint64(len(m.Keyspace))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *PlannedReparentShardResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PlannedReparentShardResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PlannedReparentShardResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Events) > 0 { + for iNdEx := len(m.Events) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Events[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.PromotedPrimary != nil { + { + size, err := m.PromotedPrimary.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Shard) > 0 { + i -= len(m.Shard) + copy(dAtA[i:], m.Shard) + i = encodeVarintVtctldata(dAtA, i, uint64(len(m.Shard))) + i-- + dAtA[i] = 0x12 + } + if len(m.Keyspace) > 0 { + i -= len(m.Keyspace) + copy(dAtA[i:], m.Keyspace) + i = encodeVarintVtctldata(dAtA, i, uint64(len(m.Keyspace))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *RemoveKeyspaceCellRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -4947,7 +5832,7 @@ func (m *RemoveShardCellResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *Keyspace) Marshal() (dAtA []byte, err error) { +func (m *ReparentTabletRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4957,12 +5842,12 @@ func (m *Keyspace) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Keyspace) MarshalTo(dAtA []byte) (int, error) { +func (m *ReparentTabletRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Keyspace) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ReparentTabletRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4971,7 +5856,203 @@ func (m *Keyspace) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if m.Keyspace != nil { + if m.Tablet != nil { + { + size, err := m.Tablet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ReparentTabletResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ReparentTabletResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ReparentTabletResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Primary != nil { + { + size, err := m.Primary.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Shard) > 0 { + i -= len(m.Shard) + copy(dAtA[i:], m.Shard) + i = encodeVarintVtctldata(dAtA, i, uint64(len(m.Shard))) + i-- + dAtA[i] = 0x12 + } + if len(m.Keyspace) > 0 { + i -= len(m.Keyspace) + copy(dAtA[i:], m.Keyspace) + i = encodeVarintVtctldata(dAtA, i, uint64(len(m.Keyspace))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TabletExternallyReparentedRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TabletExternallyReparentedRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TabletExternallyReparentedRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Tablet != nil { + { + size, err := m.Tablet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TabletExternallyReparentedResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TabletExternallyReparentedResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TabletExternallyReparentedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.OldPrimary != nil { + { + size, err := m.OldPrimary.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.NewPrimary != nil { + { + size, err := m.NewPrimary.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVtctldata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Shard) > 0 { + i -= len(m.Shard) + copy(dAtA[i:], m.Shard) + i = encodeVarintVtctldata(dAtA, i, uint64(len(m.Shard))) + i-- + dAtA[i] = 0x12 + } + if len(m.Keyspace) > 0 { + i -= len(m.Keyspace) + copy(dAtA[i:], m.Keyspace) + i = encodeVarintVtctldata(dAtA, i, uint64(len(m.Keyspace))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Keyspace) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Keyspace) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Keyspace) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Keyspace != nil { { size, err := m.Keyspace.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -5571,6 +6652,70 @@ func (m *DeleteTabletsResponse) Size() (n int) { return n } +func (m *EmergencyReparentShardRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Keyspace) + if l > 0 { + n += 1 + l + sovVtctldata(uint64(l)) + } + l = len(m.Shard) + if l > 0 { + n += 1 + l + sovVtctldata(uint64(l)) + } + if m.NewPrimary != nil { + l = m.NewPrimary.Size() + n += 1 + l + sovVtctldata(uint64(l)) + } + if len(m.IgnoreReplicas) > 0 { + for _, e := range m.IgnoreReplicas { + l = e.Size() + n += 1 + l + sovVtctldata(uint64(l)) + } + } + if m.WaitReplicasTimeout != nil { + l = m.WaitReplicasTimeout.Size() + n += 1 + l + sovVtctldata(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *EmergencyReparentShardResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Keyspace) + if l > 0 { + n += 1 + l + sovVtctldata(uint64(l)) + } + l = len(m.Shard) + if l > 0 { + n += 1 + l + sovVtctldata(uint64(l)) + } + if m.PromotedPrimary != nil { + l = m.PromotedPrimary.Size() + n += 1 + l + sovVtctldata(uint64(l)) + } + if len(m.Events) > 0 { + for _, e := range m.Events { + l = e.Size() + n += 1 + l + sovVtctldata(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *GetBackupsRequest) Size() (n int) { if m == nil { return 0 @@ -6048,7 +7193,7 @@ func (m *InitShardPrimaryResponse) Size() (n int) { return n } -func (m *RemoveKeyspaceCellRequest) Size() (n int) { +func (m *PlannedReparentShardRequest) Size() (n int) { if m == nil { return 0 } @@ -6058,15 +7203,21 @@ func (m *RemoveKeyspaceCellRequest) Size() (n int) { if l > 0 { n += 1 + l + sovVtctldata(uint64(l)) } - l = len(m.Cell) + l = len(m.Shard) if l > 0 { n += 1 + l + sovVtctldata(uint64(l)) } - if m.Force { - n += 2 + if m.NewPrimary != nil { + l = m.NewPrimary.Size() + n += 1 + l + sovVtctldata(uint64(l)) } - if m.Recursive { - n += 2 + if m.AvoidPrimary != nil { + l = m.AvoidPrimary.Size() + n += 1 + l + sovVtctldata(uint64(l)) + } + if m.WaitReplicasTimeout != nil { + l = m.WaitReplicasTimeout.Size() + n += 1 + l + sovVtctldata(uint64(l)) } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -6074,14 +7225,70 @@ func (m *RemoveKeyspaceCellRequest) Size() (n int) { return n } -func (m *RemoveKeyspaceCellResponse) Size() (n int) { +func (m *PlannedReparentShardResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + l = len(m.Keyspace) + if l > 0 { + n += 1 + l + sovVtctldata(uint64(l)) + } + l = len(m.Shard) + if l > 0 { + n += 1 + l + sovVtctldata(uint64(l)) + } + if m.PromotedPrimary != nil { + l = m.PromotedPrimary.Size() + n += 1 + l + sovVtctldata(uint64(l)) + } + if len(m.Events) > 0 { + for _, e := range m.Events { + l = e.Size() + n += 1 + l + sovVtctldata(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RemoveKeyspaceCellRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Keyspace) + if l > 0 { + n += 1 + l + sovVtctldata(uint64(l)) + } + l = len(m.Cell) + if l > 0 { + n += 1 + l + sovVtctldata(uint64(l)) + } + if m.Force { + n += 2 + } + if m.Recursive { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RemoveKeyspaceCellResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) } return n } @@ -6128,6 +7335,90 @@ func (m *RemoveShardCellResponse) Size() (n int) { return n } +func (m *ReparentTabletRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Tablet != nil { + l = m.Tablet.Size() + n += 1 + l + sovVtctldata(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ReparentTabletResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Keyspace) + if l > 0 { + n += 1 + l + sovVtctldata(uint64(l)) + } + l = len(m.Shard) + if l > 0 { + n += 1 + l + sovVtctldata(uint64(l)) + } + if m.Primary != nil { + l = m.Primary.Size() + n += 1 + l + sovVtctldata(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TabletExternallyReparentedRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Tablet != nil { + l = m.Tablet.Size() + n += 1 + l + sovVtctldata(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TabletExternallyReparentedResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Keyspace) + if l > 0 { + n += 1 + l + sovVtctldata(uint64(l)) + } + l = len(m.Shard) + if l > 0 { + n += 1 + l + sovVtctldata(uint64(l)) + } + if m.NewPrimary != nil { + l = m.NewPrimary.Size() + n += 1 + l + sovVtctldata(uint64(l)) + } + if m.OldPrimary != nil { + l = m.OldPrimary.Size() + n += 1 + l + sovVtctldata(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + func (m *Keyspace) Size() (n int) { if m == nil { return 0 @@ -6327,29 +7618,1535 @@ func (m *ExecuteVtctlCommandRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ActionTimeout", wireType) + } + m.ActionTimeout = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ActionTimeout |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExecuteVtctlCommandResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExecuteVtctlCommandResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExecuteVtctlCommandResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Event == nil { + m.Event = &logutil.Event{} + } + if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChangeTabletTypeRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChangeTabletTypeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChangeTabletTypeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TabletAlias", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TabletAlias == nil { + m.TabletAlias = &topodata.TabletAlias{} + } + if err := m.TabletAlias.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DbType", wireType) + } + m.DbType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DbType |= topodata.TabletType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DryRun", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DryRun = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ChangeTabletTypeResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ChangeTabletTypeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChangeTabletTypeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BeforeTablet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BeforeTablet == nil { + m.BeforeTablet = &topodata.Tablet{} + } + if err := m.BeforeTablet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AfterTablet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AfterTablet == nil { + m.AfterTablet = &topodata.Tablet{} + } + if err := m.AfterTablet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WasDryRun", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.WasDryRun = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateKeyspaceRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateKeyspaceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateKeyspaceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Force = bool(v != 0) + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowEmptyVSchema", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AllowEmptyVSchema = bool(v != 0) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardingColumnName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ShardingColumnName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardingColumnType", wireType) + } + m.ShardingColumnType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ShardingColumnType |= topodata.KeyspaceIdType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServedFroms", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServedFroms = append(m.ServedFroms, &topodata.Keyspace_ServedFrom{}) + if err := m.ServedFroms[len(m.ServedFroms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= topodata.KeyspaceType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseKeyspace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BaseKeyspace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SnapshotTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SnapshotTime == nil { + m.SnapshotTime = &vttime.Time{} + } + if err := m.SnapshotTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateKeyspaceResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateKeyspaceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateKeyspaceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Keyspace == nil { + m.Keyspace = &Keyspace{} + } + if err := m.Keyspace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateShardRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateShardRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateShardRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keyspace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ShardName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Force = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IncludeParent", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludeParent = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CreateShardResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CreateShardResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CreateShardResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Keyspace == nil { + m.Keyspace = &Keyspace{} + } + if err := m.Keyspace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Shard == nil { + m.Shard = &Shard{} + } + if err := m.Shard.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ShardAlreadyExists", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ShardAlreadyExists = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteKeyspaceRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteKeyspaceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteKeyspaceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keyspace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Recursive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Recursive = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteKeyspaceResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteKeyspaceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteKeyspaceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteShardsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteShardsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteShardsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Shards = append(m.Shards, &Shard{}) + if err := m.Shards[len(m.Shards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Recursive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Recursive = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EvenIfServing", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.EvenIfServing = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteShardsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteShardsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteShardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *DeleteTabletsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DeleteTabletsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DeleteTabletsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TabletAliases", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthVtctldata } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthVtctldata } if postIndex > l { return io.ErrUnexpectedEOF } - m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) + m.TabletAliases = append(m.TabletAliases, &topodata.TabletAlias{}) + if err := m.TabletAliases[len(m.TabletAliases)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ActionTimeout", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AllowPrimary", wireType) } - m.ActionTimeout = 0 + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -6359,11 +9156,12 @@ func (m *ExecuteVtctlCommandRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ActionTimeout |= int64(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } + m.AllowPrimary = bool(v != 0) default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -6389,7 +9187,7 @@ func (m *ExecuteVtctlCommandRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *ExecuteVtctlCommandResponse) Unmarshal(dAtA []byte) error { +func (m *DeleteTabletsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6412,48 +9210,12 @@ func (m *ExecuteVtctlCommandResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ExecuteVtctlCommandResponse: wiretype end group for non-group") + return fmt.Errorf("proto: DeleteTabletsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ExecuteVtctlCommandResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeleteTabletsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthVtctldata - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthVtctldata - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Event == nil { - m.Event = &logutil.Event{} - } - if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -6479,7 +9241,7 @@ func (m *ExecuteVtctlCommandResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *ChangeTabletTypeRequest) Unmarshal(dAtA []byte) error { +func (m *EmergencyReparentShardRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6502,17 +9264,17 @@ func (m *ChangeTabletTypeRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ChangeTabletTypeRequest: wiretype end group for non-group") + return fmt.Errorf("proto: EmergencyReparentShardRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ChangeTabletTypeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EmergencyReparentShardRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TabletAlias", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -6522,33 +9284,29 @@ func (m *ChangeTabletTypeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthVtctldata } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthVtctldata } if postIndex > l { return io.ErrUnexpectedEOF } - if m.TabletAlias == nil { - m.TabletAlias = &topodata.TabletAlias{} - } - if err := m.TabletAlias.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Keyspace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DbType", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) } - m.DbType = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -6558,16 +9316,29 @@ func (m *ChangeTabletTypeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.DbType |= topodata.TabletType(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Shard = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DryRun", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewPrimary", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -6577,69 +9348,31 @@ func (m *ChangeTabletTypeRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.DryRun = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipVtctldata(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { + if msglen < 0 { return ErrInvalidLengthVtctldata } - if (iNdEx + skippy) < 0 { + postIndex := iNdEx + msglen + if postIndex < 0 { return ErrInvalidLengthVtctldata } - if (iNdEx + skippy) > l { + if postIndex > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ChangeTabletTypeResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if m.NewPrimary == nil { + m.NewPrimary = &topodata.TabletAlias{} } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if err := m.NewPrimary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ChangeTabletTypeResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChangeTabletTypeResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BeforeTablet", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field IgnoreReplicas", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6666,16 +9399,14 @@ func (m *ChangeTabletTypeResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.BeforeTablet == nil { - m.BeforeTablet = &topodata.Tablet{} - } - if err := m.BeforeTablet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.IgnoreReplicas = append(m.IgnoreReplicas, &topodata.TabletAlias{}) + if err := m.IgnoreReplicas[len(m.IgnoreReplicas)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AfterTablet", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WaitReplicasTimeout", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6702,33 +9433,13 @@ func (m *ChangeTabletTypeResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.AfterTablet == nil { - m.AfterTablet = &topodata.Tablet{} + if m.WaitReplicasTimeout == nil { + m.WaitReplicasTimeout = &vttime.Duration{} } - if err := m.AfterTablet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.WaitReplicasTimeout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field WasDryRun", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.WasDryRun = bool(v != 0) default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -6754,7 +9465,7 @@ func (m *ChangeTabletTypeResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *CreateKeyspaceRequest) Unmarshal(dAtA []byte) error { +func (m *EmergencyReparentShardResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6777,15 +9488,15 @@ func (m *CreateKeyspaceRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CreateKeyspaceRequest: wiretype end group for non-group") + return fmt.Errorf("proto: EmergencyReparentShardResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CreateKeyspaceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: EmergencyReparentShardResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6813,51 +9524,11 @@ func (m *CreateKeyspaceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Keyspace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Force = bool(v != 0) - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowEmptyVSchema", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AllowEmptyVSchema = bool(v != 0) - case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShardingColumnName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6885,13 +9556,13 @@ func (m *CreateKeyspaceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ShardingColumnName = string(dAtA[iNdEx:postIndex]) + m.Shard = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ShardingColumnType", wireType) + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PromotedPrimary", wireType) } - m.ShardingColumnType = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -6901,14 +9572,31 @@ func (m *CreateKeyspaceRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ShardingColumnType |= topodata.KeyspaceIdType(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 6: + if msglen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PromotedPrimary == nil { + m.PromotedPrimary = &topodata.TabletAlias{} + } + if err := m.PromotedPrimary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServedFroms", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6935,33 +9623,68 @@ func (m *CreateKeyspaceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ServedFroms = append(m.ServedFroms, &topodata.Keyspace_ServedFrom{}) - if err := m.ServedFroms[len(m.ServedFroms)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Events = append(m.Events, &logutil.Event{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= topodata.KeyspaceType(b&0x7F) << shift - if b < 0x80 { - break - } + if skippy < 0 { + return ErrInvalidLengthVtctldata } - case 8: + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetBackupsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetBackupsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetBackupsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BaseKeyspace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6989,13 +9712,13 @@ func (m *CreateKeyspaceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.BaseKeyspace = string(dAtA[iNdEx:postIndex]) + m.Keyspace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 9: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SnapshotTime", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -7005,27 +9728,23 @@ func (m *CreateKeyspaceRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthVtctldata } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthVtctldata } if postIndex > l { return io.ErrUnexpectedEOF } - if m.SnapshotTime == nil { - m.SnapshotTime = &vttime.Time{} - } - if err := m.SnapshotTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Shard = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -7052,7 +9771,7 @@ func (m *CreateKeyspaceRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *CreateKeyspaceResponse) Unmarshal(dAtA []byte) error { +func (m *GetBackupsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7075,15 +9794,15 @@ func (m *CreateKeyspaceResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CreateKeyspaceResponse: wiretype end group for non-group") + return fmt.Errorf("proto: GetBackupsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CreateKeyspaceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetBackupsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Backups", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7110,10 +9829,8 @@ func (m *CreateKeyspaceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Keyspace == nil { - m.Keyspace = &Keyspace{} - } - if err := m.Keyspace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Backups = append(m.Backups, &mysqlctl.BackupInfo{}) + if err := m.Backups[len(m.Backups)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -7142,7 +9859,7 @@ func (m *CreateKeyspaceResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *CreateShardRequest) Unmarshal(dAtA []byte) error { +func (m *GetCellInfoNamesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7165,15 +9882,69 @@ func (m *CreateShardRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CreateShardRequest: wiretype end group for non-group") + return fmt.Errorf("proto: GetCellInfoNamesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CreateShardRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetCellInfoNamesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetCellInfoNamesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetCellInfoNamesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetCellInfoNamesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7201,11 +9972,65 @@ func (m *CreateShardRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Keyspace = string(dAtA[iNdEx:postIndex]) + m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 2: + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetCellInfoRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetCellInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetCellInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShardName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Cell", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -7233,48 +10058,8 @@ func (m *CreateShardRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ShardName = string(dAtA[iNdEx:postIndex]) + m.Cell = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Force = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IncludeParent", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IncludeParent = bool(v != 0) default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -7300,7 +10085,7 @@ func (m *CreateShardRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *CreateShardResponse) Unmarshal(dAtA []byte) error { +func (m *GetCellInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7323,15 +10108,15 @@ func (m *CreateShardResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CreateShardResponse: wiretype end group for non-group") + return fmt.Errorf("proto: GetCellInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CreateShardResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetCellInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CellInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7358,69 +10143,67 @@ func (m *CreateShardResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Keyspace == nil { - m.Keyspace = &Keyspace{} + if m.CellInfo == nil { + m.CellInfo = &topodata.CellInfo{} } - if err := m.Keyspace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.CellInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err } - if msglen < 0 { + if skippy < 0 { return ErrInvalidLengthVtctldata } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (iNdEx + skippy) < 0 { return ErrInvalidLengthVtctldata } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.Shard == nil { - m.Shard = &Shard{} - } - if err := m.Shard.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetCellsAliasesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ShardAlreadyExists", wireType) + if iNdEx >= l { + return io.ErrUnexpectedEOF } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - m.ShardAlreadyExists = bool(v != 0) + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetCellsAliasesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetCellsAliasesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -7446,7 +10229,7 @@ func (m *CreateShardResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeleteKeyspaceRequest) Unmarshal(dAtA []byte) error { +func (m *GetCellsAliasesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7469,17 +10252,17 @@ func (m *DeleteKeyspaceRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteKeyspaceRequest: wiretype end group for non-group") + return fmt.Errorf("proto: GetCellsAliasesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteKeyspaceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetCellsAliasesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -7489,44 +10272,121 @@ func (m *DeleteKeyspaceRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthVtctldata - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthVtctldata - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Keyspace = string(dAtA[iNdEx:postIndex]) + if msglen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Aliases == nil { + m.Aliases = make(map[string]*topodata.CellsAlias) + } + var mapkey string + var mapvalue *topodata.CellsAlias + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthVtctldata + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthVtctldata + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthVtctldata + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &topodata.CellsAlias{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVtctldata + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Aliases[mapkey] = mapvalue iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Recursive", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Recursive = bool(v != 0) default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -7552,7 +10412,7 @@ func (m *DeleteKeyspaceRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeleteKeyspaceResponse) Unmarshal(dAtA []byte) error { +func (m *GetKeyspacesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7575,10 +10435,10 @@ func (m *DeleteKeyspaceResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteKeyspaceResponse: wiretype end group for non-group") + return fmt.Errorf("proto: GetKeyspacesRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteKeyspaceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetKeyspacesRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -7606,7 +10466,7 @@ func (m *DeleteKeyspaceResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeleteShardsRequest) Unmarshal(dAtA []byte) error { +func (m *GetKeyspacesResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7629,15 +10489,15 @@ func (m *DeleteShardsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteShardsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: GetKeyspacesResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteShardsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetKeyspacesResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shards", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Keyspaces", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7664,51 +10524,11 @@ func (m *DeleteShardsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Shards = append(m.Shards, &Shard{}) - if err := m.Shards[len(m.Shards)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Keyspaces = append(m.Keyspaces, &Keyspace{}) + if err := m.Keyspaces[len(m.Keyspaces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Recursive", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Recursive = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EvenIfServing", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EvenIfServing = bool(v != 0) default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -7734,7 +10554,7 @@ func (m *DeleteShardsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeleteShardsResponse) Unmarshal(dAtA []byte) error { +func (m *GetKeyspaceRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7757,12 +10577,44 @@ func (m *DeleteShardsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteShardsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: GetKeyspaceRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteShardsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetKeyspaceRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keyspace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -7788,7 +10640,7 @@ func (m *DeleteShardsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeleteTabletsRequest) Unmarshal(dAtA []byte) error { +func (m *GetKeyspaceResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7811,15 +10663,15 @@ func (m *DeleteTabletsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteTabletsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: GetKeyspaceResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteTabletsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetKeyspaceResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TabletAliases", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -7846,31 +10698,13 @@ func (m *DeleteTabletsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.TabletAliases = append(m.TabletAliases, &topodata.TabletAlias{}) - if err := m.TabletAliases[len(m.TabletAliases)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Keyspace == nil { + m.Keyspace = &Keyspace{} + } + if err := m.Keyspace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AllowPrimary", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.AllowPrimary = bool(v != 0) default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -7896,7 +10730,7 @@ func (m *DeleteTabletsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeleteTabletsResponse) Unmarshal(dAtA []byte) error { +func (m *GetSchemaRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -7919,69 +10753,51 @@ func (m *DeleteTabletsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeleteTabletsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: GetSchemaRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeleteTabletsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetSchemaRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipVtctldata(dAtA[iNdEx:]) - if err != nil { - return err + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TabletAlias", wireType) } - if skippy < 0 { + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { return ErrInvalidLengthVtctldata } - if (iNdEx + skippy) < 0 { + postIndex := iNdEx + msglen + if postIndex < 0 { return ErrInvalidLengthVtctldata } - if (iNdEx + skippy) > l { + if postIndex > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetBackupsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if m.TabletAlias == nil { + m.TabletAlias = &topodata.TabletAlias{} } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if err := m.TabletAlias.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetBackupsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetBackupsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tables", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8009,11 +10825,11 @@ func (m *GetBackupsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Keyspace = string(dAtA[iNdEx:postIndex]) + m.Tables = append(m.Tables, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExcludeTables", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8041,8 +10857,68 @@ func (m *GetBackupsRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Shard = string(dAtA[iNdEx:postIndex]) + m.ExcludeTables = append(m.ExcludeTables, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IncludeViews", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IncludeViews = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TableNamesOnly", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TableNamesOnly = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TableSizesOnly", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TableSizesOnly = bool(v != 0) default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -8068,7 +10944,7 @@ func (m *GetBackupsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetBackupsResponse) Unmarshal(dAtA []byte) error { +func (m *GetSchemaResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8091,15 +10967,15 @@ func (m *GetBackupsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetBackupsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: GetSchemaResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetBackupsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetSchemaResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Backups", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8126,8 +11002,10 @@ func (m *GetBackupsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Backups = append(m.Backups, &mysqlctl.BackupInfo{}) - if err := m.Backups[len(m.Backups)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Schema == nil { + m.Schema = &tabletmanagerdata.SchemaDefinition{} + } + if err := m.Schema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -8156,7 +11034,7 @@ func (m *GetBackupsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetCellInfoNamesRequest) Unmarshal(dAtA []byte) error { +func (m *GetShardRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8179,69 +11057,47 @@ func (m *GetCellInfoNamesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetCellInfoNamesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: GetShardRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetCellInfoNamesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetShardRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipVtctldata(dAtA[iNdEx:]) - if err != nil { - return err + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) } - if skippy < 0 { - return ErrInvalidLengthVtctldata + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthVtctldata } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetCellInfoNamesResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetCellInfoNamesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetCellInfoNamesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.Keyspace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ShardName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8269,7 +11125,7 @@ func (m *GetCellInfoNamesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) + m.ShardName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -8296,7 +11152,7 @@ func (m *GetCellInfoNamesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetCellInfoRequest) Unmarshal(dAtA []byte) error { +func (m *GetShardResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8319,17 +11175,17 @@ func (m *GetCellInfoRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetCellInfoRequest: wiretype end group for non-group") + return fmt.Errorf("proto: GetShardResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetCellInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetShardResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cell", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -8339,23 +11195,27 @@ func (m *GetCellInfoRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthVtctldata } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthVtctldata } if postIndex > l { return io.ErrUnexpectedEOF } - m.Cell = string(dAtA[iNdEx:postIndex]) + if m.Shard == nil { + m.Shard = &Shard{} + } + if err := m.Shard.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -8382,7 +11242,7 @@ func (m *GetCellInfoRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetCellInfoResponse) Unmarshal(dAtA []byte) error { +func (m *GetSrvVSchemaRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8405,17 +11265,17 @@ func (m *GetCellInfoResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetCellInfoResponse: wiretype end group for non-group") + return fmt.Errorf("proto: GetSrvVSchemaRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetCellInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetSrvVSchemaRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CellInfo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Cell", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -8425,82 +11285,24 @@ func (m *GetCellInfoResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthVtctldata } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthVtctldata } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.CellInfo == nil { - m.CellInfo = &topodata.CellInfo{} - } - if err := m.CellInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipVtctldata(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthVtctldata - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthVtctldata - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetCellsAliasesRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if postIndex > l { + return io.ErrUnexpectedEOF } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetCellsAliasesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetCellsAliasesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + m.Cell = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -8526,7 +11328,7 @@ func (m *GetCellsAliasesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetCellsAliasesResponse) Unmarshal(dAtA []byte) error { +func (m *GetSrvVSchemaResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8549,15 +11351,15 @@ func (m *GetCellsAliasesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetCellsAliasesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: GetSrvVSchemaResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetCellsAliasesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetSrvVSchemaResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aliases", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SrvVSchema", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8584,105 +11386,12 @@ func (m *GetCellsAliasesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Aliases == nil { - m.Aliases = make(map[string]*topodata.CellsAlias) + if m.SrvVSchema == nil { + m.SrvVSchema = &vschema.SrvVSchema{} } - var mapkey string - var mapvalue *topodata.CellsAlias - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthVtctldata - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthVtctldata - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthVtctldata - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthVtctldata - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &topodata.CellsAlias{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipVtctldata(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthVtctldata - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } + if err := m.SrvVSchema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Aliases[mapkey] = mapvalue iNdEx = postIndex default: iNdEx = preIndex @@ -8709,7 +11418,7 @@ func (m *GetCellsAliasesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetKeyspacesRequest) Unmarshal(dAtA []byte) error { +func (m *GetTabletRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8732,12 +11441,48 @@ func (m *GetKeyspacesRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetKeyspacesRequest: wiretype end group for non-group") + return fmt.Errorf("proto: GetTabletRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetKeyspacesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetTabletRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TabletAlias", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TabletAlias == nil { + m.TabletAlias = &topodata.TabletAlias{} + } + if err := m.TabletAlias.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -8763,7 +11508,7 @@ func (m *GetKeyspacesRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetKeyspacesResponse) Unmarshal(dAtA []byte) error { +func (m *GetTabletResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8786,15 +11531,15 @@ func (m *GetKeyspacesResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetKeyspacesResponse: wiretype end group for non-group") + return fmt.Errorf("proto: GetTabletResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetKeyspacesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetTabletResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keyspaces", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tablet", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8821,8 +11566,10 @@ func (m *GetKeyspacesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Keyspaces = append(m.Keyspaces, &Keyspace{}) - if err := m.Keyspaces[len(m.Keyspaces)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Tablet == nil { + m.Tablet = &topodata.Tablet{} + } + if err := m.Tablet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -8851,7 +11598,7 @@ func (m *GetKeyspacesResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetKeyspaceRequest) Unmarshal(dAtA []byte) error { +func (m *GetTabletsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8870,19 +11617,83 @@ func (m *GetKeyspaceRequest) Unmarshal(dAtA []byte) error { if b < 0x80 { break } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetKeyspaceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetKeyspaceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetTabletsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetTabletsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keyspace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Shard = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Cells", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -8910,7 +11721,7 @@ func (m *GetKeyspaceRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Keyspace = string(dAtA[iNdEx:postIndex]) + m.Cells = append(m.Cells, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -8937,7 +11748,7 @@ func (m *GetKeyspaceRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetKeyspaceResponse) Unmarshal(dAtA []byte) error { +func (m *GetTabletsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -8960,15 +11771,15 @@ func (m *GetKeyspaceResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetKeyspaceResponse: wiretype end group for non-group") + return fmt.Errorf("proto: GetTabletsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetKeyspaceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetTabletsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tablets", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -8995,10 +11806,8 @@ func (m *GetKeyspaceResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Keyspace == nil { - m.Keyspace = &Keyspace{} - } - if err := m.Keyspace.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Tablets = append(m.Tablets, &topodata.Tablet{}) + if err := m.Tablets[len(m.Tablets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -9027,7 +11836,7 @@ func (m *GetKeyspaceResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetSchemaRequest) Unmarshal(dAtA []byte) error { +func (m *GetVSchemaRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9050,83 +11859,15 @@ func (m *GetSchemaRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetSchemaRequest: wiretype end group for non-group") + return fmt.Errorf("proto: GetVSchemaRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetSchemaRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetVSchemaRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TabletAlias", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthVtctldata - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthVtctldata - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TabletAlias == nil { - m.TabletAlias = &topodata.TabletAlias{} - } - if err := m.TabletAlias.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tables", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthVtctldata - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthVtctldata - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tables = append(m.Tables, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExcludeTables", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9154,68 +11895,8 @@ func (m *GetSchemaRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ExcludeTables = append(m.ExcludeTables, string(dAtA[iNdEx:postIndex])) + m.Keyspace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IncludeViews", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IncludeViews = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TableNamesOnly", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.TableNamesOnly = bool(v != 0) - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TableSizesOnly", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.TableSizesOnly = bool(v != 0) default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -9241,7 +11922,7 @@ func (m *GetSchemaRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetSchemaResponse) Unmarshal(dAtA []byte) error { +func (m *GetVSchemaResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9264,15 +11945,15 @@ func (m *GetSchemaResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetSchemaResponse: wiretype end group for non-group") + return fmt.Errorf("proto: GetVSchemaResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetSchemaResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetVSchemaResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field VSchema", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9299,10 +11980,10 @@ func (m *GetSchemaResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Schema == nil { - m.Schema = &tabletmanagerdata.SchemaDefinition{} + if m.VSchema == nil { + m.VSchema = &vschema.Keyspace{} } - if err := m.Schema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.VSchema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -9331,7 +12012,7 @@ func (m *GetSchemaResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetShardRequest) Unmarshal(dAtA []byte) error { +func (m *InitShardPrimaryRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9354,10 +12035,10 @@ func (m *GetShardRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetShardRequest: wiretype end group for non-group") + return fmt.Errorf("proto: InitShardPrimaryRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetShardRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: InitShardPrimaryRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -9374,29 +12055,117 @@ func (m *GetShardRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keyspace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Shard = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PrimaryElectTabletAlias", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthVtctldata } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthVtctldata } if postIndex > l { return io.ErrUnexpectedEOF } - m.Keyspace = string(dAtA[iNdEx:postIndex]) + if m.PrimaryElectTabletAlias == nil { + m.PrimaryElectTabletAlias = &topodata.TabletAlias{} + } + if err := m.PrimaryElectTabletAlias.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Force = bool(v != 0) + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShardName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WaitReplicasTimeout", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -9406,23 +12175,27 @@ func (m *GetShardRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthVtctldata } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthVtctldata } if postIndex > l { return io.ErrUnexpectedEOF } - m.ShardName = string(dAtA[iNdEx:postIndex]) + if m.WaitReplicasTimeout == nil { + m.WaitReplicasTimeout = &vttime.Duration{} + } + if err := m.WaitReplicasTimeout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -9449,7 +12222,7 @@ func (m *GetShardRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetShardResponse) Unmarshal(dAtA []byte) error { +func (m *InitShardPrimaryResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9472,15 +12245,15 @@ func (m *GetShardResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetShardResponse: wiretype end group for non-group") + return fmt.Errorf("proto: InitShardPrimaryResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetShardResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: InitShardPrimaryResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9507,10 +12280,8 @@ func (m *GetShardResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Shard == nil { - m.Shard = &Shard{} - } - if err := m.Shard.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Events = append(m.Events, &logutil.Event{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -9539,7 +12310,7 @@ func (m *GetShardResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetSrvVSchemaRequest) Unmarshal(dAtA []byte) error { +func (m *PlannedReparentShardRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9562,15 +12333,15 @@ func (m *GetSrvVSchemaRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetSrvVSchemaRequest: wiretype end group for non-group") + return fmt.Errorf("proto: PlannedReparentShardRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetSrvVSchemaRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PlannedReparentShardRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cell", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -9598,65 +12369,43 @@ func (m *GetSrvVSchemaRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Cell = string(dAtA[iNdEx:postIndex]) + m.Keyspace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipVtctldata(dAtA[iNdEx:]) - if err != nil { - return err + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) } - if skippy < 0 { - return ErrInvalidLengthVtctldata + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthVtctldata } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetSrvVSchemaResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetSrvVSchemaResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetSrvVSchemaResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.Shard = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SrvVSchema", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NewPrimary", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9683,70 +12432,16 @@ func (m *GetSrvVSchemaResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.SrvVSchema == nil { - m.SrvVSchema = &vschema.SrvVSchema{} + if m.NewPrimary == nil { + m.NewPrimary = &topodata.TabletAlias{} } - if err := m.SrvVSchema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.NewPrimary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipVtctldata(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthVtctldata - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthVtctldata - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetTabletRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetTabletRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetTabletRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TabletAlias", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AvoidPrimary", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9770,73 +12465,19 @@ func (m *GetTabletRequest) Unmarshal(dAtA []byte) error { if postIndex < 0 { return ErrInvalidLengthVtctldata } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.TabletAlias == nil { - m.TabletAlias = &topodata.TabletAlias{} - } - if err := m.TabletAlias.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipVtctldata(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthVtctldata - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthVtctldata - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetTabletResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if m.AvoidPrimary == nil { + m.AvoidPrimary = &topodata.TabletAlias{} } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetTabletResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetTabletResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + if err := m.AvoidPrimary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tablet", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field WaitReplicasTimeout", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -9863,10 +12504,10 @@ func (m *GetTabletResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Tablet == nil { - m.Tablet = &topodata.Tablet{} + if m.WaitReplicasTimeout == nil { + m.WaitReplicasTimeout = &vttime.Duration{} } - if err := m.Tablet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.WaitReplicasTimeout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -9895,7 +12536,7 @@ func (m *GetTabletResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetTabletsRequest) Unmarshal(dAtA []byte) error { +func (m *PlannedReparentShardResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -9918,10 +12559,10 @@ func (m *GetTabletsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetTabletsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: PlannedReparentShardResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetTabletsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: PlannedReparentShardResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -9990,9 +12631,9 @@ func (m *GetTabletsRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cells", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field PromotedPrimary", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -10002,81 +12643,31 @@ func (m *GetTabletsRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthVtctldata } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthVtctldata } if postIndex > l { return io.ErrUnexpectedEOF } - m.Cells = append(m.Cells, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipVtctldata(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthVtctldata - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthVtctldata - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetTabletsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if m.PromotedPrimary == nil { + m.PromotedPrimary = &topodata.TabletAlias{} } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if err := m.PromotedPrimary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GetTabletsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetTabletsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + iNdEx = postIndex + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tablets", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10103,8 +12694,8 @@ func (m *GetTabletsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Tablets = append(m.Tablets, &topodata.Tablet{}) - if err := m.Tablets[len(m.Tablets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Events = append(m.Events, &logutil.Event{}) + if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -10133,7 +12724,7 @@ func (m *GetTabletsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetVSchemaRequest) Unmarshal(dAtA []byte) error { +func (m *RemoveKeyspaceCellRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10156,10 +12747,10 @@ func (m *GetVSchemaRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetVSchemaRequest: wiretype end group for non-group") + return fmt.Errorf("proto: RemoveKeyspaceCellRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetVSchemaRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RemoveKeyspaceCellRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -10194,6 +12785,78 @@ func (m *GetVSchemaRequest) Unmarshal(dAtA []byte) error { } m.Keyspace = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cell", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cell = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Force = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Recursive", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Recursive = bool(v != 0) default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -10219,7 +12882,7 @@ func (m *GetVSchemaRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetVSchemaResponse) Unmarshal(dAtA []byte) error { +func (m *RemoveKeyspaceCellResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10242,48 +12905,12 @@ func (m *GetVSchemaResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetVSchemaResponse: wiretype end group for non-group") + return fmt.Errorf("proto: RemoveKeyspaceCellResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetVSchemaResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RemoveKeyspaceCellResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VSchema", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthVtctldata - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthVtctldata - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VSchema == nil { - m.VSchema = &vschema.Keyspace{} - } - if err := m.VSchema.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -10309,7 +12936,7 @@ func (m *GetVSchemaResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *InitShardPrimaryRequest) Unmarshal(dAtA []byte) error { +func (m *RemoveShardCellRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10332,10 +12959,10 @@ func (m *InitShardPrimaryRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: InitShardPrimaryRequest: wiretype end group for non-group") + return fmt.Errorf("proto: RemoveShardCellRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: InitShardPrimaryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RemoveShardCellRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -10372,7 +12999,7 @@ func (m *InitShardPrimaryRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ShardName", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10400,13 +13027,13 @@ func (m *InitShardPrimaryRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Shard = string(dAtA[iNdEx:postIndex]) + m.ShardName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PrimaryElectTabletAlias", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Cell", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -10416,27 +13043,23 @@ func (m *InitShardPrimaryRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthVtctldata } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthVtctldata } if postIndex > l { return io.ErrUnexpectedEOF } - if m.PrimaryElectTabletAlias == nil { - m.PrimaryElectTabletAlias = &topodata.TabletAlias{} - } - if err := m.PrimaryElectTabletAlias.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Cell = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 0 { @@ -10459,10 +13082,10 @@ func (m *InitShardPrimaryRequest) Unmarshal(dAtA []byte) error { } m.Force = bool(v != 0) case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field WaitReplicasTimeout", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Recursive", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -10472,28 +13095,66 @@ func (m *InitShardPrimaryRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + m.Recursive = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipVtctldata(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { return ErrInvalidLengthVtctldata } - postIndex := iNdEx + msglen - if postIndex < 0 { + if (iNdEx + skippy) < 0 { return ErrInvalidLengthVtctldata } - if postIndex > l { + if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } - if m.WaitReplicasTimeout == nil { - m.WaitReplicasTimeout = &vttime.Duration{} + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RemoveShardCellResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata } - if err := m.WaitReplicasTimeout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + if iNdEx >= l { + return io.ErrUnexpectedEOF } - iNdEx = postIndex + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RemoveShardCellResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RemoveShardCellResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -10519,7 +13180,7 @@ func (m *InitShardPrimaryRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *InitShardPrimaryResponse) Unmarshal(dAtA []byte) error { +func (m *ReparentTabletRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10542,15 +13203,15 @@ func (m *InitShardPrimaryResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: InitShardPrimaryResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ReparentTabletRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: InitShardPrimaryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ReparentTabletRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Events", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Tablet", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -10577,8 +13238,10 @@ func (m *InitShardPrimaryResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Events = append(m.Events, &logutil.Event{}) - if err := m.Events[len(m.Events)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Tablet == nil { + m.Tablet = &topodata.TabletAlias{} + } + if err := m.Tablet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -10607,7 +13270,7 @@ func (m *InitShardPrimaryResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *RemoveKeyspaceCellRequest) Unmarshal(dAtA []byte) error { +func (m *ReparentTabletResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10630,10 +13293,10 @@ func (m *RemoveKeyspaceCellRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RemoveKeyspaceCellRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ReparentTabletResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveKeyspaceCellRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ReparentTabletResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -10670,7 +13333,7 @@ func (m *RemoveKeyspaceCellRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cell", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10698,13 +13361,13 @@ func (m *RemoveKeyspaceCellRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Cell = string(dAtA[iNdEx:postIndex]) + m.Shard = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Primary", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -10714,32 +13377,28 @@ func (m *RemoveKeyspaceCellRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.Force = bool(v != 0) - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Recursive", wireType) + if msglen < 0 { + return ErrInvalidLengthVtctldata } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata } - m.Recursive = bool(v != 0) + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Primary == nil { + m.Primary = &topodata.TabletAlias{} + } + if err := m.Primary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -10765,7 +13424,7 @@ func (m *RemoveKeyspaceCellRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *RemoveKeyspaceCellResponse) Unmarshal(dAtA []byte) error { +func (m *TabletExternallyReparentedRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10788,12 +13447,48 @@ func (m *RemoveKeyspaceCellResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RemoveKeyspaceCellResponse: wiretype end group for non-group") + return fmt.Errorf("proto: TabletExternallyReparentedRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveKeyspaceCellResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TabletExternallyReparentedRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tablet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVtctldata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVtctldata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVtctldata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tablet == nil { + m.Tablet = &topodata.TabletAlias{} + } + if err := m.Tablet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) @@ -10819,7 +13514,7 @@ func (m *RemoveKeyspaceCellResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *RemoveShardCellRequest) Unmarshal(dAtA []byte) error { +func (m *TabletExternallyReparentedResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -10842,10 +13537,10 @@ func (m *RemoveShardCellRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RemoveShardCellRequest: wiretype end group for non-group") + return fmt.Errorf("proto: TabletExternallyReparentedResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveShardCellRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TabletExternallyReparentedResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -10882,7 +13577,7 @@ func (m *RemoveShardCellRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ShardName", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Shard", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -10910,13 +13605,13 @@ func (m *RemoveShardCellRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ShardName = string(dAtA[iNdEx:postIndex]) + m.Shard = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cell", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field NewPrimary", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -10926,49 +13621,33 @@ func (m *RemoveShardCellRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthVtctldata } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthVtctldata } if postIndex > l { return io.ErrUnexpectedEOF } - m.Cell = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Force", wireType) + if m.NewPrimary == nil { + m.NewPrimary = &topodata.TabletAlias{} } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } + if err := m.NewPrimary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Force = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Recursive", wireType) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OldPrimary", wireType) } - var v int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVtctldata @@ -10978,66 +13657,28 @@ func (m *RemoveShardCellRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - m.Recursive = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipVtctldata(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { + if msglen < 0 { return ErrInvalidLengthVtctldata } - if (iNdEx + skippy) < 0 { + postIndex := iNdEx + msglen + if postIndex < 0 { return ErrInvalidLengthVtctldata } - if (iNdEx + skippy) > l { + if postIndex > l { return io.ErrUnexpectedEOF } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RemoveShardCellResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowVtctldata - } - if iNdEx >= l { - return io.ErrUnexpectedEOF + if m.OldPrimary == nil { + m.OldPrimary = &topodata.TabletAlias{} } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if err := m.OldPrimary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RemoveShardCellResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoveShardCellResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipVtctldata(dAtA[iNdEx:]) diff --git a/go/vt/proto/vtctlservice/vtctlservice.pb.go b/go/vt/proto/vtctlservice/vtctlservice.pb.go index f4e67cd605d..113d0eb4c4b 100644 --- a/go/vt/proto/vtctlservice/vtctlservice.pb.go +++ b/go/vt/proto/vtctlservice/vtctlservice.pb.go @@ -29,45 +29,51 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("vtctlservice.proto", fileDescriptor_27055cdbb1148d2b) } var fileDescriptor_27055cdbb1148d2b = []byte{ - // 598 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x96, 0xcd, 0x6e, 0x13, 0x31, - 0x10, 0xc7, 0x9b, 0x03, 0x15, 0x98, 0xd2, 0x56, 0xe6, 0x80, 0x94, 0x36, 0x4b, 0x13, 0x28, 0x52, - 0x39, 0x24, 0xa8, 0x1c, 0x39, 0xb5, 0xa1, 0x84, 0xa8, 0x52, 0x05, 0x6d, 0x54, 0xa4, 0x4a, 0x3d, - 0xb8, 0xbb, 0x43, 0xb3, 0x62, 0xbf, 0xba, 0x76, 0x56, 0xe4, 0x4d, 0x78, 0x24, 0x8e, 0x3c, 0x02, - 0x0a, 0x57, 0x1e, 0x02, 0xc5, 0x8e, 0x1d, 0xaf, 0x3f, 0x52, 0x6e, 0xc9, 0xfc, 0xfe, 0xf3, 0x9f, - 0xf1, 0xee, 0x8c, 0xb5, 0x08, 0x57, 0x2c, 0x64, 0x09, 0x85, 0xb2, 0x8a, 0x43, 0xe8, 0x16, 0x65, - 0xce, 0x72, 0xbc, 0xa1, 0xc7, 0x9a, 0x5b, 0xfc, 0x5f, 0x44, 0x18, 0x11, 0xf8, 0xf0, 0x0e, 0x3d, - 0xb8, 0x9c, 0x87, 0xf0, 0x18, 0x3d, 0x3d, 0xf9, 0x0e, 0xe1, 0x84, 0x01, 0xff, 0xdf, 0xcf, 0xd3, - 0x94, 0x64, 0x11, 0xde, 0xef, 0x2e, 0x33, 0x1c, 0xfc, 0x1c, 0xee, 0x26, 0x40, 0x59, 0xf3, 0xd5, - 0x7d, 0x32, 0x5a, 0xe4, 0x19, 0x85, 0xce, 0xda, 0x9b, 0xc6, 0xe1, 0xdf, 0x4d, 0xb4, 0xce, 0x61, - 0x84, 0xaf, 0xd1, 0x76, 0x7f, 0x4c, 0xb2, 0x5b, 0x18, 0x91, 0x9b, 0x04, 0xd8, 0x68, 0x5a, 0x00, - 0xee, 0x68, 0x56, 0x26, 0x94, 0xe5, 0x5e, 0xac, 0xd4, 0xc8, 0x5a, 0xf8, 0x0b, 0xda, 0xec, 0x97, - 0x40, 0x18, 0x9c, 0xc2, 0x94, 0x16, 0x24, 0x04, 0xbc, 0xa7, 0x27, 0xd6, 0x90, 0xb4, 0x6e, 0xaf, - 0x50, 0x28, 0xe3, 0x33, 0xf4, 0x58, 0xb0, 0x8b, 0x31, 0x29, 0x23, 0xdc, 0xb2, 0x72, 0x78, 0x5c, - 0x5a, 0x06, 0x3e, 0xac, 0x37, 0xfa, 0x1e, 0x12, 0xf0, 0x34, 0x5a, 0x47, 0xae, 0x46, 0x4d, 0x85, - 0x32, 0xfe, 0x8c, 0x36, 0x04, 0xe3, 0x15, 0x29, 0x0e, 0xac, 0x24, 0x01, 0xa4, 0xe9, 0x73, 0x2f, - 0x57, 0x96, 0x23, 0xf4, 0x44, 0x10, 0xf1, 0xc8, 0x29, 0xb6, 0x73, 0x16, 0x44, 0x9a, 0xee, 0xf9, - 0x05, 0xca, 0xb5, 0x44, 0xcf,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x84, 0xc6, 0xae, 0xc8, 0x95, - 0x77, 0xaa, 0x7d, 0xbb, 0x62, 0x2f, 0xbb, 0x30, 0x93, 0x27, 0x35, 0xcc, 0x8c, 0x63, 0xb6, 0x3c, - 0x54, 0x5f, 0xbc, 0x61, 0x16, 0x8b, 0x07, 0xfa, 0xa9, 0x8c, 0x53, 0x52, 0x4e, 0x6b, 0x8b, 0x67, - 0x42, 0xd7, 0xe2, 0xd9, 0x1a, 0x65, 0x1f, 0x22, 0x7c, 0x0e, 0x69, 0x5e, 0xa9, 0xdb, 0x75, 0x3e, - 0xf4, 0xf8, 0xa5, 0x96, 0x6c, 0x63, 0x59, 0x62, 0xff, 0x1e, 0x95, 0xbe, 0x8d, 0x82, 0xf3, 0x26, - 0x78, 0x85, 0xb6, 0x95, 0xab, 0x98, 0x6b, 0x1b, 0x2d, 0x89, 0xf4, 0x3e, 0x7e, 0xf7, 0x73, 0x16, - 0x34, 0x7e, 0xcd, 0x82, 0xc6, 0xef, 0x59, 0xd0, 0xf8, 0xf1, 0x27, 0x58, 0xbb, 0x3a, 0xa8, 0x62, - 0x06, 0x94, 0x76, 0xe3, 0xbc, 0x27, 0x7e, 0xf5, 0x6e, 0xf3, 0x5e, 0xc5, 0x7a, 0xfc, 0x8b, 0xa0, - 0xa7, 0x7f, 0x2f, 0xdc, 0xac, 0xf3, 0xd8, 0xdb, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x08, 0x15, - 0xac, 0x50, 0x5a, 0x08, 0x00, 0x00, + // 692 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x96, 0xd1, 0x6e, 0xd3, 0x3e, + 0x14, 0xc6, 0xd7, 0x8b, 0xff, 0xf4, 0xc7, 0x0c, 0x36, 0x19, 0x04, 0x52, 0xb7, 0x86, 0xad, 0x30, + 0x60, 0x08, 0x5a, 0x34, 0x2e, 0xb9, 0xda, 0x4a, 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xbf, 0x20, 0xd1, 0xef, 0x4d, + 0xb9, 0xb7, 0xd9, 0x99, 0xdb, 0xcd, 0xf5, 0xe9, 0xc8, 0x76, 0x6f, 0x9a, 0x0a, 0x65, 0xfc, 0x1d, + 0x55, 0x45, 0xad, 0x7d, 0xcb, 0x21, 0xa1, 0x24, 0x08, 0xd4, 0x45, 0x02, 0x1e, 0x7e, 0xad, 0x59, + 0x94, 0xcb, 0xe4, 0xc0, 0x37, 0x2b, 0xaa, 0xe5, 0xf0, 0xe3, 0xf7, 0xbf, 0x26, 0x4e, 0xe5, 0xf7, + 0xc4, 0xa9, 0xfc, 0x99, 0x38, 0x95, 0x1f, 0x7f, 0x9d, 0xb5, 0xcb, 0x83, 0xd4, 0xe7, 0xc0, 0x58, + 0xc3, 0x8f, 0x9a, 0xe2, 0x53, 0x73, 0x10, 0x35, 0x53, 0xde, 0xcc, 0xfe, 0xc3, 0x35, 0xf5, 0x7f, + 0x78, 0xd7, 0xeb, 0x59, 0xed, 0xdd, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x90, 0xec, 0xfc, 0x38, + 0x0c, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -205,6 +211,9 @@ type VtctldClient interface { DeleteShards(ctx context.Context, in *vtctldata.DeleteShardsRequest, opts ...grpc.CallOption) (*vtctldata.DeleteShardsResponse, error) // DeleteTablets deletes one or more tablets from the topology. DeleteTablets(ctx context.Context, in *vtctldata.DeleteTabletsRequest, opts ...grpc.CallOption) (*vtctldata.DeleteTabletsResponse, error) + // EmergencyReparentShard reparents the shard to the new primary. It assumes + // the old primary is dead or otherwise not responding. + EmergencyReparentShard(ctx context.Context, in *vtctldata.EmergencyReparentShardRequest, opts ...grpc.CallOption) (*vtctldata.EmergencyReparentShardResponse, error) // FindAllShardsInKeyspace returns a map of shard names to shard references // for a given keyspace. FindAllShardsInKeyspace(ctx context.Context, in *vtctldata.FindAllShardsInKeyspaceRequest, opts ...grpc.CallOption) (*vtctldata.FindAllShardsInKeyspaceResponse, error) @@ -242,6 +251,14 @@ type VtctldClient interface { // PlannedReparentShard or EmergencyReparentShard should be used in those // cases instead. InitShardPrimary(ctx context.Context, in *vtctldata.InitShardPrimaryRequest, opts ...grpc.CallOption) (*vtctldata.InitShardPrimaryResponse, error) + // PlannedReparentShard reparents the shard to the new primary, or away from + // an old primary. Both the old and new primaries need to be reachable and + // running. + // + // **NOTE**: The vtctld will not consider any replicas outside the cell the + // current shard primary is in for promotion unless NewPrimary is explicitly + // provided in the request. + PlannedReparentShard(ctx context.Context, in *vtctldata.PlannedReparentShardRequest, opts ...grpc.CallOption) (*vtctldata.PlannedReparentShardResponse, error) // RemoveKeyspaceCell removes the specified cell from the Cells list for all // shards in the specified keyspace, as well as from the SrvKeyspace for that // keyspace in that cell. @@ -249,6 +266,17 @@ type VtctldClient interface { // RemoveShardCell removes the specified cell from the specified shard's Cells // list. RemoveShardCell(ctx context.Context, in *vtctldata.RemoveShardCellRequest, opts ...grpc.CallOption) (*vtctldata.RemoveShardCellResponse, error) + // ReparentTablet reparents a tablet to the current primary in the shard. This + // only works if the current replica position matches the last known reparent + // action. + ReparentTablet(ctx context.Context, in *vtctldata.ReparentTabletRequest, opts ...grpc.CallOption) (*vtctldata.ReparentTabletResponse, error) + // TabletExternallyReparented changes metadata in the topology server to + // acknowledge a shard primary change performed by an external tool (e.g. + // orchestrator). + // + // See the Reparenting guide for more information: + // https://vitess.io/docs/user-guides/configuration-advanced/reparenting/#external-reparenting. + TabletExternallyReparented(ctx context.Context, in *vtctldata.TabletExternallyReparentedRequest, opts ...grpc.CallOption) (*vtctldata.TabletExternallyReparentedResponse, error) } type vtctldClient struct { @@ -313,6 +341,15 @@ func (c *vtctldClient) DeleteTablets(ctx context.Context, in *vtctldata.DeleteTa return out, nil } +func (c *vtctldClient) EmergencyReparentShard(ctx context.Context, in *vtctldata.EmergencyReparentShardRequest, opts ...grpc.CallOption) (*vtctldata.EmergencyReparentShardResponse, error) { + out := new(vtctldata.EmergencyReparentShardResponse) + err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/EmergencyReparentShard", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *vtctldClient) FindAllShardsInKeyspace(ctx context.Context, in *vtctldata.FindAllShardsInKeyspaceRequest, opts ...grpc.CallOption) (*vtctldata.FindAllShardsInKeyspaceResponse, error) { out := new(vtctldata.FindAllShardsInKeyspaceResponse) err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/FindAllShardsInKeyspace", in, out, opts...) @@ -439,6 +476,15 @@ func (c *vtctldClient) InitShardPrimary(ctx context.Context, in *vtctldata.InitS return out, nil } +func (c *vtctldClient) PlannedReparentShard(ctx context.Context, in *vtctldata.PlannedReparentShardRequest, opts ...grpc.CallOption) (*vtctldata.PlannedReparentShardResponse, error) { + out := new(vtctldata.PlannedReparentShardResponse) + err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/PlannedReparentShard", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *vtctldClient) RemoveKeyspaceCell(ctx context.Context, in *vtctldata.RemoveKeyspaceCellRequest, opts ...grpc.CallOption) (*vtctldata.RemoveKeyspaceCellResponse, error) { out := new(vtctldata.RemoveKeyspaceCellResponse) err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/RemoveKeyspaceCell", in, out, opts...) @@ -457,6 +503,24 @@ func (c *vtctldClient) RemoveShardCell(ctx context.Context, in *vtctldata.Remove return out, nil } +func (c *vtctldClient) ReparentTablet(ctx context.Context, in *vtctldata.ReparentTabletRequest, opts ...grpc.CallOption) (*vtctldata.ReparentTabletResponse, error) { + out := new(vtctldata.ReparentTabletResponse) + err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/ReparentTablet", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *vtctldClient) TabletExternallyReparented(ctx context.Context, in *vtctldata.TabletExternallyReparentedRequest, opts ...grpc.CallOption) (*vtctldata.TabletExternallyReparentedResponse, error) { + out := new(vtctldata.TabletExternallyReparentedResponse) + err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/TabletExternallyReparented", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // VtctldServer is the server API for Vtctld service. type VtctldServer interface { // ChangeTabletType changes the db type for the specified tablet, if possible. @@ -483,6 +547,9 @@ type VtctldServer interface { DeleteShards(context.Context, *vtctldata.DeleteShardsRequest) (*vtctldata.DeleteShardsResponse, error) // DeleteTablets deletes one or more tablets from the topology. DeleteTablets(context.Context, *vtctldata.DeleteTabletsRequest) (*vtctldata.DeleteTabletsResponse, error) + // EmergencyReparentShard reparents the shard to the new primary. It assumes + // the old primary is dead or otherwise not responding. + EmergencyReparentShard(context.Context, *vtctldata.EmergencyReparentShardRequest) (*vtctldata.EmergencyReparentShardResponse, error) // FindAllShardsInKeyspace returns a map of shard names to shard references // for a given keyspace. FindAllShardsInKeyspace(context.Context, *vtctldata.FindAllShardsInKeyspaceRequest) (*vtctldata.FindAllShardsInKeyspaceResponse, error) @@ -520,6 +587,14 @@ type VtctldServer interface { // PlannedReparentShard or EmergencyReparentShard should be used in those // cases instead. InitShardPrimary(context.Context, *vtctldata.InitShardPrimaryRequest) (*vtctldata.InitShardPrimaryResponse, error) + // PlannedReparentShard reparents the shard to the new primary, or away from + // an old primary. Both the old and new primaries need to be reachable and + // running. + // + // **NOTE**: The vtctld will not consider any replicas outside the cell the + // current shard primary is in for promotion unless NewPrimary is explicitly + // provided in the request. + PlannedReparentShard(context.Context, *vtctldata.PlannedReparentShardRequest) (*vtctldata.PlannedReparentShardResponse, error) // RemoveKeyspaceCell removes the specified cell from the Cells list for all // shards in the specified keyspace, as well as from the SrvKeyspace for that // keyspace in that cell. @@ -527,6 +602,17 @@ type VtctldServer interface { // RemoveShardCell removes the specified cell from the specified shard's Cells // list. RemoveShardCell(context.Context, *vtctldata.RemoveShardCellRequest) (*vtctldata.RemoveShardCellResponse, error) + // ReparentTablet reparents a tablet to the current primary in the shard. This + // only works if the current replica position matches the last known reparent + // action. + ReparentTablet(context.Context, *vtctldata.ReparentTabletRequest) (*vtctldata.ReparentTabletResponse, error) + // TabletExternallyReparented changes metadata in the topology server to + // acknowledge a shard primary change performed by an external tool (e.g. + // orchestrator). + // + // See the Reparenting guide for more information: + // https://vitess.io/docs/user-guides/configuration-advanced/reparenting/#external-reparenting. + TabletExternallyReparented(context.Context, *vtctldata.TabletExternallyReparentedRequest) (*vtctldata.TabletExternallyReparentedResponse, error) } // UnimplementedVtctldServer can be embedded to have forward compatible implementations. @@ -551,6 +637,9 @@ func (*UnimplementedVtctldServer) DeleteShards(ctx context.Context, req *vtctlda func (*UnimplementedVtctldServer) DeleteTablets(ctx context.Context, req *vtctldata.DeleteTabletsRequest) (*vtctldata.DeleteTabletsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteTablets not implemented") } +func (*UnimplementedVtctldServer) EmergencyReparentShard(ctx context.Context, req *vtctldata.EmergencyReparentShardRequest) (*vtctldata.EmergencyReparentShardResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method EmergencyReparentShard not implemented") +} func (*UnimplementedVtctldServer) FindAllShardsInKeyspace(ctx context.Context, req *vtctldata.FindAllShardsInKeyspaceRequest) (*vtctldata.FindAllShardsInKeyspaceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method FindAllShardsInKeyspace not implemented") } @@ -593,12 +682,21 @@ func (*UnimplementedVtctldServer) GetVSchema(ctx context.Context, req *vtctldata func (*UnimplementedVtctldServer) InitShardPrimary(ctx context.Context, req *vtctldata.InitShardPrimaryRequest) (*vtctldata.InitShardPrimaryResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method InitShardPrimary not implemented") } +func (*UnimplementedVtctldServer) PlannedReparentShard(ctx context.Context, req *vtctldata.PlannedReparentShardRequest) (*vtctldata.PlannedReparentShardResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PlannedReparentShard not implemented") +} func (*UnimplementedVtctldServer) RemoveKeyspaceCell(ctx context.Context, req *vtctldata.RemoveKeyspaceCellRequest) (*vtctldata.RemoveKeyspaceCellResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveKeyspaceCell not implemented") } func (*UnimplementedVtctldServer) RemoveShardCell(ctx context.Context, req *vtctldata.RemoveShardCellRequest) (*vtctldata.RemoveShardCellResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemoveShardCell not implemented") } +func (*UnimplementedVtctldServer) ReparentTablet(ctx context.Context, req *vtctldata.ReparentTabletRequest) (*vtctldata.ReparentTabletResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReparentTablet not implemented") +} +func (*UnimplementedVtctldServer) TabletExternallyReparented(ctx context.Context, req *vtctldata.TabletExternallyReparentedRequest) (*vtctldata.TabletExternallyReparentedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TabletExternallyReparented not implemented") +} func RegisterVtctldServer(s *grpc.Server, srv VtctldServer) { s.RegisterService(&_Vtctld_serviceDesc, srv) @@ -712,6 +810,24 @@ func _Vtctld_DeleteTablets_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Vtctld_EmergencyReparentShard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(vtctldata.EmergencyReparentShardRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VtctldServer).EmergencyReparentShard(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vtctlservice.Vtctld/EmergencyReparentShard", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VtctldServer).EmergencyReparentShard(ctx, req.(*vtctldata.EmergencyReparentShardRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Vtctld_FindAllShardsInKeyspace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(vtctldata.FindAllShardsInKeyspaceRequest) if err := dec(in); err != nil { @@ -964,6 +1080,24 @@ func _Vtctld_InitShardPrimary_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Vtctld_PlannedReparentShard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(vtctldata.PlannedReparentShardRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VtctldServer).PlannedReparentShard(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vtctlservice.Vtctld/PlannedReparentShard", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VtctldServer).PlannedReparentShard(ctx, req.(*vtctldata.PlannedReparentShardRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Vtctld_RemoveKeyspaceCell_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(vtctldata.RemoveKeyspaceCellRequest) if err := dec(in); err != nil { @@ -1000,6 +1134,42 @@ func _Vtctld_RemoveShardCell_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Vtctld_ReparentTablet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(vtctldata.ReparentTabletRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VtctldServer).ReparentTablet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vtctlservice.Vtctld/ReparentTablet", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VtctldServer).ReparentTablet(ctx, req.(*vtctldata.ReparentTabletRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Vtctld_TabletExternallyReparented_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(vtctldata.TabletExternallyReparentedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VtctldServer).TabletExternallyReparented(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vtctlservice.Vtctld/TabletExternallyReparented", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VtctldServer).TabletExternallyReparented(ctx, req.(*vtctldata.TabletExternallyReparentedRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Vtctld_serviceDesc = grpc.ServiceDesc{ ServiceName: "vtctlservice.Vtctld", HandlerType: (*VtctldServer)(nil), @@ -1028,6 +1198,10 @@ var _Vtctld_serviceDesc = grpc.ServiceDesc{ MethodName: "DeleteTablets", Handler: _Vtctld_DeleteTablets_Handler, }, + { + MethodName: "EmergencyReparentShard", + Handler: _Vtctld_EmergencyReparentShard_Handler, + }, { MethodName: "FindAllShardsInKeyspace", Handler: _Vtctld_FindAllShardsInKeyspace_Handler, @@ -1084,6 +1258,10 @@ var _Vtctld_serviceDesc = grpc.ServiceDesc{ MethodName: "InitShardPrimary", Handler: _Vtctld_InitShardPrimary_Handler, }, + { + MethodName: "PlannedReparentShard", + Handler: _Vtctld_PlannedReparentShard_Handler, + }, { MethodName: "RemoveKeyspaceCell", Handler: _Vtctld_RemoveKeyspaceCell_Handler, @@ -1092,6 +1270,14 @@ var _Vtctld_serviceDesc = grpc.ServiceDesc{ MethodName: "RemoveShardCell", Handler: _Vtctld_RemoveShardCell_Handler, }, + { + MethodName: "ReparentTablet", + Handler: _Vtctld_ReparentTablet_Handler, + }, + { + MethodName: "TabletExternallyReparented", + Handler: _Vtctld_TabletExternallyReparented_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "vtctlservice.proto", diff --git a/go/vt/vtctl/grpcvtctldclient/client_gen.go b/go/vt/vtctl/grpcvtctldclient/client_gen.go index b2d7c619367..0305a96700d 100644 --- a/go/vt/vtctl/grpcvtctldclient/client_gen.go +++ b/go/vt/vtctl/grpcvtctldclient/client_gen.go @@ -82,6 +82,15 @@ func (client *gRPCVtctldClient) DeleteTablets(ctx context.Context, in *vtctldata return client.c.DeleteTablets(ctx, in, opts...) } +// EmergencyReparentShard is part of the vtctlservicepb.VtctldClient interface. +func (client *gRPCVtctldClient) EmergencyReparentShard(ctx context.Context, in *vtctldatapb.EmergencyReparentShardRequest, opts ...grpc.CallOption) (*vtctldatapb.EmergencyReparentShardResponse, error) { + if client.c == nil { + return nil, status.Error(codes.Unavailable, connClosedMsg) + } + + return client.c.EmergencyReparentShard(ctx, in, opts...) +} + // FindAllShardsInKeyspace is part of the vtctlservicepb.VtctldClient interface. func (client *gRPCVtctldClient) FindAllShardsInKeyspace(ctx context.Context, in *vtctldatapb.FindAllShardsInKeyspaceRequest, opts ...grpc.CallOption) (*vtctldatapb.FindAllShardsInKeyspaceResponse, error) { if client.c == nil { @@ -208,6 +217,15 @@ func (client *gRPCVtctldClient) InitShardPrimary(ctx context.Context, in *vtctld return client.c.InitShardPrimary(ctx, in, opts...) } +// PlannedReparentShard is part of the vtctlservicepb.VtctldClient interface. +func (client *gRPCVtctldClient) PlannedReparentShard(ctx context.Context, in *vtctldatapb.PlannedReparentShardRequest, opts ...grpc.CallOption) (*vtctldatapb.PlannedReparentShardResponse, error) { + if client.c == nil { + return nil, status.Error(codes.Unavailable, connClosedMsg) + } + + return client.c.PlannedReparentShard(ctx, in, opts...) +} + // RemoveKeyspaceCell is part of the vtctlservicepb.VtctldClient interface. func (client *gRPCVtctldClient) RemoveKeyspaceCell(ctx context.Context, in *vtctldatapb.RemoveKeyspaceCellRequest, opts ...grpc.CallOption) (*vtctldatapb.RemoveKeyspaceCellResponse, error) { if client.c == nil { @@ -225,3 +243,21 @@ func (client *gRPCVtctldClient) RemoveShardCell(ctx context.Context, in *vtctlda return client.c.RemoveShardCell(ctx, in, opts...) } + +// ReparentTablet is part of the vtctlservicepb.VtctldClient interface. +func (client *gRPCVtctldClient) ReparentTablet(ctx context.Context, in *vtctldatapb.ReparentTabletRequest, opts ...grpc.CallOption) (*vtctldatapb.ReparentTabletResponse, error) { + if client.c == nil { + return nil, status.Error(codes.Unavailable, connClosedMsg) + } + + return client.c.ReparentTablet(ctx, in, opts...) +} + +// TabletExternallyReparented is part of the vtctlservicepb.VtctldClient interface. +func (client *gRPCVtctldClient) TabletExternallyReparented(ctx context.Context, in *vtctldatapb.TabletExternallyReparentedRequest, opts ...grpc.CallOption) (*vtctldatapb.TabletExternallyReparentedResponse, error) { + if client.c == nil { + return nil, status.Error(codes.Unavailable, connClosedMsg) + } + + return client.c.TabletExternallyReparented(ctx, in, opts...) +} diff --git a/go/vt/vtctl/grpcvtctldserver/server.go b/go/vt/vtctl/grpcvtctldserver/server.go index ad4c7c77006..76bb8af2f0a 100644 --- a/go/vt/vtctl/grpcvtctldserver/server.go +++ b/go/vt/vtctl/grpcvtctldserver/server.go @@ -316,6 +316,11 @@ func (s *VtctldServer) DeleteTablets(ctx context.Context, req *vtctldatapb.Delet return &vtctldatapb.DeleteTabletsResponse{}, nil } +// EmergencyReparentShard is part of the vtctldservicepb.VtctldServer interface. +func (s *VtctldServer) EmergencyReparentShard(ctx context.Context, req *vtctldatapb.EmergencyReparentShardRequest) (*vtctldatapb.EmergencyReparentShardResponse, error) { + panic("unimplemented!") +} + // FindAllShardsInKeyspace is part of the vtctlservicepb.VtctldServer interface. func (s *VtctldServer) FindAllShardsInKeyspace(ctx context.Context, req *vtctldatapb.FindAllShardsInKeyspaceRequest) (*vtctldatapb.FindAllShardsInKeyspaceResponse, error) { result, err := s.ts.FindAllShardsInKeyspace(ctx, req.Keyspace) @@ -864,6 +869,11 @@ func (s *VtctldServer) InitShardPrimaryLocked( return nil } +// PlannedReparentShard is part of the vtctldservicepb.VtctldServer interface. +func (s *VtctldServer) PlannedReparentShard(ctx context.Context, req *vtctldatapb.PlannedReparentShardRequest) (*vtctldatapb.PlannedReparentShardResponse, error) { + panic("unimplemented!") +} + // RemoveKeyspaceCell is part of the vtctlservicepb.VtctldServer interface. func (s *VtctldServer) RemoveKeyspaceCell(ctx context.Context, req *vtctldatapb.RemoveKeyspaceCellRequest) (*vtctldatapb.RemoveKeyspaceCellResponse, error) { shards, err := s.ts.GetShardNames(ctx, req.Keyspace) @@ -897,6 +907,16 @@ func (s *VtctldServer) RemoveShardCell(ctx context.Context, req *vtctldatapb.Rem return &vtctldatapb.RemoveShardCellResponse{}, nil } +// ReparentTablet is part of the vtctldservicepb.VtctldServer interface. +func (s *VtctldServer) ReparentTablet(ctx context.Context, req *vtctldatapb.ReparentTabletRequest) (*vtctldatapb.ReparentTabletResponse, error) { + panic("unimplemented!") +} + +// TabletExternallyReparented is part of the vtctldservicepb.VtctldServer interface. +func (s *VtctldServer) TabletExternallyReparented(ctx context.Context, req *vtctldatapb.TabletExternallyReparentedRequest) (*vtctldatapb.TabletExternallyReparentedResponse, error) { + panic("unimplemented!") +} + // StartServer registers a VtctldServer for RPCs on the given gRPC server. func StartServer(s *grpc.Server, ts *topo.Server) { vtctlservicepb.RegisterVtctldServer(s, NewVtctldServer(ts)) diff --git a/proto/vtctldata.proto b/proto/vtctldata.proto index 45744453452..4c5057d5b2c 100644 --- a/proto/vtctldata.proto +++ b/proto/vtctldata.proto @@ -149,6 +149,37 @@ message DeleteTabletsRequest { message DeleteTabletsResponse { } +message EmergencyReparentShardRequest { + // Keyspace is the name of the keyspace to perform the Emergency Reparent in. + string keyspace = 1; + // Shard is the name of the shard to perform the Emergency Reparent in. + string shard = 2; + // Optional alias of a tablet that should become the new shard primary. If not + // not specified, the vtctld will select the most up-to-date canditate to + // promote. + topodata.TabletAlias new_primary = 3; + // List of replica aliases to ignore during the Emergency Reparent. The vtctld + // will not attempt to stop replication on these tablets, nor attempt to + // demote any that may think they are the shard primary. + repeated topodata.TabletAlias ignore_replicas = 4; + // WaitReplicasTimeout is the duration of time to wait for replicas to catch + // up in reparenting. + vttime.Duration wait_replicas_timeout = 5; +} + +message EmergencyReparentShardResponse { + // Keyspace is the name of the keyspace the Emergency Reparent took place in. + string keyspace = 1; + // Shard is the name of the shard the Emergency Reparent took place in. + string shard = 2; + // PromotedPrimary is the alias of the tablet that was promoted to shard + // primary. If NewPrimary was set in the request, then this will be the same + // alias. Otherwise, it will be the alias of the tablet found to be most + // up-to-date. + topodata.TabletAlias promoted_primary = 3; + repeated logutil.Event events = 4; +} + message GetBackupsRequest { string keyspace = 1; string shard = 2; @@ -278,6 +309,44 @@ message InitShardPrimaryResponse { repeated logutil.Event events = 1; } +message PlannedReparentShardRequest { + // Keyspace is the name of the keyspace to perform the Planned Reparent in. + string keyspace = 1; + // Shard is the name of the shard to perform teh Planned Reparent in. + string shard = 2; + // NewPrimary is the alias of the tablet to promote to shard primary. If not + // specified, the vtctld will select the most up-to-date candidate to promote. + // + // It is an error to set NewPrimary and AvoidPrimary to the same alias. + topodata.TabletAlias new_primary = 3; + // AvoidPrimary is the alias of the tablet to demote. In other words, + // specifying an AvoidPrimary alias tells the vtctld to promote any replica + // other than this one. A shard whose current primary is not this one is then + // a no-op. + // + // It is an error to set NewPrimary and AvoidPrimary to the same alias. + topodata.TabletAlias avoid_primary = 4; + // WaitReplicasTimeout is the duration of time to wait for replicas to catch + // up in replication both before and after the reparent. The timeout is not + // cumulative across both wait periods, meaning that the replicas have + // WaitReplicasTimeout time to catch up before the reparent, and an additional + // WaitReplicasTimeout time to catch up after the reparent. + vttime.Duration wait_replicas_timeout = 5; +} + +message PlannedReparentShardResponse { + // Keyspace is the name of the keyspace the Planned Reparent took place in. + string keyspace = 1; + // Shard is the name of the shard the Planned Reparent took place in. + string shard = 2; + // PromotedPrimary is the alias of the tablet that was promoted to shard + // primary. If NewPrimary was set in the request, then this will be the same + // alias. Otherwise, it will be the alias of the tablet found to be most + // up-to-date. + topodata.TabletAlias promoted_primary = 3; + repeated logutil.Event events = 4; +} + message RemoveKeyspaceCellRequest { string keyspace = 1; string cell = 2; @@ -313,6 +382,34 @@ message RemoveShardCellResponse { // and any deleted Tablet objects here. } +message ReparentTabletRequest { + // Tablet is the alias of the tablet that should be reparented under the + // current shard primary. + topodata.TabletAlias tablet = 1; +} + +message ReparentTabletResponse { + // Keyspace is the name of the keyspace the tablet was reparented in. + string keyspace = 1; + // Shard is the name of the shard the tablet was reparented in. + string shard = 2; + // Primary is the alias of the tablet that the tablet was reparented under. + topodata.TabletAlias primary = 3; +} + +message TabletExternallyReparentedRequest { + // Tablet is the alias of the tablet that was promoted externally and should + // be updated to the shard primary in the topo. + topodata.TabletAlias tablet = 1; +} + +message TabletExternallyReparentedResponse { + string keyspace = 1; + string shard = 2; + topodata.TabletAlias new_primary = 3; + topodata.TabletAlias old_primary = 4; +} + message Keyspace { string name = 1; topodata.Keyspace keyspace = 2; diff --git a/proto/vtctlservice.proto b/proto/vtctlservice.proto index 9ee122c53a5..6578b467db8 100644 --- a/proto/vtctlservice.proto +++ b/proto/vtctlservice.proto @@ -55,6 +55,9 @@ service Vtctld { rpc DeleteShards(vtctldata.DeleteShardsRequest) returns (vtctldata.DeleteShardsResponse) {}; // DeleteTablets deletes one or more tablets from the topology. rpc DeleteTablets(vtctldata.DeleteTabletsRequest) returns (vtctldata.DeleteTabletsResponse) {}; + // EmergencyReparentShard reparents the shard to the new primary. It assumes + // the old primary is dead or otherwise not responding. + rpc EmergencyReparentShard(vtctldata.EmergencyReparentShardRequest) returns (vtctldata.EmergencyReparentShardResponse) {}; // FindAllShardsInKeyspace returns a map of shard names to shard references // for a given keyspace. rpc FindAllShardsInKeyspace(vtctldata.FindAllShardsInKeyspaceRequest) returns (vtctldata.FindAllShardsInKeyspaceResponse) {}; @@ -92,6 +95,14 @@ service Vtctld { // PlannedReparentShard or EmergencyReparentShard should be used in those // cases instead. rpc InitShardPrimary(vtctldata.InitShardPrimaryRequest) returns (vtctldata.InitShardPrimaryResponse) {}; + // PlannedReparentShard reparents the shard to the new primary, or away from + // an old primary. Both the old and new primaries need to be reachable and + // running. + // + // **NOTE**: The vtctld will not consider any replicas outside the cell the + // current shard primary is in for promotion unless NewPrimary is explicitly + // provided in the request. + rpc PlannedReparentShard(vtctldata.PlannedReparentShardRequest) returns (vtctldata.PlannedReparentShardResponse) {}; // RemoveKeyspaceCell removes the specified cell from the Cells list for all // shards in the specified keyspace, as well as from the SrvKeyspace for that // keyspace in that cell. @@ -99,4 +110,15 @@ service Vtctld { // RemoveShardCell removes the specified cell from the specified shard's Cells // list. rpc RemoveShardCell(vtctldata.RemoveShardCellRequest) returns (vtctldata.RemoveShardCellResponse) {}; + // ReparentTablet reparents a tablet to the current primary in the shard. This + // only works if the current replica position matches the last known reparent + // action. + rpc ReparentTablet(vtctldata.ReparentTabletRequest) returns (vtctldata.ReparentTabletResponse) {}; + // TabletExternallyReparented changes metadata in the topology server to + // acknowledge a shard primary change performed by an external tool (e.g. + // orchestrator). + // + // See the Reparenting guide for more information: + // https://vitess.io/docs/user-guides/configuration-advanced/reparenting/#external-reparenting. + rpc TabletExternallyReparented(vtctldata.TabletExternallyReparentedRequest) returns (vtctldata.TabletExternallyReparentedResponse) {}; } From 4e20e14ba551a8f989637e152e95c378bb59049c Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Fri, 29 Jan 2021 22:35:21 -0500 Subject: [PATCH 02/16] Implement TabletExternallyReparented, add tests Signed-off-by: Andrew Mason --- go/vt/vtctl/grpcvtctldserver/server.go | 57 ++- go/vt/vtctl/grpcvtctldserver/server_test.go | 414 ++++++++++++++++++++ 2 files changed, 470 insertions(+), 1 deletion(-) diff --git a/go/vt/vtctl/grpcvtctldserver/server.go b/go/vt/vtctl/grpcvtctldserver/server.go index 76bb8af2f0a..f69f5000e30 100644 --- a/go/vt/vtctl/grpcvtctldserver/server.go +++ b/go/vt/vtctl/grpcvtctldserver/server.go @@ -914,7 +914,62 @@ func (s *VtctldServer) ReparentTablet(ctx context.Context, req *vtctldatapb.Repa // TabletExternallyReparented is part of the vtctldservicepb.VtctldServer interface. func (s *VtctldServer) TabletExternallyReparented(ctx context.Context, req *vtctldatapb.TabletExternallyReparentedRequest) (*vtctldatapb.TabletExternallyReparentedResponse, error) { - panic("unimplemented!") + if req.Tablet == nil { + return nil, vterrors.Errorf(vtrpc.Code_INVALID_ARGUMENT, "TabletExternallyReparentedRequest.Tablet must not be nil") + } + + tablet, err := s.ts.GetTablet(ctx, req.Tablet) + if err != nil { + log.Warningf("TabletExternallyReparented: failed to read tablet record for %v: %v", topoproto.TabletAliasString(req.Tablet), err) + return nil, err + } + + shard, err := s.ts.GetShard(ctx, tablet.Keyspace, tablet.Shard) + if err != nil { + log.Warningf("TabletExternallyReparented: failed to read global shard record for %v/%v: %v", tablet.Keyspace, tablet.Shard, err) + return nil, err + } + + resp := &vtctldatapb.TabletExternallyReparentedResponse{ + Keyspace: shard.Keyspace(), + Shard: shard.ShardName(), + NewPrimary: req.Tablet, + OldPrimary: shard.MasterAlias, + } + + // If the externally reparented (new primary) tablet is already MASTER in + // the topo, this is a no-op. + if tablet.Type == topodatapb.TabletType_MASTER { + return resp, nil + } + + log.Infof("TabletExternallyReparented: executing tablet type change %v -> MASTER on %v", tablet.Type, topoproto.TabletAliasString(req.Tablet)) + ev := &events.Reparent{ + ShardInfo: *shard, + NewMaster: *tablet.Tablet, + OldMaster: topodatapb.Tablet{ + Alias: shard.MasterAlias, + Type: topodatapb.TabletType_MASTER, + }, + } + + defer func() { + // Ensure we dispatch an update with any failure. + if err != nil { + event.DispatchUpdate(ev, "failed: "+err.Error()) + } + }() + + event.DispatchUpdate(ev, "starting external reparent") + + if err := s.tmc.ChangeType(ctx, tablet.Tablet, topodatapb.TabletType_MASTER); err != nil { + log.Warningf("ChangeType(%v, MASTER): %v", topoproto.TabletAliasString(req.Tablet), err) + return nil, err + } + + event.DispatchUpdate(ev, "finished") + + return resp, nil } // StartServer registers a VtctldServer for RPCs on the given gRPC server. diff --git a/go/vt/vtctl/grpcvtctldserver/server_test.go b/go/vt/vtctl/grpcvtctldserver/server_test.go index db860a983cc..f1c61d5df36 100644 --- a/go/vt/vtctl/grpcvtctldserver/server_test.go +++ b/go/vt/vtctl/grpcvtctldserver/server_test.go @@ -3438,3 +3438,417 @@ func TestRemoveShardCell(t *testing.T) { }) } } + +func TestTabletExternallyReparented(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + topo []*topodatapb.Tablet + topoErr error + tmcHasNoTopo bool + req *vtctldatapb.TabletExternallyReparentedRequest + expected *vtctldatapb.TabletExternallyReparentedResponse + shouldErr bool + expectedTopo []*topodatapb.Tablet + }{ + { + name: "success", + topo: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone3", + Uid: 300, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + topoErr: nil, + req: &vtctldatapb.TabletExternallyReparentedRequest{ + Tablet: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + }, + expected: &vtctldatapb.TabletExternallyReparentedResponse{ + Keyspace: "testkeyspace", + Shard: "-", + NewPrimary: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + OldPrimary: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + }, + shouldErr: false, + // NOTE: this seems weird, right? Why is the old primary still a + // MASTER, and why is the new primary's term start 0,0? Well, our + // test client implementation is a little incomplete. See + // ./testutil/test_tmclient.go for reference. + expectedTopo: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{}, + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone3", + Uid: 300, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + }, + { + name: "tablet is nil", + topo: nil, + topoErr: nil, + req: &vtctldatapb.TabletExternallyReparentedRequest{ + Tablet: nil, + }, + expected: nil, + shouldErr: true, + expectedTopo: nil, + }, + { + name: "topo is down", + topo: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone3", + Uid: 300, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + topoErr: assert.AnError, + req: &vtctldatapb.TabletExternallyReparentedRequest{ + Tablet: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + }, + expected: nil, + shouldErr: true, + expectedTopo: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone3", + Uid: 300, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + }, + { + name: "tablet is already primary", + topo: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone3", + Uid: 300, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + topoErr: nil, + req: &vtctldatapb.TabletExternallyReparentedRequest{ + Tablet: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + }, + expected: &vtctldatapb.TabletExternallyReparentedResponse{ + Keyspace: "testkeyspace", + Shard: "-", + NewPrimary: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + OldPrimary: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + }, + shouldErr: false, + expectedTopo: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone3", + Uid: 300, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + }, + { + name: "cannot change tablet type", + topo: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone3", + Uid: 300, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + topoErr: nil, + tmcHasNoTopo: true, + req: &vtctldatapb.TabletExternallyReparentedRequest{ + Tablet: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + }, + expected: nil, + shouldErr: true, + expectedTopo: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone3", + Uid: 300, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + }, + } + + for _, tt := range tests { + tt := tt + + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + cells := []string{"zone1", "zone2", "zone3"} + + ctx := context.Background() + ts, topofactory := memorytopo.NewServerAndFactory(cells...) + tmc := testutil.TabletManagerClient{ + TopoServer: ts, + } + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, &tmc, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) + + if tt.tmcHasNoTopo { + // For certain test cases, we want specifically just the + // ChangeType call to fail, which is why we rely on a separate + // bool rather than using tt.topoErr. + tmc.TopoServer = nil + } + + testutil.AddTablets(ctx, t, ts, &testutil.AddTabletOptions{ + AlsoSetShardMaster: true, + }, tt.topo...) + + if tt.topoErr != nil { + topofactory.SetError(tt.topoErr) + } + + if tt.expectedTopo != nil { + // assert on expectedTopo state when we've fininished the rest + // of the test. + defer func() { + topofactory.SetError(nil) + + resp, err := vtctld.GetTablets(ctx, &vtctldatapb.GetTabletsRequest{}) + require.NoError(t, err, "cannot get all tablets in the topo") + assert.ElementsMatch(t, tt.expectedTopo, resp.Tablets) + }() + } + + resp, err := vtctld.TabletExternallyReparented(ctx, tt.req) + if tt.shouldErr { + assert.Error(t, err) + return + } + + assert.NoError(t, err) + assert.Equal(t, tt.expected, resp) + }) + } +} From 8fd1a36ffc32718a959ff74ff083db77609b778a Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Fri, 29 Jan 2021 22:39:23 -0500 Subject: [PATCH 03/16] Add CLI entrypoint for `TabletExternallyReparented` Signed-off-by: Andrew Mason --- .../internal/command/reparents.go | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/go/cmd/vtctldclient/internal/command/reparents.go b/go/cmd/vtctldclient/internal/command/reparents.go index c5479efe045..91430e5181d 100644 --- a/go/cmd/vtctldclient/internal/command/reparents.go +++ b/go/cmd/vtctldclient/internal/command/reparents.go @@ -17,6 +17,7 @@ limitations under the License. package command import ( + "fmt" "time" "github.com/spf13/cobra" @@ -36,6 +37,13 @@ var ( Args: cobra.ExactArgs(2), RunE: commandInitShardPrimary, } + // TabletExternallyReparented makes a TabletExternallyReparented gRPC call + // to a vtctld. + TabletExternallyReparented = &cobra.Command{ + Use: "TabletExternallyReparented ALIAS", + Args: cobra.ExactArgs(1), + RunE: commandTabletExternallyReparented, + } ) var initShardPrimaryOptions = struct { @@ -71,8 +79,33 @@ func commandInitShardPrimary(cmd *cobra.Command, args []string) error { return err } +func commandTabletExternallyReparented(cmd *cobra.Command, args []string) error { + alias, err := topoproto.ParseTabletAlias(cmd.Flags().Arg(0)) + if err != nil { + return err + } + + resp, err := client.TabletExternallyReparented(commandCtx, &vtctldatapb.TabletExternallyReparentedRequest{ + Tablet: alias, + }) + if err != nil { + return err + } + + data, err := cli.MarshalJSON(resp) + if err != nil { + return err + } + + fmt.Printf("%s\n", data) + + return nil +} + func init() { InitShardPrimary.Flags().DurationVar(&initShardPrimaryOptions.WaitReplicasTimeout, "wait-replicas-timeout", 30*time.Second, "time to wait for replicas to catch up in reparenting") InitShardPrimary.Flags().BoolVar(&initShardPrimaryOptions.Force, "force", false, "will force the reparent even if the provided tablet is not a master or the shard master") Root.AddCommand(InitShardPrimary) + + Root.AddCommand(TabletExternallyReparented) } From 124bdeee49803eff4bb32a0c0b78e9e3d6ef9938 Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Sat, 30 Jan 2021 21:20:43 -0500 Subject: [PATCH 04/16] Implement `ReparentTablet` with tests Signed-off-by: Andrew Mason --- go/vt/vtctl/grpcvtctldserver/server.go | 41 +- go/vt/vtctl/grpcvtctldserver/server_test.go | 528 ++++++++++++++++++++ 2 files changed, 568 insertions(+), 1 deletion(-) diff --git a/go/vt/vtctl/grpcvtctldserver/server.go b/go/vt/vtctl/grpcvtctldserver/server.go index f69f5000e30..580ab747564 100644 --- a/go/vt/vtctl/grpcvtctldserver/server.go +++ b/go/vt/vtctl/grpcvtctldserver/server.go @@ -909,7 +909,46 @@ func (s *VtctldServer) RemoveShardCell(ctx context.Context, req *vtctldatapb.Rem // ReparentTablet is part of the vtctldservicepb.VtctldServer interface. func (s *VtctldServer) ReparentTablet(ctx context.Context, req *vtctldatapb.ReparentTabletRequest) (*vtctldatapb.ReparentTabletResponse, error) { - panic("unimplemented!") + if req.Tablet == nil { + return nil, vterrors.Errorf(vtrpc.Code_INVALID_ARGUMENT, "tablet alias must not be nil") + } + + tablet, err := s.ts.GetTablet(ctx, req.Tablet) + if err != nil { + return nil, err + } + + shard, err := s.ts.GetShard(ctx, tablet.Keyspace, tablet.Shard) + if err != nil { + return nil, err + } + + if !shard.HasMaster() { + return nil, vterrors.Errorf(vtrpc.Code_FAILED_PRECONDITION, "no master tablet for shard %v/%v", tablet.Keyspace, tablet.Shard) + } + + shardPrimary, err := s.ts.GetTablet(ctx, shard.MasterAlias) + if err != nil { + return nil, fmt.Errorf("cannot lookup primary tablet %v for shard %v/%v: %w", topoproto.TabletAliasString(shard.MasterAlias), tablet.Keyspace, tablet.Shard, err) + } + + if shardPrimary.Type != topodatapb.TabletType_MASTER { + return nil, vterrors.Errorf(vtrpc.Code_FAILED_PRECONDITION, "TopologyServer has incosistent state for shard master %v", topoproto.TabletAliasString(shard.MasterAlias)) + } + + if shardPrimary.Keyspace != tablet.Keyspace || shardPrimary.Shard != tablet.Shard { + return nil, vterrors.Errorf(vtrpc.Code_FAILED_PRECONDITION, "master %v and potential replica %v not in same keypace shard (%v/%v)", topoproto.TabletAliasString(shard.MasterAlias), topoproto.TabletAliasString(req.Tablet), tablet.Keyspace, tablet.Shard) + } + + if err := s.tmc.SetMaster(ctx, tablet.Tablet, shard.MasterAlias, 0, "", false); err != nil { + return nil, err + } + + return &vtctldatapb.ReparentTabletResponse{ + Keyspace: tablet.Keyspace, + Shard: tablet.Shard, + Primary: shard.MasterAlias, + }, nil } // TabletExternallyReparented is part of the vtctldservicepb.VtctldServer interface. diff --git a/go/vt/vtctl/grpcvtctldserver/server_test.go b/go/vt/vtctl/grpcvtctldserver/server_test.go index f1c61d5df36..a78c79ea64d 100644 --- a/go/vt/vtctl/grpcvtctldserver/server_test.go +++ b/go/vt/vtctl/grpcvtctldserver/server_test.go @@ -3439,6 +3439,534 @@ func TestRemoveShardCell(t *testing.T) { } } +func TestReparentTablet(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + tmc tmclient.TabletManagerClient + tablets []*topodatapb.Tablet + shards []*vtctldatapb.Shard + topoErr error + req *vtctldatapb.ReparentTabletRequest + expected *vtctldatapb.ReparentTabletResponse + shouldErr bool + }{ + { + name: "success", + tmc: &testutil.TabletManagerClient{ + SetMasterResults: map[string]error{ + "zone1-0000000100": nil, + }, + }, + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + }, + shards: []*vtctldatapb.Shard{ + { + Keyspace: "testkeyspace", + Name: "-", + Shard: &topodatapb.Shard{ + MasterAlias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + IsMasterServing: true, + }, + }, + }, + req: &vtctldatapb.ReparentTabletRequest{ + Tablet: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + }, + expected: &vtctldatapb.ReparentTabletResponse{ + Keyspace: "testkeyspace", + Shard: "-", + Primary: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + }, + shouldErr: false, + }, + { + name: "tablet is nil", + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + }, + shards: []*vtctldatapb.Shard{ + { + Keyspace: "testkeyspace", + Name: "-", + Shard: &topodatapb.Shard{ + MasterAlias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + IsMasterServing: true, + }, + }, + }, + req: &vtctldatapb.ReparentTabletRequest{ + Tablet: nil, + }, + expected: nil, + shouldErr: true, + }, + { + name: "tablet not in topo", + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + }, + shards: []*vtctldatapb.Shard{ + { + Keyspace: "testkeyspace", + Name: "-", + Shard: &topodatapb.Shard{ + MasterAlias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + IsMasterServing: true, + }, + }, + }, + req: &vtctldatapb.ReparentTabletRequest{ + Tablet: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + }, + expected: nil, + shouldErr: true, + }, + { + name: "shard not in topo", + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + }, + shards: nil, + req: &vtctldatapb.ReparentTabletRequest{ + Tablet: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + }, + expected: nil, + shouldErr: true, + }, + { + name: "shard has no primary", + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + shards: []*vtctldatapb.Shard{ + { + Keyspace: "testkeyspace", + Name: "-", + Shard: &topodatapb.Shard{ + IsMasterServing: false, + }, + }, + }, + req: &vtctldatapb.ReparentTabletRequest{ + Tablet: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + }, + expected: nil, + shouldErr: true, + }, + { + name: "shard primary not in topo", + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + }, + shards: []*vtctldatapb.Shard{ + { + Keyspace: "testkeyspace", + Name: "-", + Shard: &topodatapb.Shard{ + MasterAlias: &topodatapb.TabletAlias{ + Cell: "zone3", + Uid: 300, + }, + MasterTermStartTime: &vttime.Time{ + Seconds: 1010, + }, + IsMasterServing: true, + }, + }, + }, + req: &vtctldatapb.ReparentTabletRequest{ + Tablet: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + }, + expected: nil, + shouldErr: true, + }, + { + name: "shard primary is not type MASTER", + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + shards: []*vtctldatapb.Shard{ + { + Keyspace: "testkeyspace", + Name: "-", + Shard: &topodatapb.Shard{ + MasterAlias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + MasterTermStartTime: &vttime.Time{ + Seconds: 1010, + }, + IsMasterServing: true, + }, + }, + }, + req: &vtctldatapb.ReparentTabletRequest{ + Tablet: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + }, + expected: nil, + shouldErr: true, + }, + { + name: "shard primary is not actually in shard", + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "otherkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + }, + shards: []*vtctldatapb.Shard{ + { + Keyspace: "testkeyspace", + Name: "-", + Shard: &topodatapb.Shard{ + MasterAlias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + MasterTermStartTime: &vttime.Time{ + Seconds: 1010, + }, + IsMasterServing: true, + }, + }, + }, + req: &vtctldatapb.ReparentTabletRequest{ + Tablet: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + }, + expected: nil, + shouldErr: true, + }, + { + name: "tmc.SetMaster failure", + tmc: &testutil.TabletManagerClient{ + SetMasterResults: map[string]error{ + "zone1-0000000100": assert.AnError, + }, + }, + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + }, + shards: []*vtctldatapb.Shard{ + { + Keyspace: "testkeyspace", + Name: "-", + Shard: &topodatapb.Shard{ + MasterAlias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + IsMasterServing: true, + }, + }, + }, + req: &vtctldatapb.ReparentTabletRequest{ + Tablet: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + }, + expected: nil, + shouldErr: true, + }, + { + name: "topo is down", + tmc: &testutil.TabletManagerClient{ + SetMasterResults: map[string]error{ + "zone1-0000000100": nil, + }, + }, + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + Type: topodatapb.TabletType_MASTER, + Keyspace: "testkeyspace", + Shard: "-", + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + }, + }, + shards: []*vtctldatapb.Shard{ + { + Keyspace: "testkeyspace", + Name: "-", + Shard: &topodatapb.Shard{ + MasterAlias: &topodatapb.TabletAlias{ + Cell: "zone2", + Uid: 200, + }, + MasterTermStartTime: &vttime.Time{ + Seconds: 1000, + }, + IsMasterServing: true, + }, + }, + }, + topoErr: assert.AnError, + req: &vtctldatapb.ReparentTabletRequest{ + Tablet: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + }, + expected: nil, + shouldErr: true, + }, + } + + for _, tt := range tests { + tt := tt + + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + if tt.req == nil { + t.Skip("focused on other test cases right now") + } + + cells := []string{"zone1", "zone2", "zone3"} + + ctx := context.Background() + ts, topofactory := memorytopo.NewServerAndFactory(cells...) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, tt.tmc, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) + + testutil.AddTablets(ctx, t, ts, &testutil.AddTabletOptions{ + SkipShardCreation: true, + }, tt.tablets...) + testutil.AddShards(ctx, t, ts, tt.shards...) + + if tt.topoErr != nil { + topofactory.SetError(tt.topoErr) + } + + resp, err := vtctld.ReparentTablet(ctx, tt.req) + if tt.shouldErr { + assert.Error(t, err) + return + } + + assert.NoError(t, err) + assert.Equal(t, tt.expected, resp) + }) + } +} + func TestTabletExternallyReparented(t *testing.T) { t.Parallel() From a88301e43f1556e355e392550b9e25fc77559312 Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Sat, 30 Jan 2021 21:46:53 -0500 Subject: [PATCH 05/16] Add CLI entrypoint for `ReparentTablet` Signed-off-by: Andrew Mason --- .../internal/command/reparents.go | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/go/cmd/vtctldclient/internal/command/reparents.go b/go/cmd/vtctldclient/internal/command/reparents.go index 91430e5181d..a46b5afafd4 100644 --- a/go/cmd/vtctldclient/internal/command/reparents.go +++ b/go/cmd/vtctldclient/internal/command/reparents.go @@ -37,6 +37,14 @@ var ( Args: cobra.ExactArgs(2), RunE: commandInitShardPrimary, } + // ReparentTablet makes a ReparentTablet gRPC call to a vtctld. + ReparentTablet = &cobra.Command{ + Use: "ReparentTablet ALIAS", + Long: "Reparent a tablet to the current primary in the shard. This only works if the current replica position " + + "matches the last known reparent action.", + Args: cobra.ExactArgs(1), + RunE: commandReparentTablet, + } // TabletExternallyReparented makes a TabletExternallyReparented gRPC call // to a vtctld. TabletExternallyReparented = &cobra.Command{ @@ -79,6 +87,29 @@ func commandInitShardPrimary(cmd *cobra.Command, args []string) error { return err } +func commandReparentTablet(cmd *cobra.Command, args []string) error { + alias, err := topoproto.ParseTabletAlias(cmd.Flags().Arg(0)) + if err != nil { + return err + } + + resp, err := client.ReparentTablet(commandCtx, &vtctldatapb.ReparentTabletRequest{ + Tablet: alias, + }) + if err != nil { + return err + } + + data, err := cli.MarshalJSON(resp) + if err != nil { + return err + } + + fmt.Printf("%s\n", data) + + return nil +} + func commandTabletExternallyReparented(cmd *cobra.Command, args []string) error { alias, err := topoproto.ParseTabletAlias(cmd.Flags().Arg(0)) if err != nil { @@ -107,5 +138,6 @@ func init() { InitShardPrimary.Flags().BoolVar(&initShardPrimaryOptions.Force, "force", false, "will force the reparent even if the provided tablet is not a master or the shard master") Root.AddCommand(InitShardPrimary) + Root.AddCommand(ReparentTablet) Root.AddCommand(TabletExternallyReparented) } From 5ef0a56a0dd51e7df6e8fbe317dba2ffb66333c2 Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Sun, 21 Feb 2021 11:29:51 -0500 Subject: [PATCH 06/16] Add more protobuf-related assertion helpers to testutil Signed-off-by: Andrew Mason --- .../testutil/proto_compare.go | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/go/vt/vtctl/grpcvtctldserver/testutil/proto_compare.go b/go/vt/vtctl/grpcvtctldserver/testutil/proto_compare.go index dd06ec80d84..74322e5188e 100644 --- a/go/vt/vtctl/grpcvtctldserver/testutil/proto_compare.go +++ b/go/vt/vtctl/grpcvtctldserver/testutil/proto_compare.go @@ -21,9 +21,25 @@ import ( "github.com/stretchr/testify/assert" + logutilpb "vitess.io/vitess/go/vt/proto/logutil" vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" ) +// AssertEmergencyReparentShardResponsesEqual asserts that two +// vtctldatapb.EmergencyReparentShardResponse objects are equal, +// ignoring their respective Events field in the comparison. +func AssertEmergencyReparentShardResponsesEqual(t *testing.T, expected vtctldatapb.EmergencyReparentShardResponse, actual vtctldatapb.EmergencyReparentShardResponse, msgAndArgs ...interface{}) { + t.Helper() + + // We take both the expected and actual values by value, rather than by + // reference, so this mutation is safe to do and will not interfere with + // other assertions performed in the calling function. + expected.Events = nil + actual.Events = nil + + assert.Equal(t, expected, actual, msgAndArgs...) +} + // AssertKeyspacesEqual is a convenience function to assert that two // vtctldatapb.Keyspace objects are equal, after clearing out any reserved // proto XXX_ fields. @@ -44,3 +60,41 @@ func AssertKeyspacesEqual(t *testing.T, expected *vtctldatapb.Keyspace, actual * assert.Equal(t, expected, actual, msgAndArgs...) } + +// AssertLogutilEventsOccurred asserts that for something containing a slice of +// logutilpb.Event, that the container is non-nil, and the event slice is +// non-zero. +// +// This test function is generalized with an anonymous interface that any +// protobuf type containing a slice of logutilpb.Event elements called Events, +// which is the convention in protobuf types in the Vitess codebase, already +// implements. +func AssertLogutilEventsOccurred(t *testing.T, container interface{ GetEvents() []*logutilpb.Event }, msgAndArgs ...interface{}) { + t.Helper() + + if container == nil { + assert.Fail(t, "Events container must not be nil", msgAndArgs...) + + return + } + + assert.Greater(t, len(container.GetEvents()), 0, msgAndArgs...) +} + +// AssertNoLogutilEventsOccurred asserts that for something containing a slice +// of logutilpb.Event, that the container is either nil, or that the event slice +// is exactly zero length. +// +// This test function is generalized with an anonymous interface that any +// protobuf type containing a slice of logutilpb.Event elements called Events, +// which is the convention in protobuf types in the Vitess codebase, already +// implements. +func AssertNoLogutilEventsOccurred(t *testing.T, container interface{ GetEvents() []*logutilpb.Event }, msgAndArgs ...interface{}) { + t.Helper() + + if container == nil { + return + } + + assert.Equal(t, len(container.GetEvents()), 0, msgAndArgs...) +} From 0f3539cae31a58efdd318d25ac3e7a0de734addd Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Sun, 21 Feb 2021 11:39:02 -0500 Subject: [PATCH 07/16] Add missing set of `NewMaster` on the Reparent event after successful ERS promotion Signed-off-by: Andrew Mason --- go/vt/vtctl/reparentutil/emergency_reparenter.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go/vt/vtctl/reparentutil/emergency_reparenter.go b/go/vt/vtctl/reparentutil/emergency_reparenter.go index ca4d0dcc3c2..105bdde91ad 100644 --- a/go/vt/vtctl/reparentutil/emergency_reparenter.go +++ b/go/vt/vtctl/reparentutil/emergency_reparenter.go @@ -335,6 +335,8 @@ func (erp *EmergencyReparenter) reparentShardLocked(ctx context.Context, ev *eve return err } + ev.NewMaster = *tabletMap[winningPrimaryTabletAliasStr].Tablet + return nil } From f9998336a32eff4ca308c8575f1ffccdf08375c8 Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Sun, 21 Feb 2021 11:44:55 -0500 Subject: [PATCH 08/16] Implement ERS rpc, with tests Signed-off-by: Andrew Mason --- go/vt/topo/topoproto/tablet.go | 12 + go/vt/vtctl/grpcvtctldserver/server.go | 41 ++- .../grpcvtctldserver/server_slow_test.go | 327 ++++++++++++++++++ go/vt/vtctl/grpcvtctldserver/server_test.go | 202 +++++++++++ 4 files changed, 581 insertions(+), 1 deletion(-) create mode 100644 go/vt/vtctl/grpcvtctldserver/server_slow_test.go diff --git a/go/vt/topo/topoproto/tablet.go b/go/vt/topo/topoproto/tablet.go index bca66befc3d..ca4571bf974 100644 --- a/go/vt/topo/topoproto/tablet.go +++ b/go/vt/topo/topoproto/tablet.go @@ -134,6 +134,18 @@ func (tal TabletAliasList) Swap(i, j int) { tal[i], tal[j] = tal[j], tal[i] } +// ToStringSlice returns a slice which is the result of mapping +// TabletAliasString over a slice of TabletAliases. +func (tal TabletAliasList) ToStringSlice() []string { + result := make([]string, len(tal)) + + for i, alias := range tal { + result[i] = TabletAliasString(alias) + } + + return result +} + // AllTabletTypes lists all the possible tablet types var AllTabletTypes = []topodatapb.TabletType{ topodatapb.TabletType_MASTER, diff --git a/go/vt/vtctl/grpcvtctldserver/server.go b/go/vt/vtctl/grpcvtctldserver/server.go index 580ab747564..21c8d733bd5 100644 --- a/go/vt/vtctl/grpcvtctldserver/server.go +++ b/go/vt/vtctl/grpcvtctldserver/server.go @@ -25,6 +25,7 @@ import ( "time" "google.golang.org/grpc" + "k8s.io/apimachinery/pkg/util/sets" "vitess.io/vitess/go/event" "vitess.io/vitess/go/protoutil" @@ -38,6 +39,7 @@ import ( "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/topotools" "vitess.io/vitess/go/vt/topotools/events" + "vitess.io/vitess/go/vt/vtctl/reparentutil" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vttablet/tmclient" @@ -318,7 +320,44 @@ func (s *VtctldServer) DeleteTablets(ctx context.Context, req *vtctldatapb.Delet // EmergencyReparentShard is part of the vtctldservicepb.VtctldServer interface. func (s *VtctldServer) EmergencyReparentShard(ctx context.Context, req *vtctldatapb.EmergencyReparentShardRequest) (*vtctldatapb.EmergencyReparentShardResponse, error) { - panic("unimplemented!") + waitReplicasTimeout, ok, err := protoutil.DurationFromProto(req.WaitReplicasTimeout) + if err != nil { + return nil, err + } else if !ok { + waitReplicasTimeout = time.Second * 30 + } + + logstream := []*logutilpb.Event{} + logger := logutil.NewCallbackLogger(func(e *logutilpb.Event) { + logstream = append(logstream, e) + }) + + ev, err := reparentutil.NewEmergencyReparenter(s.ts, s.tmc, logger).ReparentShard(ctx, + req.Keyspace, + req.Shard, + reparentutil.EmergencyReparentOptions{ + NewPrimaryAlias: req.NewPrimary, + IgnoreReplicas: sets.NewString(topoproto.TabletAliasList(req.IgnoreReplicas).ToStringSlice()...), + WaitReplicasTimeout: waitReplicasTimeout, + }, + ) + + resp := &vtctldatapb.EmergencyReparentShardResponse{ + Keyspace: req.Keyspace, + Shard: req.Shard, + Events: logstream, + } + + if ev != nil { + resp.Keyspace = ev.ShardInfo.Keyspace() + resp.Shard = ev.ShardInfo.ShardName() + + if !topoproto.TabletAliasIsZero(ev.NewMaster.Alias) { + resp.PromotedPrimary = ev.NewMaster.Alias + } + } + + return resp, err } // FindAllShardsInKeyspace is part of the vtctlservicepb.VtctldServer interface. diff --git a/go/vt/vtctl/grpcvtctldserver/server_slow_test.go b/go/vt/vtctl/grpcvtctldserver/server_slow_test.go new file mode 100644 index 00000000000..0620a02d42a --- /dev/null +++ b/go/vt/vtctl/grpcvtctldserver/server_slow_test.go @@ -0,0 +1,327 @@ +/* +Copyright 2021 The Vitess Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package grpcvtctldserver + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/assert" + + "vitess.io/vitess/go/mysql" + "vitess.io/vitess/go/vt/topo" + "vitess.io/vitess/go/vt/topo/memorytopo" + "vitess.io/vitess/go/vt/vtctl/grpcvtctldserver/testutil" + "vitess.io/vitess/go/vt/vttablet/tmclient" + + replicationdatapb "vitess.io/vitess/go/vt/proto/replicationdata" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" + vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" + vtctlservicepb "vitess.io/vitess/go/vt/proto/vtctlservice" + "vitess.io/vitess/go/vt/proto/vttime" +) + +func TestEmergencyReparentShardSlow(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + ts *topo.Server + tmc tmclient.TabletManagerClient + tablets []*topodatapb.Tablet + + req *vtctldatapb.EmergencyReparentShardRequest + expected *vtctldatapb.EmergencyReparentShardResponse + expectEventsToOccur bool + shouldErr bool + }{ + { + // Note: this test case and the one below combine to assert that a + // nil WaitReplicasTimeout in the request results in a default 30 + // second WaitReplicasTimeout. + // + // They are also very slow, because they require waiting 29 seconds + // and 30 seconds, respectively. Fortunately, we can run them + // concurrently, so the total time is only around 30 seconds, but + // that's still a long time for a unit test! + name: "nil WaitReplicasTimeout and request takes 29 seconds is ok", + ts: memorytopo.NewServer("zone1"), + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_MASTER, + MasterTermStartTime: &vttime.Time{ + Seconds: 100, + }, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 101, + }, + Type: topodatapb.TabletType_RDONLY, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + tmc: &testutil.TabletManagerClient{ + DemoteMasterResults: map[string]struct { + Status *replicationdatapb.MasterStatus + Error error + }{ + "zone1-0000000100": { + Status: &replicationdatapb.MasterStatus{ + Position: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5", + }, + }, + }, + PopulateReparentJournalDelays: map[string]time.Duration{ + "zone1-0000000200": time.Second * 29, + }, + PopulateReparentJournalResults: map[string]error{ + "zone1-0000000200": nil, + }, + PromoteReplicaResults: map[string]struct { + Result string + Error error + }{ + "zone1-0000000200": {}, + }, + SetMasterResults: map[string]error{ + "zone1-0000000100": nil, + "zone1-0000000101": nil, + }, + StopReplicationAndGetStatusResults: map[string]struct { + Status *replicationdatapb.Status + StopStatus *replicationdatapb.StopReplicationStatus + Error error + }{ + "zone1-0000000100": { + Error: mysql.ErrNotReplica, + }, + "zone1-0000000101": { + Error: assert.AnError, + }, + "zone1-0000000200": { + StopStatus: &replicationdatapb.StopReplicationStatus{ + Before: &replicationdatapb.Status{}, + After: &replicationdatapb.Status{ + MasterUuid: "3E11FA47-71CA-11E1-9E33-C80AA9429562", + RelayLogPosition: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5", + Position: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5", + }, + }, + }, + }, + WaitForPositionResults: map[string]map[string]error{ + "zone1-0000000100": { + "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5": nil, + }, + "zone1-0000000200": { + "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5": nil, + }, + }, + }, + req: &vtctldatapb.EmergencyReparentShardRequest{ + Keyspace: "testkeyspace", + Shard: "-", + NewPrimary: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + WaitReplicasTimeout: nil, + }, + expected: &vtctldatapb.EmergencyReparentShardResponse{ + Keyspace: "testkeyspace", + Shard: "-", + PromotedPrimary: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + }, + expectEventsToOccur: true, + shouldErr: false, + }, + { + name: "nil WaitReplicasTimeout and request takes 31 seconds is error", + ts: memorytopo.NewServer("zone1"), + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_MASTER, + MasterTermStartTime: &vttime.Time{ + Seconds: 100, + }, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 101, + }, + Type: topodatapb.TabletType_RDONLY, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + tmc: &testutil.TabletManagerClient{ + DemoteMasterResults: map[string]struct { + Status *replicationdatapb.MasterStatus + Error error + }{ + "zone1-0000000100": { + Status: &replicationdatapb.MasterStatus{ + Position: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5", + }, + }, + }, + PopulateReparentJournalDelays: map[string]time.Duration{ + "zone1-0000000200": time.Second * 31, + }, + PopulateReparentJournalResults: map[string]error{ + "zone1-0000000200": nil, + }, + PromoteReplicaResults: map[string]struct { + Result string + Error error + }{ + "zone1-0000000200": {}, + }, + SetMasterResults: map[string]error{ + "zone1-0000000100": nil, + "zone1-0000000101": nil, + }, + StopReplicationAndGetStatusResults: map[string]struct { + Status *replicationdatapb.Status + StopStatus *replicationdatapb.StopReplicationStatus + Error error + }{ + "zone1-0000000100": { + Error: mysql.ErrNotReplica, + }, + "zone1-0000000101": { + Error: assert.AnError, + }, + "zone1-0000000200": { + StopStatus: &replicationdatapb.StopReplicationStatus{ + Before: &replicationdatapb.Status{}, + After: &replicationdatapb.Status{ + MasterUuid: "3E11FA47-71CA-11E1-9E33-C80AA9429562", + RelayLogPosition: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5", + Position: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5", + }, + }, + }, + }, + WaitForPositionResults: map[string]map[string]error{ + "zone1-0000000100": { + "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5": nil, + }, + "zone1-0000000200": { + "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5": nil, + }, + }, + }, + req: &vtctldatapb.EmergencyReparentShardRequest{ + Keyspace: "testkeyspace", + Shard: "-", + NewPrimary: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + WaitReplicasTimeout: nil, + }, + expectEventsToOccur: true, + shouldErr: true, + }, + } + + ctx := context.Background() + + for _, tt := range tests { + tt := tt + + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + if tt.req == nil { + t.Skip("tt.EmergencyReparentShardRequest = nil implies test not ready to run") + } + + testutil.AddTablets(ctx, t, tt.ts, &testutil.AddTabletOptions{ + AlsoSetShardMaster: true, + ForceSetShardMaster: true, + SkipShardCreation: false, + }, tt.tablets...) + + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, tt.ts, tt.tmc, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) + resp, err := vtctld.EmergencyReparentShard(ctx, tt.req) + + // We defer this because we want to check in both error and non- + // error cases, but after the main set of assertions for those + // cases. + defer func() { + if !tt.expectEventsToOccur { + testutil.AssertNoLogutilEventsOccurred(t, resp, "expected no events to occur during ERS") + + return + } + + testutil.AssertLogutilEventsOccurred(t, resp, "expected events to occur during ERS") + }() + + if tt.shouldErr { + assert.Error(t, err) + + return + } + + assert.NoError(t, err) + testutil.AssertEmergencyReparentShardResponsesEqual(t, *tt.expected, *resp) + }) + } +} diff --git a/go/vt/vtctl/grpcvtctldserver/server_test.go b/go/vt/vtctl/grpcvtctldserver/server_test.go index a78c79ea64d..cdcd4d58c50 100644 --- a/go/vt/vtctl/grpcvtctldserver/server_test.go +++ b/go/vt/vtctl/grpcvtctldserver/server_test.go @@ -23,9 +23,13 @@ import ( "testing" "time" + "github.com/golang/protobuf/ptypes" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + durationpb "github.com/golang/protobuf/ptypes/duration" + + "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/mysqlctl/backupstorage" "vitess.io/vitess/go/vt/topo" @@ -36,6 +40,7 @@ import ( mysqlctlpb "vitess.io/vitess/go/vt/proto/mysqlctl" querypb "vitess.io/vitess/go/vt/proto/query" + replicationdatapb "vitess.io/vitess/go/vt/proto/replicationdata" tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" topodatapb "vitess.io/vitess/go/vt/proto/topodata" vschemapb "vitess.io/vitess/go/vt/proto/vschema" @@ -1929,6 +1934,203 @@ func TestDeleteTablets(t *testing.T) { } } +func TestEmergencyReparentShard(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + ts *topo.Server + tmc tmclient.TabletManagerClient + tablets []*topodatapb.Tablet + + req *vtctldatapb.EmergencyReparentShardRequest + expected *vtctldatapb.EmergencyReparentShardResponse + expectEventsToOccur bool + shouldErr bool + }{ + { + name: "successful reparent", + ts: memorytopo.NewServer("zone1"), + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_MASTER, + MasterTermStartTime: &vttime.Time{ + Seconds: 100, + }, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 101, + }, + Type: topodatapb.TabletType_RDONLY, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + tmc: &testutil.TabletManagerClient{ + DemoteMasterResults: map[string]struct { + Status *replicationdatapb.MasterStatus + Error error + }{ + "zone1-0000000100": { + Status: &replicationdatapb.MasterStatus{ + Position: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5", + }, + }, + }, + PopulateReparentJournalResults: map[string]error{ + "zone1-0000000200": nil, + }, + PromoteReplicaResults: map[string]struct { + Result string + Error error + }{ + "zone1-0000000200": {}, + }, + SetMasterResults: map[string]error{ + "zone1-0000000100": nil, + "zone1-0000000101": nil, + }, + StopReplicationAndGetStatusResults: map[string]struct { + Status *replicationdatapb.Status + StopStatus *replicationdatapb.StopReplicationStatus + Error error + }{ + "zone1-0000000100": { + Error: mysql.ErrNotReplica, + }, + "zone1-0000000101": { + Error: assert.AnError, + }, + "zone1-0000000200": { + StopStatus: &replicationdatapb.StopReplicationStatus{ + Before: &replicationdatapb.Status{}, + After: &replicationdatapb.Status{ + MasterUuid: "3E11FA47-71CA-11E1-9E33-C80AA9429562", + RelayLogPosition: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5", + Position: "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5", + }, + }, + }, + }, + WaitForPositionResults: map[string]map[string]error{ + "zone1-0000000100": { + "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5": nil, + }, + "zone1-0000000200": { + "MySQL56/3E11FA47-71CA-11E1-9E33-C80AA9429562:1-5": nil, + }, + }, + }, + req: &vtctldatapb.EmergencyReparentShardRequest{ + Keyspace: "testkeyspace", + Shard: "-", + NewPrimary: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + WaitReplicasTimeout: ptypes.DurationProto(time.Millisecond * 10), + }, + expected: &vtctldatapb.EmergencyReparentShardResponse{ + Keyspace: "testkeyspace", + Shard: "-", + PromotedPrimary: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + }, + expectEventsToOccur: true, + shouldErr: false, + }, + { + // Note: this is testing the error-handling done in + // (*VtctldServer).EmergencyReparentShard, not the logic of an ERS. + // That logic is tested in reparentutil, and not here. Therefore, + // the simplest way to trigger a failure is to attempt an ERS on a + // shard that does not exist. + name: "failed reparent", + ts: memorytopo.NewServer("zone1"), + tablets: nil, + + req: &vtctldatapb.EmergencyReparentShardRequest{ + Keyspace: "testkeyspace", + Shard: "-", + }, + expectEventsToOccur: false, + shouldErr: true, + }, + { + name: "invalid WaitReplicasTimeout", + req: &vtctldatapb.EmergencyReparentShardRequest{ + WaitReplicasTimeout: &durationpb.Duration{ + Seconds: -1, + Nanos: 1, + }, + }, + shouldErr: true, + }, + } + + ctx := context.Background() + + for _, tt := range tests { + tt := tt + + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + testutil.AddTablets(ctx, t, tt.ts, &testutil.AddTabletOptions{ + AlsoSetShardMaster: true, + ForceSetShardMaster: true, + SkipShardCreation: false, + }, tt.tablets...) + + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, tt.ts, tt.tmc, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) + resp, err := vtctld.EmergencyReparentShard(ctx, tt.req) + + // We defer this because we want to check in both error and non- + // error cases, but after the main set of assertions for those + // cases. + defer func() { + if !tt.expectEventsToOccur { + testutil.AssertNoLogutilEventsOccurred(t, resp, "expected no events to occur during ERS") + + return + } + + testutil.AssertLogutilEventsOccurred(t, resp, "expected events to occur during ERS") + }() + + if tt.shouldErr { + assert.Error(t, err) + + return + } + + assert.NoError(t, err) + testutil.AssertEmergencyReparentShardResponsesEqual(t, *tt.expected, *resp) + }) + } +} + func TestFindAllShardsInKeyspace(t *testing.T) { ctx := context.Background() ts := memorytopo.NewServer("cell1") From d305e68b64f4e1a0e213309dd53507505245137a Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Mon, 22 Feb 2021 11:50:20 -0500 Subject: [PATCH 09/16] Add CLI entrypoint for `EmergencyReparentShard` Signed-off-by: Andrew Mason --- .../internal/command/reparents.go | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/go/cmd/vtctldclient/internal/command/reparents.go b/go/cmd/vtctldclient/internal/command/reparents.go index a46b5afafd4..ec9c6dd9905 100644 --- a/go/cmd/vtctldclient/internal/command/reparents.go +++ b/go/cmd/vtctldclient/internal/command/reparents.go @@ -25,12 +25,22 @@ import ( "vitess.io/vitess/go/cmd/vtctldclient/cli" "vitess.io/vitess/go/protoutil" "vitess.io/vitess/go/vt/log" + "vitess.io/vitess/go/vt/logutil" + "vitess.io/vitess/go/vt/topo" "vitess.io/vitess/go/vt/topo/topoproto" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" ) var ( + // EmergencyReparentShard makes an EmergencyReparent gRPC call to a vtctld. + EmergencyReparentShard = &cobra.Command{ + Use: "EmergencyReparentShard ", + Args: cobra.ExactArgs(1), + Long: "Reparents the shard to the new primary. Assumes the old primary is dead and not responding", + RunE: commandEmergencyReparentShard, + } // InitShardPrimary makes an InitShardPrimary gRPC call to a vtctld. InitShardPrimary = &cobra.Command{ Use: "InitShardPrimary", @@ -54,6 +64,60 @@ var ( } ) +var emergencyReparentShardOptions = struct { + Force bool + WaitReplicasTimeout time.Duration + NewPrimaryAliasStr string + IgnoreReplicaAliasStrList []string +}{} + +func commandEmergencyReparentShard(cmd *cobra.Command, args []string) error { + keyspace, shard, err := topoproto.ParseKeyspaceShard(cmd.Flags().Arg(0)) + if err != nil { + return err + } + + var ( + newPrimaryAlias *topodatapb.TabletAlias + ignoreReplicaAliases = make([]*topodatapb.TabletAlias, len(emergencyReparentShardOptions.IgnoreReplicaAliasStrList)) + ) + + if emergencyReparentShardOptions.NewPrimaryAliasStr != "" { + newPrimaryAlias, err = topoproto.ParseTabletAlias(emergencyReparentShardOptions.NewPrimaryAliasStr) + if err != nil { + return err + } + } + + for i, aliasStr := range emergencyReparentShardOptions.IgnoreReplicaAliasStrList { + alias, err := topoproto.ParseTabletAlias(aliasStr) + if err != nil { + return err + } + + ignoreReplicaAliases[i] = alias + } + + cli.FinishedParsing(cmd) + + resp, err := client.EmergencyReparentShard(commandCtx, &vtctldatapb.EmergencyReparentShardRequest{ + Keyspace: keyspace, + Shard: shard, + NewPrimary: newPrimaryAlias, + IgnoreReplicas: ignoreReplicaAliases, + WaitReplicasTimeout: ptypes.DurationProto(emergencyReparentShardOptions.WaitReplicasTimeout), + }) + if err != nil { + return err + } + + for _, event := range resp.Events { + fmt.Println(logutil.EventString(event)) + } + + return nil +} + var initShardPrimaryOptions = struct { WaitReplicasTimeout time.Duration Force bool @@ -134,6 +198,11 @@ func commandTabletExternallyReparented(cmd *cobra.Command, args []string) error } func init() { + EmergencyReparentShard.Flags().DurationVar(&emergencyReparentShardOptions.WaitReplicasTimeout, "wait-replicas-timeout", *topo.RemoteOperationTimeout, "Time to wait for replicas to catch up in reparenting.") + EmergencyReparentShard.Flags().StringVar(&emergencyReparentShardOptions.NewPrimaryAliasStr, "new-primary", "", "Alias of a tablet that should be the new primary. If not specified, the vtctld will select the best candidate to promote.") + EmergencyReparentShard.Flags().StringSliceVarP(&emergencyReparentShardOptions.IgnoreReplicaAliasStrList, "ignore-replicas", "i", nil, "Comma-separated, repeated list of replica tablet aliases to ignore during the emergency reparent.") + Root.AddCommand(EmergencyReparentShard) + InitShardPrimary.Flags().DurationVar(&initShardPrimaryOptions.WaitReplicasTimeout, "wait-replicas-timeout", 30*time.Second, "time to wait for replicas to catch up in reparenting") InitShardPrimary.Flags().BoolVar(&initShardPrimaryOptions.Force, "force", false, "will force the reparent even if the provided tablet is not a master or the shard master") Root.AddCommand(InitShardPrimary) From f7408dc9b3c5398033a6f64ec6dae7c03d0a8e4a Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Sun, 21 Feb 2021 12:06:39 -0500 Subject: [PATCH 10/16] Run even more tests in parallel, use the safer test helper to initialize VtctldServer with tmclient Signed-off-by: Andrew Mason --- go/vt/vtctl/grpcvtctldserver/server_test.go | 201 ++++++++++++++------ 1 file changed, 147 insertions(+), 54 deletions(-) diff --git a/go/vt/vtctl/grpcvtctldserver/server_test.go b/go/vt/vtctl/grpcvtctldserver/server_test.go index cdcd4d58c50..39cac20c0f7 100644 --- a/go/vt/vtctl/grpcvtctldserver/server_test.go +++ b/go/vt/vtctl/grpcvtctldserver/server_test.go @@ -296,6 +296,8 @@ func TestChangeTabletType(t *testing.T) { } func TestCreateKeyspace(t *testing.T) { + t.Parallel() + cells := []string{"zone1", "zone2", "zone3"} tests := []struct { name string @@ -506,13 +508,17 @@ func TestCreateKeyspace(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() + if tt.req == nil { t.Skip("test not yet implemented") } ctx := context.Background() ts := memorytopo.NewServer(cells...) - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) for name, ks := range tt.topo { testutil.AddKeyspace(ctx, t, ts, &vtctldatapb.Keyspace{ @@ -779,13 +785,17 @@ func TestCreateShard(t *testing.T) { for _, tt := range tests { tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() + if tt.req == nil { t.Skip("focusing on other tests") } ctx := context.Background() ts, topofactory := memorytopo.NewServerAndFactory("zone1") - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) for _, ks := range tt.keyspaces { testutil.AddKeyspace(ctx, t, ts, ks) @@ -957,11 +967,15 @@ func TestDeleteKeyspace(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() + cells := []string{"zone1", "zone2", "zone3"} ctx := context.Background() ts, topofactory := memorytopo.NewServerAndFactory(cells...) - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) testutil.AddKeyspaces(ctx, t, ts, tt.keyspaces...) testutil.AddShards(ctx, t, ts, tt.shards...) @@ -1382,11 +1396,15 @@ func TestDeleteShards(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() + cells := []string{"zone1", "zone2", "zone3"} ctx := context.Background() ts, topofactory := memorytopo.NewServerAndFactory(cells...) - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) testutil.AddShards(ctx, t, ts, tt.shards...) testutil.AddTablets(ctx, t, ts, nil, tt.tablets...) @@ -1869,13 +1887,17 @@ func TestDeleteTablets(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() + if tt.req == nil { t.Skip("focusing on other tests") } ctx := context.Background() ts, topofactory := memorytopo.NewServerAndFactory("zone1") - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) // Setup tablets and shards testutil.AddTablets(ctx, t, ts, nil, tt.tablets...) @@ -2132,9 +2154,13 @@ func TestEmergencyReparentShard(t *testing.T) { } func TestFindAllShardsInKeyspace(t *testing.T) { + t.Parallel() + ctx := context.Background() ts := memorytopo.NewServer("cell1") - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) ks := &vtctldatapb.Keyspace{ Name: "testkeyspace", @@ -2173,7 +2199,9 @@ func TestFindAllShardsInKeyspace(t *testing.T) { func TestGetBackups(t *testing.T) { ctx := context.Background() ts := memorytopo.NewServer() - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) testutil.BackupStorage.Backups = map[string][]string{ "testkeyspace/-": {"backup1", "backup2"}, @@ -2223,9 +2251,13 @@ func TestGetBackups(t *testing.T) { } func TestGetKeyspace(t *testing.T) { + t.Parallel() + ctx := context.Background() ts := memorytopo.NewServer("cell1") - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) expected := &vtctldatapb.GetKeyspaceResponse{ Keyspace: &vtctldatapb.Keyspace{ @@ -2246,22 +2278,31 @@ func TestGetKeyspace(t *testing.T) { } func TestGetCellInfoNames(t *testing.T) { + t.Parallel() + ctx := context.Background() ts := memorytopo.NewServer("cell1", "cell2", "cell3") - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) resp, err := vtctld.GetCellInfoNames(ctx, &vtctldatapb.GetCellInfoNamesRequest{}) assert.NoError(t, err) assert.ElementsMatch(t, []string{"cell1", "cell2", "cell3"}, resp.Names) - vtctld.ts = memorytopo.NewServer() + ts = memorytopo.NewServer() + vtctld = testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) resp, err = vtctld.GetCellInfoNames(ctx, &vtctldatapb.GetCellInfoNamesRequest{}) assert.NoError(t, err) assert.Empty(t, resp.Names) - var topofactory *memorytopo.Factory - vtctld.ts, topofactory = memorytopo.NewServerAndFactory("cell1") + ts, topofactory := memorytopo.NewServerAndFactory("cell1") + vtctld = testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) topofactory.SetError(assert.AnError) _, err = vtctld.GetCellInfoNames(ctx, &vtctldatapb.GetCellInfoNamesRequest{}) @@ -2269,9 +2310,13 @@ func TestGetCellInfoNames(t *testing.T) { } func TestGetCellInfo(t *testing.T) { + t.Parallel() + ctx := context.Background() ts := memorytopo.NewServer() - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) expected := &topodatapb.CellInfo{ ServerAddress: "example.com", @@ -2292,9 +2337,13 @@ func TestGetCellInfo(t *testing.T) { } func TestGetCellsAliases(t *testing.T) { + t.Parallel() + ctx := context.Background() ts := memorytopo.NewServer("c11", "c12", "c13", "c21", "c22") - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) alias1 := &topodatapb.CellsAlias{ Cells: []string{"c11", "c12", "c13"}, @@ -2320,7 +2369,9 @@ func TestGetCellsAliases(t *testing.T) { assert.Equal(t, expected, resp.Aliases) ts, topofactory := memorytopo.NewServerAndFactory() - vtctld.ts = ts + vtctld = testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) topofactory.SetError(assert.AnError) _, err = vtctld.GetCellsAliases(ctx, &vtctldatapb.GetCellsAliasesRequest{}) @@ -2328,9 +2379,13 @@ func TestGetCellsAliases(t *testing.T) { } func TestGetKeyspaces(t *testing.T) { + t.Parallel() + ctx := context.Background() ts, topofactory := memorytopo.NewServerAndFactory("cell1") - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) resp, err := vtctld.GetKeyspaces(ctx, &vtctldatapb.GetKeyspacesRequest{}) assert.NoError(t, err) @@ -2371,9 +2426,13 @@ func TestGetKeyspaces(t *testing.T) { } func TestGetTablet(t *testing.T) { + t.Parallel() + ctx := context.Background() ts := memorytopo.NewServer("cell1") - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) tablet := &topodatapb.Tablet{ Alias: &topodatapb.TabletAlias{ @@ -2655,7 +2714,7 @@ func TestGetShard(t *testing.T) { }, }, topoError: assert.AnError, - req: nil, + req: &vtctldatapb.GetShardRequest{}, shouldErr: true, }, } @@ -2663,32 +2722,42 @@ func TestGetShard(t *testing.T) { for _, tt := range tests { tt := tt - cells := []string{"zone1", "zone2", "zone3"} + t.Run(tt.name, func(t *testing.T) { + t.Parallel() - ctx := context.Background() - ts, topofactory := memorytopo.NewServerAndFactory(cells...) - vtctld := NewVtctldServer(ts) + cells := []string{"zone1", "zone2", "zone3"} - testutil.AddShards(ctx, t, ts, tt.topo...) + ctx := context.Background() + ts, topofactory := memorytopo.NewServerAndFactory(cells...) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) - if tt.topoError != nil { - topofactory.SetError(tt.topoError) - } + testutil.AddShards(ctx, t, ts, tt.topo...) - resp, err := vtctld.GetShard(ctx, tt.req) - if tt.shouldErr { - assert.Error(t, err) - return - } + if tt.topoError != nil { + topofactory.SetError(tt.topoError) + } + + resp, err := vtctld.GetShard(ctx, tt.req) + if tt.shouldErr { + assert.Error(t, err) + return + } - assert.Equal(t, tt.expected, resp) + assert.Equal(t, tt.expected, resp) + }) } } func TestGetSrvVSchema(t *testing.T) { + t.Parallel() + ctx := context.Background() ts, topofactory := memorytopo.NewServerAndFactory("zone1", "zone2") - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) zone1SrvVSchema := &vschemapb.SrvVSchema{ Keyspaces: map[string]*vschemapb.Keyspace{ @@ -2768,6 +2837,8 @@ func TestGetSrvVSchema(t *testing.T) { } func TestGetTablets(t *testing.T) { + t.Parallel() + tests := []struct { name string cells []string @@ -3099,9 +3170,13 @@ func TestGetTablets(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + t.Parallel() + ctx := context.Background() ts := memorytopo.NewServer(tt.cells...) - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) testutil.AddTablets(ctx, t, ts, nil, tt.tablets...) @@ -3118,38 +3193,48 @@ func TestGetTablets(t *testing.T) { } func TestGetVSchema(t *testing.T) { + t.Parallel() + ctx := context.Background() ts := memorytopo.NewServer("zone1") - vtctld := NewVtctldServer(ts) - - err := ts.SaveVSchema(ctx, "testkeyspace", &vschemapb.Keyspace{ - Sharded: true, - Vindexes: map[string]*vschemapb.Vindex{ - "v1": { - Type: "hash", - }, - }, + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) }) - require.NoError(t, err) - expected := &vtctldatapb.GetVSchemaResponse{ - VSchema: &vschemapb.Keyspace{ + t.Run("found", func(t *testing.T) { + t.Parallel() + + err := ts.SaveVSchema(ctx, "testkeyspace", &vschemapb.Keyspace{ Sharded: true, Vindexes: map[string]*vschemapb.Vindex{ "v1": { Type: "hash", }, }, - }, - } + }) + require.NoError(t, err) - resp, err := vtctld.GetVSchema(ctx, &vtctldatapb.GetVSchemaRequest{ - Keyspace: "testkeyspace", + expected := &vtctldatapb.GetVSchemaResponse{ + VSchema: &vschemapb.Keyspace{ + Sharded: true, + Vindexes: map[string]*vschemapb.Vindex{ + "v1": { + Type: "hash", + }, + }, + }, + } + + resp, err := vtctld.GetVSchema(ctx, &vtctldatapb.GetVSchemaRequest{ + Keyspace: "testkeyspace", + }) + assert.NoError(t, err) + assert.Equal(t, expected, resp) }) - assert.NoError(t, err) - assert.Equal(t, expected, resp) t.Run("not found", func(t *testing.T) { + t.Parallel() + _, err := vtctld.GetVSchema(ctx, &vtctldatapb.GetVSchemaRequest{ Keyspace: "doesnotexist", }) @@ -3287,11 +3372,15 @@ func TestRemoveKeyspaceCell(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() + cells := []string{"zone1", "zone2", "zone3"} ctx := context.Background() ts, topofactory := memorytopo.NewServerAndFactory(cells...) - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) // Setup topo if tt.keyspace != nil { @@ -3571,11 +3660,15 @@ func TestRemoveShardCell(t *testing.T) { tt := tt t.Run(tt.name, func(t *testing.T) { + t.Parallel() + cells := []string{"zone1", "zone2", "zone3"} ctx := context.Background() ts, topofactory := memorytopo.NewServerAndFactory(cells...) - vtctld := NewVtctldServer(ts) + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, ts, nil, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) // Setup shard topos and replication graphs. testutil.AddShards(ctx, t, ts, tt.shards...) From af7e8caf21c3234fed92a5986895a50565d69b50 Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Mon, 22 Feb 2021 10:55:32 -0500 Subject: [PATCH 11/16] Implement PRS rpc with tests Signed-off-by: Andrew Mason --- go/vt/vtctl/grpcvtctldserver/server.go | 39 ++- .../grpcvtctldserver/server_slow_test.go | 269 ++++++++++++++++++ go/vt/vtctl/grpcvtctldserver/server_test.go | 186 ++++++++++++ .../testutil/proto_compare.go | 16 +- 4 files changed, 507 insertions(+), 3 deletions(-) diff --git a/go/vt/vtctl/grpcvtctldserver/server.go b/go/vt/vtctl/grpcvtctldserver/server.go index 21c8d733bd5..959bb003c9d 100644 --- a/go/vt/vtctl/grpcvtctldserver/server.go +++ b/go/vt/vtctl/grpcvtctldserver/server.go @@ -910,7 +910,44 @@ func (s *VtctldServer) InitShardPrimaryLocked( // PlannedReparentShard is part of the vtctldservicepb.VtctldServer interface. func (s *VtctldServer) PlannedReparentShard(ctx context.Context, req *vtctldatapb.PlannedReparentShardRequest) (*vtctldatapb.PlannedReparentShardResponse, error) { - panic("unimplemented!") + waitReplicasTimeout, ok, err := protoutil.DurationFromProto(req.WaitReplicasTimeout) + if err != nil { + return nil, err + } else if !ok { + waitReplicasTimeout = time.Second * 30 + } + + logstream := []*logutilpb.Event{} + logger := logutil.NewCallbackLogger(func(e *logutilpb.Event) { + logstream = append(logstream, e) + }) + + ev, err := reparentutil.NewPlannedReparenter(s.ts, s.tmc, logger).ReparentShard(ctx, + req.Keyspace, + req.Shard, + reparentutil.PlannedReparentOptions{ + AvoidPrimaryAlias: req.AvoidPrimary, + NewPrimaryAlias: req.NewPrimary, + WaitReplicasTimeout: waitReplicasTimeout, + }, + ) + + resp := &vtctldatapb.PlannedReparentShardResponse{ + Keyspace: req.Keyspace, + Shard: req.Shard, + Events: logstream, + } + + if ev != nil { + resp.Keyspace = ev.ShardInfo.Keyspace() + resp.Shard = ev.ShardInfo.ShardName() + + if !topoproto.TabletAliasIsZero(ev.NewMaster.Alias) { + resp.PromotedPrimary = ev.NewMaster.Alias + } + } + + return resp, err } // RemoveKeyspaceCell is part of the vtctlservicepb.VtctldServer interface. diff --git a/go/vt/vtctl/grpcvtctldserver/server_slow_test.go b/go/vt/vtctl/grpcvtctldserver/server_slow_test.go index 0620a02d42a..8e1d17587a2 100644 --- a/go/vt/vtctl/grpcvtctldserver/server_slow_test.go +++ b/go/vt/vtctl/grpcvtctldserver/server_slow_test.go @@ -325,3 +325,272 @@ func TestEmergencyReparentShardSlow(t *testing.T) { }) } } + +func TestPlannedReparentShardSlow(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + ts *topo.Server + tmc tmclient.TabletManagerClient + tablets []*topodatapb.Tablet + + req *vtctldatapb.PlannedReparentShardRequest + expected *vtctldatapb.PlannedReparentShardResponse + expectEventsToOccur bool + shouldErr bool + }{ + { + // Note: this test case and the one below combine to assert that a + // nil WaitReplicasTimeout in the request results in a default 30 + // second WaitReplicasTimeout. + name: "nil WaitReplicasTimeout and request takes 29 seconds is ok", + ts: memorytopo.NewServer("zone1"), + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_MASTER, + MasterTermStartTime: &vttime.Time{ + Seconds: 100, + }, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 101, + }, + Type: topodatapb.TabletType_RDONLY, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + tmc: &testutil.TabletManagerClient{ + DemoteMasterResults: map[string]struct { + Status *replicationdatapb.MasterStatus + Error error + }{ + "zone1-0000000100": { + Status: &replicationdatapb.MasterStatus{ + Position: "primary-demotion position", + }, + Error: nil, + }, + }, + MasterPositionResults: map[string]struct { + Position string + Error error + }{ + "zone1-0000000100": { + Position: "doesn't matter", + Error: nil, + }, + }, + PopulateReparentJournalResults: map[string]error{ + "zone1-0000000200": nil, + }, + PromoteReplicaPostDelays: map[string]time.Duration{ + "zone1-0000000200": time.Second * 28, + }, + PromoteReplicaResults: map[string]struct { + Result string + Error error + }{ + "zone1-0000000200": { + Result: "promotion position", + Error: nil, + }, + }, + SetMasterResults: map[string]error{ + "zone1-0000000200": nil, // waiting for master-position during promotion + // reparent SetMaster calls + "zone1-0000000100": nil, + "zone1-0000000101": nil, + }, + WaitForPositionResults: map[string]map[string]error{ + "zone1-0000000200": { + "primary-demotion position": nil, + }, + }, + }, + req: &vtctldatapb.PlannedReparentShardRequest{ + Keyspace: "testkeyspace", + Shard: "-", + NewPrimary: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + WaitReplicasTimeout: nil, + }, + expected: &vtctldatapb.PlannedReparentShardResponse{ + Keyspace: "testkeyspace", + Shard: "-", + PromotedPrimary: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + }, + expectEventsToOccur: true, + shouldErr: false, + }, + { + name: "nil WaitReplicasTimeout and request takes 31 seconds is error", + ts: memorytopo.NewServer("zone1"), + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_MASTER, + MasterTermStartTime: &vttime.Time{ + Seconds: 100, + }, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 101, + }, + Type: topodatapb.TabletType_RDONLY, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + tmc: &testutil.TabletManagerClient{ + DemoteMasterResults: map[string]struct { + Status *replicationdatapb.MasterStatus + Error error + }{ + "zone1-0000000100": { + Status: &replicationdatapb.MasterStatus{ + Position: "primary-demotion position", + }, + Error: nil, + }, + }, + MasterPositionResults: map[string]struct { + Position string + Error error + }{ + "zone1-0000000100": { + Position: "doesn't matter", + Error: nil, + }, + }, + PopulateReparentJournalResults: map[string]error{ + "zone1-0000000200": nil, + }, + PromoteReplicaPostDelays: map[string]time.Duration{ + "zone1-0000000200": time.Second * 30, + }, + PromoteReplicaResults: map[string]struct { + Result string + Error error + }{ + "zone1-0000000200": { + Result: "promotion position", + Error: nil, + }, + }, + SetMasterResults: map[string]error{ + "zone1-0000000200": nil, // waiting for master-position during promotion + // reparent SetMaster calls + "zone1-0000000100": nil, + "zone1-0000000101": nil, + }, + WaitForPositionResults: map[string]map[string]error{ + "zone1-0000000200": { + "primary-demotion position": nil, + }, + }, + }, + req: &vtctldatapb.PlannedReparentShardRequest{ + Keyspace: "testkeyspace", + Shard: "-", + NewPrimary: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + WaitReplicasTimeout: nil, + }, + expected: &vtctldatapb.PlannedReparentShardResponse{ + Keyspace: "testkeyspace", + Shard: "-", + PromotedPrimary: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + }, + expectEventsToOccur: true, + shouldErr: false, + }, + } + + ctx := context.Background() + + for _, tt := range tests { + tt := tt + + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + testutil.AddTablets(ctx, t, tt.ts, &testutil.AddTabletOptions{ + AlsoSetShardMaster: true, + ForceSetShardMaster: true, + SkipShardCreation: false, + }, tt.tablets...) + + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, tt.ts, tt.tmc, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) + resp, err := vtctld.PlannedReparentShard(ctx, tt.req) + + // We defer this because we want to check in both error and non- + // error cases, but after the main set of assertions for those + // cases. + defer func() { + if !tt.expectEventsToOccur { + testutil.AssertNoLogutilEventsOccurred(t, resp, "expected no events to occur during ERS") + + return + } + + testutil.AssertLogutilEventsOccurred(t, resp, "expected events to occur during ERS") + }() + + if tt.shouldErr { + assert.Error(t, err) + + return + } + + assert.NoError(t, err) + testutil.AssertPlannedReparentShardResponsesEqual(t, *tt.expected, *resp) + }) + } +} diff --git a/go/vt/vtctl/grpcvtctldserver/server_test.go b/go/vt/vtctl/grpcvtctldserver/server_test.go index 39cac20c0f7..1ebc4a19fba 100644 --- a/go/vt/vtctl/grpcvtctldserver/server_test.go +++ b/go/vt/vtctl/grpcvtctldserver/server_test.go @@ -3242,6 +3242,192 @@ func TestGetVSchema(t *testing.T) { }) } +func TestPlannedReparentShard(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + ts *topo.Server + tmc tmclient.TabletManagerClient + tablets []*topodatapb.Tablet + + req *vtctldatapb.PlannedReparentShardRequest + expected *vtctldatapb.PlannedReparentShardResponse + expectEventsToOccur bool + shouldErr bool + }{ + { + name: "successful reparent", + ts: memorytopo.NewServer("zone1"), + tablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Type: topodatapb.TabletType_MASTER, + MasterTermStartTime: &vttime.Time{ + Seconds: 100, + }, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + Type: topodatapb.TabletType_REPLICA, + Keyspace: "testkeyspace", + Shard: "-", + }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 101, + }, + Type: topodatapb.TabletType_RDONLY, + Keyspace: "testkeyspace", + Shard: "-", + }, + }, + tmc: &testutil.TabletManagerClient{ + DemoteMasterResults: map[string]struct { + Status *replicationdatapb.MasterStatus + Error error + }{ + "zone1-0000000100": { + Status: &replicationdatapb.MasterStatus{ + Position: "primary-demotion position", + }, + Error: nil, + }, + }, + MasterPositionResults: map[string]struct { + Position string + Error error + }{ + "zone1-0000000100": { + Position: "doesn't matter", + Error: nil, + }, + }, + PopulateReparentJournalResults: map[string]error{ + "zone1-0000000200": nil, + }, + PromoteReplicaResults: map[string]struct { + Result string + Error error + }{ + "zone1-0000000200": { + Result: "promotion position", + Error: nil, + }, + }, + SetMasterResults: map[string]error{ + "zone1-0000000200": nil, // waiting for master-position during promotion + // reparent SetMaster calls + "zone1-0000000100": nil, + "zone1-0000000101": nil, + }, + WaitForPositionResults: map[string]map[string]error{ + "zone1-0000000200": { + "primary-demotion position": nil, + }, + }, + }, + req: &vtctldatapb.PlannedReparentShardRequest{ + Keyspace: "testkeyspace", + Shard: "-", + NewPrimary: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + WaitReplicasTimeout: ptypes.DurationProto(time.Millisecond * 10), + }, + expected: &vtctldatapb.PlannedReparentShardResponse{ + Keyspace: "testkeyspace", + Shard: "-", + PromotedPrimary: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 200, + }, + }, + expectEventsToOccur: true, + shouldErr: false, + }, + { + // Note: this is testing the error-handling done in + // (*VtctldServer).PlannedReparentShard, not the logic of an PRS. + // That logic is tested in reparentutil, and not here. Therefore, + // the simplest way to trigger a failure is to attempt an PRS on a + // shard that does not exist. + name: "failed reparent", + ts: memorytopo.NewServer("zone1"), + tablets: nil, + req: &vtctldatapb.PlannedReparentShardRequest{ + Keyspace: "testkeyspace", + Shard: "-", + }, + expectEventsToOccur: false, + shouldErr: true, + }, + { + name: "invalid WaitReplicasTimeout", + req: &vtctldatapb.PlannedReparentShardRequest{ + WaitReplicasTimeout: &durationpb.Duration{ + Seconds: -1, + Nanos: 1, + }, + }, + shouldErr: true, + }, + } + + ctx := context.Background() + + for _, tt := range tests { + tt := tt + + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + testutil.AddTablets(ctx, t, tt.ts, &testutil.AddTabletOptions{ + AlsoSetShardMaster: true, + ForceSetShardMaster: true, + SkipShardCreation: false, + }, tt.tablets...) + + vtctld := testutil.NewVtctldServerWithTabletManagerClient(t, tt.ts, tt.tmc, func(ts *topo.Server) vtctlservicepb.VtctldServer { + return NewVtctldServer(ts) + }) + resp, err := vtctld.PlannedReparentShard(ctx, tt.req) + + // We defer this because we want to check in both error and non- + // error cases, but after the main set of assertions for those + // cases. + defer func() { + if !tt.expectEventsToOccur { + testutil.AssertNoLogutilEventsOccurred(t, resp, "expected no events to occur during ERS") + + return + } + + testutil.AssertLogutilEventsOccurred(t, resp, "expected events to occur during ERS") + }() + + if tt.shouldErr { + assert.Error(t, err) + + return + } + + assert.NoError(t, err) + testutil.AssertPlannedReparentShardResponsesEqual(t, *tt.expected, *resp) + }) + } +} + func TestRemoveKeyspaceCell(t *testing.T) { t.Parallel() diff --git a/go/vt/vtctl/grpcvtctldserver/testutil/proto_compare.go b/go/vt/vtctl/grpcvtctldserver/testutil/proto_compare.go index 74322e5188e..b17a1b4aeaf 100644 --- a/go/vt/vtctl/grpcvtctldserver/testutil/proto_compare.go +++ b/go/vt/vtctl/grpcvtctldserver/testutil/proto_compare.go @@ -26,8 +26,8 @@ import ( ) // AssertEmergencyReparentShardResponsesEqual asserts that two -// vtctldatapb.EmergencyReparentShardResponse objects are equal, -// ignoring their respective Events field in the comparison. +// vtctldatapb.EmergencyReparentShardResponse objects are equal, ignoring their +// respective Events field in the comparison. func AssertEmergencyReparentShardResponsesEqual(t *testing.T, expected vtctldatapb.EmergencyReparentShardResponse, actual vtctldatapb.EmergencyReparentShardResponse, msgAndArgs ...interface{}) { t.Helper() @@ -40,6 +40,18 @@ func AssertEmergencyReparentShardResponsesEqual(t *testing.T, expected vtctldata assert.Equal(t, expected, actual, msgAndArgs...) } +// AssertPlannedReparentShardResponsesEqual asserts that two +// vtctldatapb.PlannedReparentShardResponse objects are equal, ignoring their +// respective Events field in the comparison. +func AssertPlannedReparentShardResponsesEqual(t *testing.T, expected vtctldatapb.PlannedReparentShardResponse, actual vtctldatapb.PlannedReparentShardResponse, msgAndArgs ...interface{}) { + t.Helper() + + expected.Events = nil + actual.Events = nil + + assert.Equal(t, expected, actual, msgAndArgs...) +} + // AssertKeyspacesEqual is a convenience function to assert that two // vtctldatapb.Keyspace objects are equal, after clearing out any reserved // proto XXX_ fields. From ac10ae921dec205104168c217784312791920c66 Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Mon, 22 Feb 2021 12:00:24 -0500 Subject: [PATCH 12/16] Add CLI entrypoint for `PlannedReparentShard` Signed-off-by: Andrew Mason --- .../internal/command/reparents.go | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/go/cmd/vtctldclient/internal/command/reparents.go b/go/cmd/vtctldclient/internal/command/reparents.go index ec9c6dd9905..f3e235c3e32 100644 --- a/go/cmd/vtctldclient/internal/command/reparents.go +++ b/go/cmd/vtctldclient/internal/command/reparents.go @@ -47,6 +47,13 @@ var ( Args: cobra.ExactArgs(2), RunE: commandInitShardPrimary, } + // PlannedReparentShard makes a PlannedReparentShard gRPC call to a vtctld. + PlannedReparentShard = &cobra.Command{ + Use: "PlannedReparentShard ", + Args: cobra.ExactArgs(1), + Long: "string", + RunE: commandPlannedReparentShard, + } // ReparentTablet makes a ReparentTablet gRPC call to a vtctld. ReparentTablet = &cobra.Command{ Use: "ReparentTablet ALIAS", @@ -151,6 +158,57 @@ func commandInitShardPrimary(cmd *cobra.Command, args []string) error { return err } +var plannedReparentShardOptions = struct { + NewPrimaryAliasStr string + AvoidPrimaryAliasStr string + WaitReplicasTimeout time.Duration +}{} + +func commandPlannedReparentShard(cmd *cobra.Command, args []string) error { + keyspace, shard, err := topoproto.ParseKeyspaceShard(cmd.Flags().Arg(0)) + if err != nil { + return err + } + + var ( + newPrimaryAlias *topodatapb.TabletAlias + avoidPrimaryAlias *topodatapb.TabletAlias + ) + + if plannedReparentShardOptions.NewPrimaryAliasStr != "" { + newPrimaryAlias, err = topoproto.ParseTabletAlias(plannedReparentShardOptions.NewPrimaryAliasStr) + if err != nil { + return err + } + } + + if plannedReparentShardOptions.AvoidPrimaryAliasStr != "" { + avoidPrimaryAlias, err = topoproto.ParseTabletAlias(plannedReparentShardOptions.AvoidPrimaryAliasStr) + if err != nil { + return err + } + } + + cli.FinishedParsing(cmd) + + resp, err := client.PlannedReparentShard(commandCtx, &vtctldatapb.PlannedReparentShardRequest{ + Keyspace: keyspace, + Shard: shard, + NewPrimary: newPrimaryAlias, + AvoidPrimary: avoidPrimaryAlias, + WaitReplicasTimeout: ptypes.DurationProto(plannedReparentShardOptions.WaitReplicasTimeout), + }) + if err != nil { + return err + } + + for _, event := range resp.Events { + fmt.Println(logutil.EventString(event)) + } + + return nil +} + func commandReparentTablet(cmd *cobra.Command, args []string) error { alias, err := topoproto.ParseTabletAlias(cmd.Flags().Arg(0)) if err != nil { @@ -207,6 +265,11 @@ func init() { InitShardPrimary.Flags().BoolVar(&initShardPrimaryOptions.Force, "force", false, "will force the reparent even if the provided tablet is not a master or the shard master") Root.AddCommand(InitShardPrimary) + PlannedReparentShard.Flags().DurationVar(&plannedReparentShardOptions.WaitReplicasTimeout, "wait-replicas-timeout", *topo.RemoteOperationTimeout, "Time to wait for replicas to catch up on replication both before and after reparenting.") + PlannedReparentShard.Flags().StringVar(&plannedReparentShardOptions.NewPrimaryAliasStr, "new-primary", "", "Alias of a tablet that should be the new primary.") + PlannedReparentShard.Flags().StringVar(&plannedReparentShardOptions.AvoidPrimaryAliasStr, "avoid-primary", "", "Alias of a tablet that should not be the primary; i.e. \"reparent to any other tablet if this one is the primary\".") + Root.AddCommand(PlannedReparentShard) + Root.AddCommand(ReparentTablet) Root.AddCommand(TabletExternallyReparented) } From f21c5905d91d6d339b849793942ac35356f05ec5 Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Mon, 22 Feb 2021 16:15:26 -0500 Subject: [PATCH 13/16] Fix data races caused by callback logger appends Signed-off-by: Andrew Mason --- go/vt/vtctl/grpcvtctldserver/server.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/go/vt/vtctl/grpcvtctldserver/server.go b/go/vt/vtctl/grpcvtctldserver/server.go index 959bb003c9d..c0caf3e138c 100644 --- a/go/vt/vtctl/grpcvtctldserver/server.go +++ b/go/vt/vtctl/grpcvtctldserver/server.go @@ -327,8 +327,12 @@ func (s *VtctldServer) EmergencyReparentShard(ctx context.Context, req *vtctldat waitReplicasTimeout = time.Second * 30 } + m := sync.Mutex{} logstream := []*logutilpb.Event{} logger := logutil.NewCallbackLogger(func(e *logutilpb.Event) { + m.Lock() + defer m.Unlock() + logstream = append(logstream, e) }) @@ -690,10 +694,14 @@ func (s *VtctldServer) InitShardPrimary(ctx context.Context, req *vtctldatapb.In } defer unlock(&err) + m := sync.Mutex{} ev := &events.Reparent{} resp := &vtctldatapb.InitShardPrimaryResponse{} err = s.InitShardPrimaryLocked(ctx, ev, req, waitReplicasTimeout, tmclient.NewTabletManagerClient(), logutil.NewCallbackLogger(func(e *logutilpb.Event) { + m.Lock() + defer m.Unlock() + resp.Events = append(resp.Events, e) })) if err != nil { @@ -917,8 +925,12 @@ func (s *VtctldServer) PlannedReparentShard(ctx context.Context, req *vtctldatap waitReplicasTimeout = time.Second * 30 } + m := sync.Mutex{} logstream := []*logutilpb.Event{} logger := logutil.NewCallbackLogger(func(e *logutilpb.Event) { + m.Lock() + defer m.Unlock() + logstream = append(logstream, e) }) From a1ba1f8eb25a187e6d45282a40160daeb05c100c Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Tue, 23 Feb 2021 21:49:14 -0500 Subject: [PATCH 14/16] Fully fix data race flakes Signed-off-by: Andrew Mason --- go/vt/vtctl/grpcvtctldserver/server.go | 29 ++++++++++++++++----- go/vt/vtctl/grpcvtctldserver/server_test.go | 3 +++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/go/vt/vtctl/grpcvtctldserver/server.go b/go/vt/vtctl/grpcvtctldserver/server.go index c0caf3e138c..e8b7736aeca 100644 --- a/go/vt/vtctl/grpcvtctldserver/server.go +++ b/go/vt/vtctl/grpcvtctldserver/server.go @@ -327,7 +327,7 @@ func (s *VtctldServer) EmergencyReparentShard(ctx context.Context, req *vtctldat waitReplicasTimeout = time.Second * 30 } - m := sync.Mutex{} + m := sync.RWMutex{} logstream := []*logutilpb.Event{} logger := logutil.NewCallbackLogger(func(e *logutilpb.Event) { m.Lock() @@ -349,7 +349,6 @@ func (s *VtctldServer) EmergencyReparentShard(ctx context.Context, req *vtctldat resp := &vtctldatapb.EmergencyReparentShardResponse{ Keyspace: req.Keyspace, Shard: req.Shard, - Events: logstream, } if ev != nil { @@ -361,6 +360,12 @@ func (s *VtctldServer) EmergencyReparentShard(ctx context.Context, req *vtctldat } } + m.RLock() + defer m.RUnlock() + + resp.Events = make([]*logutilpb.Event, len(logstream)) + copy(resp.Events, logstream) + return resp, err } @@ -694,15 +699,16 @@ func (s *VtctldServer) InitShardPrimary(ctx context.Context, req *vtctldatapb.In } defer unlock(&err) - m := sync.Mutex{} + m := sync.RWMutex{} ev := &events.Reparent{} + logstream := []*logutilpb.Event{} resp := &vtctldatapb.InitShardPrimaryResponse{} err = s.InitShardPrimaryLocked(ctx, ev, req, waitReplicasTimeout, tmclient.NewTabletManagerClient(), logutil.NewCallbackLogger(func(e *logutilpb.Event) { m.Lock() defer m.Unlock() - resp.Events = append(resp.Events, e) + logstream = append(logstream, e) })) if err != nil { event.DispatchUpdate(ev, "failed InitShardPrimary: "+err.Error()) @@ -710,6 +716,12 @@ func (s *VtctldServer) InitShardPrimary(ctx context.Context, req *vtctldatapb.In event.DispatchUpdate(ev, "finished InitShardPrimary") } + m.RLock() + defer m.RUnlock() + + resp.Events = make([]*logutilpb.Event, len(logstream)) + copy(resp.Events, logstream) + return resp, err } @@ -925,7 +937,7 @@ func (s *VtctldServer) PlannedReparentShard(ctx context.Context, req *vtctldatap waitReplicasTimeout = time.Second * 30 } - m := sync.Mutex{} + m := sync.RWMutex{} logstream := []*logutilpb.Event{} logger := logutil.NewCallbackLogger(func(e *logutilpb.Event) { m.Lock() @@ -947,7 +959,6 @@ func (s *VtctldServer) PlannedReparentShard(ctx context.Context, req *vtctldatap resp := &vtctldatapb.PlannedReparentShardResponse{ Keyspace: req.Keyspace, Shard: req.Shard, - Events: logstream, } if ev != nil { @@ -959,6 +970,12 @@ func (s *VtctldServer) PlannedReparentShard(ctx context.Context, req *vtctldatap } } + m.RLock() + defer m.RUnlock() + + resp.Events = make([]*logutilpb.Event, len(logstream)) + copy(resp.Events, logstream) + return resp, err } diff --git a/go/vt/vtctl/grpcvtctldserver/server_test.go b/go/vt/vtctl/grpcvtctldserver/server_test.go index 1ebc4a19fba..c509daa68ac 100644 --- a/go/vt/vtctl/grpcvtctldserver/server_test.go +++ b/go/vt/vtctl/grpcvtctldserver/server_test.go @@ -507,6 +507,8 @@ func TestCreateKeyspace(t *testing.T) { } for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -784,6 +786,7 @@ func TestCreateShard(t *testing.T) { for _, tt := range tests { tt := tt + t.Run(tt.name, func(t *testing.T) { t.Parallel() From 24e393ac8321691c17bd15c8ba4a188e1a464d71 Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Wed, 24 Feb 2021 15:02:37 -0500 Subject: [PATCH 15/16] Fix types after merge Signed-off-by: Andrew Mason --- go/cmd/vtctldclient/internal/command/reparents.go | 4 ++-- go/vt/vtctl/grpcvtctldserver/server_test.go | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/go/cmd/vtctldclient/internal/command/reparents.go b/go/cmd/vtctldclient/internal/command/reparents.go index f3e235c3e32..489c23d970e 100644 --- a/go/cmd/vtctldclient/internal/command/reparents.go +++ b/go/cmd/vtctldclient/internal/command/reparents.go @@ -112,7 +112,7 @@ func commandEmergencyReparentShard(cmd *cobra.Command, args []string) error { Shard: shard, NewPrimary: newPrimaryAlias, IgnoreReplicas: ignoreReplicaAliases, - WaitReplicasTimeout: ptypes.DurationProto(emergencyReparentShardOptions.WaitReplicasTimeout), + WaitReplicasTimeout: protoutil.DurationToProto(emergencyReparentShardOptions.WaitReplicasTimeout), }) if err != nil { return err @@ -196,7 +196,7 @@ func commandPlannedReparentShard(cmd *cobra.Command, args []string) error { Shard: shard, NewPrimary: newPrimaryAlias, AvoidPrimary: avoidPrimaryAlias, - WaitReplicasTimeout: ptypes.DurationProto(plannedReparentShardOptions.WaitReplicasTimeout), + WaitReplicasTimeout: protoutil.DurationToProto(plannedReparentShardOptions.WaitReplicasTimeout), }) if err != nil { return err diff --git a/go/vt/vtctl/grpcvtctldserver/server_test.go b/go/vt/vtctl/grpcvtctldserver/server_test.go index c509daa68ac..2ee99b3352c 100644 --- a/go/vt/vtctl/grpcvtctldserver/server_test.go +++ b/go/vt/vtctl/grpcvtctldserver/server_test.go @@ -23,13 +23,11 @@ import ( "testing" "time" - "github.com/golang/protobuf/ptypes" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - durationpb "github.com/golang/protobuf/ptypes/duration" - "vitess.io/vitess/go/mysql" + "vitess.io/vitess/go/protoutil" "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/mysqlctl/backupstorage" "vitess.io/vitess/go/vt/topo" @@ -2070,7 +2068,7 @@ func TestEmergencyReparentShard(t *testing.T) { Cell: "zone1", Uid: 200, }, - WaitReplicasTimeout: ptypes.DurationProto(time.Millisecond * 10), + WaitReplicasTimeout: protoutil.DurationToProto(time.Millisecond * 10), }, expected: &vtctldatapb.EmergencyReparentShardResponse{ Keyspace: "testkeyspace", @@ -2103,7 +2101,7 @@ func TestEmergencyReparentShard(t *testing.T) { { name: "invalid WaitReplicasTimeout", req: &vtctldatapb.EmergencyReparentShardRequest{ - WaitReplicasTimeout: &durationpb.Duration{ + WaitReplicasTimeout: &vttime.Duration{ Seconds: -1, Nanos: 1, }, @@ -3346,7 +3344,7 @@ func TestPlannedReparentShard(t *testing.T) { Cell: "zone1", Uid: 200, }, - WaitReplicasTimeout: ptypes.DurationProto(time.Millisecond * 10), + WaitReplicasTimeout: protoutil.DurationToProto(time.Millisecond * 10), }, expected: &vtctldatapb.PlannedReparentShardResponse{ Keyspace: "testkeyspace", @@ -3378,7 +3376,7 @@ func TestPlannedReparentShard(t *testing.T) { { name: "invalid WaitReplicasTimeout", req: &vtctldatapb.PlannedReparentShardRequest{ - WaitReplicasTimeout: &durationpb.Duration{ + WaitReplicasTimeout: &vttime.Duration{ Seconds: -1, Nanos: 1, }, From a0b69ef938adb964289492f93cc3824b16dfd38f Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Wed, 24 Feb 2021 19:47:38 -0500 Subject: [PATCH 16/16] Update `Use` strings for reparent commands Signed-off-by: Andrew Mason --- go/cmd/vtctldclient/internal/command/reparents.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/go/cmd/vtctldclient/internal/command/reparents.go b/go/cmd/vtctldclient/internal/command/reparents.go index 489c23d970e..22176d0b846 100644 --- a/go/cmd/vtctldclient/internal/command/reparents.go +++ b/go/cmd/vtctldclient/internal/command/reparents.go @@ -43,7 +43,7 @@ var ( } // InitShardPrimary makes an InitShardPrimary gRPC call to a vtctld. InitShardPrimary = &cobra.Command{ - Use: "InitShardPrimary", + Use: "InitShardPrimary ", Args: cobra.ExactArgs(2), RunE: commandInitShardPrimary, } @@ -56,7 +56,7 @@ var ( } // ReparentTablet makes a ReparentTablet gRPC call to a vtctld. ReparentTablet = &cobra.Command{ - Use: "ReparentTablet ALIAS", + Use: "ReparentTablet ", Long: "Reparent a tablet to the current primary in the shard. This only works if the current replica position " + "matches the last known reparent action.", Args: cobra.ExactArgs(1), @@ -65,7 +65,7 @@ var ( // TabletExternallyReparented makes a TabletExternallyReparented gRPC call // to a vtctld. TabletExternallyReparented = &cobra.Command{ - Use: "TabletExternallyReparented ALIAS", + Use: "TabletExternallyReparented ", Args: cobra.ExactArgs(1), RunE: commandTabletExternallyReparented, }