From dc500c29526b606c8d7d572203b284c7aaaf3e45 Mon Sep 17 00:00:00 2001 From: Sugu Sougoumarane Date: Sat, 2 May 2020 12:44:18 -0700 Subject: [PATCH 1/5] tm revamp: remove all calls to old TER Signed-off-by: Sugu Sougoumarane --- go/vt/worker/legacy_split_clone_test.go | 2 +- go/vt/worker/split_clone_flaky_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go/vt/worker/legacy_split_clone_test.go b/go/vt/worker/legacy_split_clone_test.go index be6ecfdcccc..3abe00d19b8 100644 --- a/go/vt/worker/legacy_split_clone_test.go +++ b/go/vt/worker/legacy_split_clone_test.go @@ -487,7 +487,7 @@ func TestLegacySplitCloneV2_NoMasterAvailable(t *testing.T) { } // Make leftReplica the new MASTER. - tc.leftReplica.Agent.TabletExternallyReparented(ctx, "1") + tc.leftReplica.Agent.ChangeType(ctx, topodatapb.TabletType_MASTER) tc.leftReplicaQs.UpdateType(topodatapb.TabletType_MASTER) tc.leftReplicaQs.AddDefaultHealthResponse() errs <- nil diff --git a/go/vt/worker/split_clone_flaky_test.go b/go/vt/worker/split_clone_flaky_test.go index 85716875384..5c425e0889c 100644 --- a/go/vt/worker/split_clone_flaky_test.go +++ b/go/vt/worker/split_clone_flaky_test.go @@ -1046,7 +1046,7 @@ func TestSplitCloneV2_NoMasterAvailable(t *testing.T) { } // Make leftReplica the new MASTER. - tc.leftReplica.Agent.TabletExternallyReparented(ctx, "1") + tc.leftReplica.Agent.ChangeType(ctx, topodatapb.TabletType_MASTER) t.Logf("resetting tablet back to MASTER") tc.leftReplicaQs.UpdateType(topodatapb.TabletType_MASTER) tc.leftReplicaQs.AddDefaultHealthResponse() From 5407fe75bc065ad6bf46bad932fe38cb57d2025b Mon Sep 17 00:00:00 2001 From: Sugu Sougoumarane Date: Sat, 2 May 2020 13:09:09 -0700 Subject: [PATCH 2/5] tm revamp: remove deprecated taabletmanager TER Signed-off-by: Sugu Sougoumarane --- .../tabletmanagerdata/tabletmanagerdata.pb.go | 476 +++++-------- .../tabletmanagerservice.pb.go | 251 ++----- go/vt/vtcombo/tablet_map.go | 4 - go/vt/vttablet/agentrpctest/test_agent_rpc.go | 22 - go/vt/vttablet/faketmclient/fake_client.go | 5 - go/vt/vttablet/grpctmclient/client.go | 13 - go/vt/vttablet/grpctmserver/server.go | 11 - go/vt/vttablet/tabletmanager/action_agent.go | 4 - go/vt/vttablet/tabletmanager/rpc_agent.go | 2 - .../tabletmanager/rpc_external_reparent.go | 271 -------- .../rpc_external_reparent_test.go | 45 -- go/vt/vttablet/tmclient/rpc_client_api.go | 8 - go/vt/worker/legacy_split_clone_test.go | 61 -- go/vt/worker/split_clone_flaky_test.go | 61 -- go/vt/wrangler/testlib/find_tablet_test.go | 4 - .../testlib/rpc_reparent_external_test.go | 649 ------------------ proto/tabletmanagerdata.proto | 16 - proto/tabletmanagerservice.proto | 28 - 18 files changed, 231 insertions(+), 1700 deletions(-) delete mode 100644 go/vt/vttablet/tabletmanager/rpc_external_reparent.go delete mode 100644 go/vt/vttablet/tabletmanager/rpc_external_reparent_test.go delete mode 100644 go/vt/wrangler/testlib/rpc_reparent_external_test.go diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go index cd40e4c5918..f2913194895 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go @@ -2415,141 +2415,6 @@ func (m *StartSlaveUntilAfterResponse) XXX_DiscardUnknown() { var xxx_messageInfo_StartSlaveUntilAfterResponse proto.InternalMessageInfo -type TabletExternallyReparentedRequest struct { - // external_id is an string value that may be provided by an external - // agent for tracking purposes. The tablet will emit this string in - // events triggered by TabletExternallyReparented, such as VitessReparent. - ExternalId string `protobuf:"bytes,1,opt,name=external_id,json=externalId,proto3" json:"external_id,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_ff9ac4f89e61ffa4, []int{58} -} - -func (m *TabletExternallyReparentedRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TabletExternallyReparentedRequest.Unmarshal(m, b) -} -func (m *TabletExternallyReparentedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TabletExternallyReparentedRequest.Marshal(b, m, deterministic) -} -func (m *TabletExternallyReparentedRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TabletExternallyReparentedRequest.Merge(m, src) -} -func (m *TabletExternallyReparentedRequest) XXX_Size() int { - return xxx_messageInfo_TabletExternallyReparentedRequest.Size(m) -} -func (m *TabletExternallyReparentedRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TabletExternallyReparentedRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TabletExternallyReparentedRequest proto.InternalMessageInfo - -func (m *TabletExternallyReparentedRequest) GetExternalId() string { - if m != nil { - return m.ExternalId - } - return "" -} - -type TabletExternallyReparentedResponse struct { - 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_ff9ac4f89e61ffa4, []int{59} -} - -func (m *TabletExternallyReparentedResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TabletExternallyReparentedResponse.Unmarshal(m, b) -} -func (m *TabletExternallyReparentedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TabletExternallyReparentedResponse.Marshal(b, m, deterministic) -} -func (m *TabletExternallyReparentedResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TabletExternallyReparentedResponse.Merge(m, src) -} -func (m *TabletExternallyReparentedResponse) XXX_Size() int { - return xxx_messageInfo_TabletExternallyReparentedResponse.Size(m) -} -func (m *TabletExternallyReparentedResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TabletExternallyReparentedResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TabletExternallyReparentedResponse proto.InternalMessageInfo - -type TabletExternallyElectedRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TabletExternallyElectedRequest) Reset() { *m = TabletExternallyElectedRequest{} } -func (m *TabletExternallyElectedRequest) String() string { return proto.CompactTextString(m) } -func (*TabletExternallyElectedRequest) ProtoMessage() {} -func (*TabletExternallyElectedRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{60} -} - -func (m *TabletExternallyElectedRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TabletExternallyElectedRequest.Unmarshal(m, b) -} -func (m *TabletExternallyElectedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TabletExternallyElectedRequest.Marshal(b, m, deterministic) -} -func (m *TabletExternallyElectedRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_TabletExternallyElectedRequest.Merge(m, src) -} -func (m *TabletExternallyElectedRequest) XXX_Size() int { - return xxx_messageInfo_TabletExternallyElectedRequest.Size(m) -} -func (m *TabletExternallyElectedRequest) XXX_DiscardUnknown() { - xxx_messageInfo_TabletExternallyElectedRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_TabletExternallyElectedRequest proto.InternalMessageInfo - -type TabletExternallyElectedResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TabletExternallyElectedResponse) Reset() { *m = TabletExternallyElectedResponse{} } -func (m *TabletExternallyElectedResponse) String() string { return proto.CompactTextString(m) } -func (*TabletExternallyElectedResponse) ProtoMessage() {} -func (*TabletExternallyElectedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{61} -} - -func (m *TabletExternallyElectedResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_TabletExternallyElectedResponse.Unmarshal(m, b) -} -func (m *TabletExternallyElectedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_TabletExternallyElectedResponse.Marshal(b, m, deterministic) -} -func (m *TabletExternallyElectedResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_TabletExternallyElectedResponse.Merge(m, src) -} -func (m *TabletExternallyElectedResponse) XXX_Size() int { - return xxx_messageInfo_TabletExternallyElectedResponse.Size(m) -} -func (m *TabletExternallyElectedResponse) XXX_DiscardUnknown() { - xxx_messageInfo_TabletExternallyElectedResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_TabletExternallyElectedResponse proto.InternalMessageInfo - type GetSlavesRequest struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -2560,7 +2425,7 @@ func (m *GetSlavesRequest) Reset() { *m = GetSlavesRequest{} } func (m *GetSlavesRequest) String() string { return proto.CompactTextString(m) } func (*GetSlavesRequest) ProtoMessage() {} func (*GetSlavesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{62} + return fileDescriptor_ff9ac4f89e61ffa4, []int{58} } func (m *GetSlavesRequest) XXX_Unmarshal(b []byte) error { @@ -2592,7 +2457,7 @@ func (m *GetSlavesResponse) Reset() { *m = GetSlavesResponse{} } func (m *GetSlavesResponse) String() string { return proto.CompactTextString(m) } func (*GetSlavesResponse) ProtoMessage() {} func (*GetSlavesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{63} + return fileDescriptor_ff9ac4f89e61ffa4, []int{59} } func (m *GetSlavesResponse) XXX_Unmarshal(b []byte) error { @@ -2630,7 +2495,7 @@ func (m *ResetReplicationRequest) Reset() { *m = ResetReplicationRequest func (m *ResetReplicationRequest) String() string { return proto.CompactTextString(m) } func (*ResetReplicationRequest) ProtoMessage() {} func (*ResetReplicationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{64} + return fileDescriptor_ff9ac4f89e61ffa4, []int{60} } func (m *ResetReplicationRequest) XXX_Unmarshal(b []byte) error { @@ -2661,7 +2526,7 @@ func (m *ResetReplicationResponse) Reset() { *m = ResetReplicationRespon func (m *ResetReplicationResponse) String() string { return proto.CompactTextString(m) } func (*ResetReplicationResponse) ProtoMessage() {} func (*ResetReplicationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{65} + return fileDescriptor_ff9ac4f89e61ffa4, []int{61} } func (m *ResetReplicationResponse) XXX_Unmarshal(b []byte) error { @@ -2693,7 +2558,7 @@ func (m *VReplicationExecRequest) Reset() { *m = VReplicationExecRequest func (m *VReplicationExecRequest) String() string { return proto.CompactTextString(m) } func (*VReplicationExecRequest) ProtoMessage() {} func (*VReplicationExecRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{66} + return fileDescriptor_ff9ac4f89e61ffa4, []int{62} } func (m *VReplicationExecRequest) XXX_Unmarshal(b []byte) error { @@ -2732,7 +2597,7 @@ func (m *VReplicationExecResponse) Reset() { *m = VReplicationExecRespon func (m *VReplicationExecResponse) String() string { return proto.CompactTextString(m) } func (*VReplicationExecResponse) ProtoMessage() {} func (*VReplicationExecResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{67} + return fileDescriptor_ff9ac4f89e61ffa4, []int{63} } func (m *VReplicationExecResponse) XXX_Unmarshal(b []byte) error { @@ -2772,7 +2637,7 @@ func (m *VReplicationWaitForPosRequest) Reset() { *m = VReplicationWaitF func (m *VReplicationWaitForPosRequest) String() string { return proto.CompactTextString(m) } func (*VReplicationWaitForPosRequest) ProtoMessage() {} func (*VReplicationWaitForPosRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{68} + return fileDescriptor_ff9ac4f89e61ffa4, []int{64} } func (m *VReplicationWaitForPosRequest) XXX_Unmarshal(b []byte) error { @@ -2817,7 +2682,7 @@ func (m *VReplicationWaitForPosResponse) Reset() { *m = VReplicationWait func (m *VReplicationWaitForPosResponse) String() string { return proto.CompactTextString(m) } func (*VReplicationWaitForPosResponse) ProtoMessage() {} func (*VReplicationWaitForPosResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{69} + return fileDescriptor_ff9ac4f89e61ffa4, []int{65} } func (m *VReplicationWaitForPosResponse) XXX_Unmarshal(b []byte) error { @@ -2848,7 +2713,7 @@ func (m *InitMasterRequest) Reset() { *m = InitMasterRequest{} } func (m *InitMasterRequest) String() string { return proto.CompactTextString(m) } func (*InitMasterRequest) ProtoMessage() {} func (*InitMasterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{70} + return fileDescriptor_ff9ac4f89e61ffa4, []int{66} } func (m *InitMasterRequest) XXX_Unmarshal(b []byte) error { @@ -2880,7 +2745,7 @@ func (m *InitMasterResponse) Reset() { *m = InitMasterResponse{} } func (m *InitMasterResponse) String() string { return proto.CompactTextString(m) } func (*InitMasterResponse) ProtoMessage() {} func (*InitMasterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{71} + return fileDescriptor_ff9ac4f89e61ffa4, []int{67} } func (m *InitMasterResponse) XXX_Unmarshal(b []byte) error { @@ -2922,7 +2787,7 @@ func (m *PopulateReparentJournalRequest) Reset() { *m = PopulateReparent func (m *PopulateReparentJournalRequest) String() string { return proto.CompactTextString(m) } func (*PopulateReparentJournalRequest) ProtoMessage() {} func (*PopulateReparentJournalRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{72} + return fileDescriptor_ff9ac4f89e61ffa4, []int{68} } func (m *PopulateReparentJournalRequest) XXX_Unmarshal(b []byte) error { @@ -2981,7 +2846,7 @@ func (m *PopulateReparentJournalResponse) Reset() { *m = PopulateReparen func (m *PopulateReparentJournalResponse) String() string { return proto.CompactTextString(m) } func (*PopulateReparentJournalResponse) ProtoMessage() {} func (*PopulateReparentJournalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{73} + return fileDescriptor_ff9ac4f89e61ffa4, []int{69} } func (m *PopulateReparentJournalResponse) XXX_Unmarshal(b []byte) error { @@ -3015,7 +2880,7 @@ func (m *InitSlaveRequest) Reset() { *m = InitSlaveRequest{} } func (m *InitSlaveRequest) String() string { return proto.CompactTextString(m) } func (*InitSlaveRequest) ProtoMessage() {} func (*InitSlaveRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{74} + return fileDescriptor_ff9ac4f89e61ffa4, []int{70} } func (m *InitSlaveRequest) XXX_Unmarshal(b []byte) error { @@ -3067,7 +2932,7 @@ func (m *InitSlaveResponse) Reset() { *m = InitSlaveResponse{} } func (m *InitSlaveResponse) String() string { return proto.CompactTextString(m) } func (*InitSlaveResponse) ProtoMessage() {} func (*InitSlaveResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{75} + return fileDescriptor_ff9ac4f89e61ffa4, []int{71} } func (m *InitSlaveResponse) XXX_Unmarshal(b []byte) error { @@ -3098,7 +2963,7 @@ func (m *DemoteMasterRequest) Reset() { *m = DemoteMasterRequest{} } func (m *DemoteMasterRequest) String() string { return proto.CompactTextString(m) } func (*DemoteMasterRequest) ProtoMessage() {} func (*DemoteMasterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{76} + return fileDescriptor_ff9ac4f89e61ffa4, []int{72} } func (m *DemoteMasterRequest) XXX_Unmarshal(b []byte) error { @@ -3130,7 +2995,7 @@ func (m *DemoteMasterResponse) Reset() { *m = DemoteMasterResponse{} } func (m *DemoteMasterResponse) String() string { return proto.CompactTextString(m) } func (*DemoteMasterResponse) ProtoMessage() {} func (*DemoteMasterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{77} + return fileDescriptor_ff9ac4f89e61ffa4, []int{73} } func (m *DemoteMasterResponse) XXX_Unmarshal(b []byte) error { @@ -3168,7 +3033,7 @@ func (m *UndoDemoteMasterRequest) Reset() { *m = UndoDemoteMasterRequest func (m *UndoDemoteMasterRequest) String() string { return proto.CompactTextString(m) } func (*UndoDemoteMasterRequest) ProtoMessage() {} func (*UndoDemoteMasterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{78} + return fileDescriptor_ff9ac4f89e61ffa4, []int{74} } func (m *UndoDemoteMasterRequest) XXX_Unmarshal(b []byte) error { @@ -3199,7 +3064,7 @@ func (m *UndoDemoteMasterResponse) Reset() { *m = UndoDemoteMasterRespon func (m *UndoDemoteMasterResponse) String() string { return proto.CompactTextString(m) } func (*UndoDemoteMasterResponse) ProtoMessage() {} func (*UndoDemoteMasterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{79} + return fileDescriptor_ff9ac4f89e61ffa4, []int{75} } func (m *UndoDemoteMasterResponse) XXX_Unmarshal(b []byte) error { @@ -3232,7 +3097,7 @@ func (m *PromoteSlaveWhenCaughtUpRequest) Reset() { *m = PromoteSlaveWhe func (m *PromoteSlaveWhenCaughtUpRequest) String() string { return proto.CompactTextString(m) } func (*PromoteSlaveWhenCaughtUpRequest) ProtoMessage() {} func (*PromoteSlaveWhenCaughtUpRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{80} + return fileDescriptor_ff9ac4f89e61ffa4, []int{76} } func (m *PromoteSlaveWhenCaughtUpRequest) XXX_Unmarshal(b []byte) error { @@ -3272,7 +3137,7 @@ func (m *PromoteSlaveWhenCaughtUpResponse) Reset() { *m = PromoteSlaveWh func (m *PromoteSlaveWhenCaughtUpResponse) String() string { return proto.CompactTextString(m) } func (*PromoteSlaveWhenCaughtUpResponse) ProtoMessage() {} func (*PromoteSlaveWhenCaughtUpResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{81} + return fileDescriptor_ff9ac4f89e61ffa4, []int{77} } func (m *PromoteSlaveWhenCaughtUpResponse) XXX_Unmarshal(b []byte) error { @@ -3310,7 +3175,7 @@ func (m *SlaveWasPromotedRequest) Reset() { *m = SlaveWasPromotedRequest func (m *SlaveWasPromotedRequest) String() string { return proto.CompactTextString(m) } func (*SlaveWasPromotedRequest) ProtoMessage() {} func (*SlaveWasPromotedRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{82} + return fileDescriptor_ff9ac4f89e61ffa4, []int{78} } func (m *SlaveWasPromotedRequest) XXX_Unmarshal(b []byte) error { @@ -3341,7 +3206,7 @@ func (m *SlaveWasPromotedResponse) Reset() { *m = SlaveWasPromotedRespon func (m *SlaveWasPromotedResponse) String() string { return proto.CompactTextString(m) } func (*SlaveWasPromotedResponse) ProtoMessage() {} func (*SlaveWasPromotedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{83} + return fileDescriptor_ff9ac4f89e61ffa4, []int{79} } func (m *SlaveWasPromotedResponse) XXX_Unmarshal(b []byte) error { @@ -3376,7 +3241,7 @@ func (m *SetMasterRequest) Reset() { *m = SetMasterRequest{} } func (m *SetMasterRequest) String() string { return proto.CompactTextString(m) } func (*SetMasterRequest) ProtoMessage() {} func (*SetMasterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{84} + return fileDescriptor_ff9ac4f89e61ffa4, []int{80} } func (m *SetMasterRequest) XXX_Unmarshal(b []byte) error { @@ -3435,7 +3300,7 @@ func (m *SetMasterResponse) Reset() { *m = SetMasterResponse{} } func (m *SetMasterResponse) String() string { return proto.CompactTextString(m) } func (*SetMasterResponse) ProtoMessage() {} func (*SetMasterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{85} + return fileDescriptor_ff9ac4f89e61ffa4, []int{81} } func (m *SetMasterResponse) XXX_Unmarshal(b []byte) error { @@ -3468,7 +3333,7 @@ func (m *SlaveWasRestartedRequest) Reset() { *m = SlaveWasRestartedReque func (m *SlaveWasRestartedRequest) String() string { return proto.CompactTextString(m) } func (*SlaveWasRestartedRequest) ProtoMessage() {} func (*SlaveWasRestartedRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{86} + return fileDescriptor_ff9ac4f89e61ffa4, []int{82} } func (m *SlaveWasRestartedRequest) XXX_Unmarshal(b []byte) error { @@ -3506,7 +3371,7 @@ func (m *SlaveWasRestartedResponse) Reset() { *m = SlaveWasRestartedResp func (m *SlaveWasRestartedResponse) String() string { return proto.CompactTextString(m) } func (*SlaveWasRestartedResponse) ProtoMessage() {} func (*SlaveWasRestartedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{87} + return fileDescriptor_ff9ac4f89e61ffa4, []int{83} } func (m *SlaveWasRestartedResponse) XXX_Unmarshal(b []byte) error { @@ -3537,7 +3402,7 @@ func (m *StopReplicationAndGetStatusRequest) Reset() { *m = StopReplicat func (m *StopReplicationAndGetStatusRequest) String() string { return proto.CompactTextString(m) } func (*StopReplicationAndGetStatusRequest) ProtoMessage() {} func (*StopReplicationAndGetStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{88} + return fileDescriptor_ff9ac4f89e61ffa4, []int{84} } func (m *StopReplicationAndGetStatusRequest) XXX_Unmarshal(b []byte) error { @@ -3569,7 +3434,7 @@ func (m *StopReplicationAndGetStatusResponse) Reset() { *m = StopReplica func (m *StopReplicationAndGetStatusResponse) String() string { return proto.CompactTextString(m) } func (*StopReplicationAndGetStatusResponse) ProtoMessage() {} func (*StopReplicationAndGetStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{89} + return fileDescriptor_ff9ac4f89e61ffa4, []int{85} } func (m *StopReplicationAndGetStatusResponse) XXX_Unmarshal(b []byte) error { @@ -3608,7 +3473,7 @@ func (m *PromoteSlaveRequest) Reset() { *m = PromoteSlaveRequest{} } func (m *PromoteSlaveRequest) String() string { return proto.CompactTextString(m) } func (*PromoteSlaveRequest) ProtoMessage() {} func (*PromoteSlaveRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{90} + return fileDescriptor_ff9ac4f89e61ffa4, []int{86} } func (m *PromoteSlaveRequest) XXX_Unmarshal(b []byte) error { @@ -3641,7 +3506,7 @@ func (m *PromoteSlaveResponse) Reset() { *m = PromoteSlaveResponse{} } func (m *PromoteSlaveResponse) String() string { return proto.CompactTextString(m) } func (*PromoteSlaveResponse) ProtoMessage() {} func (*PromoteSlaveResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{91} + return fileDescriptor_ff9ac4f89e61ffa4, []int{87} } func (m *PromoteSlaveResponse) XXX_Unmarshal(b []byte) error { @@ -3679,7 +3544,7 @@ func (m *PromoteReplicaRequest) Reset() { *m = PromoteReplicaRequest{} } func (m *PromoteReplicaRequest) String() string { return proto.CompactTextString(m) } func (*PromoteReplicaRequest) ProtoMessage() {} func (*PromoteReplicaRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{92} + return fileDescriptor_ff9ac4f89e61ffa4, []int{88} } func (m *PromoteReplicaRequest) XXX_Unmarshal(b []byte) error { @@ -3711,7 +3576,7 @@ func (m *PromoteReplicaResponse) Reset() { *m = PromoteReplicaResponse{} func (m *PromoteReplicaResponse) String() string { return proto.CompactTextString(m) } func (*PromoteReplicaResponse) ProtoMessage() {} func (*PromoteReplicaResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{93} + return fileDescriptor_ff9ac4f89e61ffa4, []int{89} } func (m *PromoteReplicaResponse) XXX_Unmarshal(b []byte) error { @@ -3751,7 +3616,7 @@ func (m *BackupRequest) Reset() { *m = BackupRequest{} } func (m *BackupRequest) String() string { return proto.CompactTextString(m) } func (*BackupRequest) ProtoMessage() {} func (*BackupRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{94} + return fileDescriptor_ff9ac4f89e61ffa4, []int{90} } func (m *BackupRequest) XXX_Unmarshal(b []byte) error { @@ -3797,7 +3662,7 @@ func (m *BackupResponse) Reset() { *m = BackupResponse{} } func (m *BackupResponse) String() string { return proto.CompactTextString(m) } func (*BackupResponse) ProtoMessage() {} func (*BackupResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{95} + return fileDescriptor_ff9ac4f89e61ffa4, []int{91} } func (m *BackupResponse) XXX_Unmarshal(b []byte) error { @@ -3835,7 +3700,7 @@ func (m *RestoreFromBackupRequest) Reset() { *m = RestoreFromBackupReque func (m *RestoreFromBackupRequest) String() string { return proto.CompactTextString(m) } func (*RestoreFromBackupRequest) ProtoMessage() {} func (*RestoreFromBackupRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{96} + return fileDescriptor_ff9ac4f89e61ffa4, []int{92} } func (m *RestoreFromBackupRequest) XXX_Unmarshal(b []byte) error { @@ -3867,7 +3732,7 @@ func (m *RestoreFromBackupResponse) Reset() { *m = RestoreFromBackupResp func (m *RestoreFromBackupResponse) String() string { return proto.CompactTextString(m) } func (*RestoreFromBackupResponse) ProtoMessage() {} func (*RestoreFromBackupResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9ac4f89e61ffa4, []int{97} + return fileDescriptor_ff9ac4f89e61ffa4, []int{93} } func (m *RestoreFromBackupResponse) XXX_Unmarshal(b []byte) error { @@ -3957,10 +3822,6 @@ func init() { proto.RegisterType((*StartSlaveResponse)(nil), "tabletmanagerdata.StartSlaveResponse") proto.RegisterType((*StartSlaveUntilAfterRequest)(nil), "tabletmanagerdata.StartSlaveUntilAfterRequest") proto.RegisterType((*StartSlaveUntilAfterResponse)(nil), "tabletmanagerdata.StartSlaveUntilAfterResponse") - proto.RegisterType((*TabletExternallyReparentedRequest)(nil), "tabletmanagerdata.TabletExternallyReparentedRequest") - proto.RegisterType((*TabletExternallyReparentedResponse)(nil), "tabletmanagerdata.TabletExternallyReparentedResponse") - proto.RegisterType((*TabletExternallyElectedRequest)(nil), "tabletmanagerdata.TabletExternallyElectedRequest") - proto.RegisterType((*TabletExternallyElectedResponse)(nil), "tabletmanagerdata.TabletExternallyElectedResponse") proto.RegisterType((*GetSlavesRequest)(nil), "tabletmanagerdata.GetSlavesRequest") proto.RegisterType((*GetSlavesResponse)(nil), "tabletmanagerdata.GetSlavesResponse") proto.RegisterType((*ResetReplicationRequest)(nil), "tabletmanagerdata.ResetReplicationRequest") @@ -4002,138 +3863,135 @@ func init() { func init() { proto.RegisterFile("tabletmanagerdata.proto", fileDescriptor_ff9ac4f89e61ffa4) } var fileDescriptor_ff9ac4f89e61ffa4 = []byte{ - // 2121 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0x5b, 0x6f, 0x1b, 0xc7, - 0x15, 0x06, 0x49, 0x49, 0xa6, 0x0e, 0x2f, 0x22, 0x97, 0x94, 0x48, 0xc9, 0x8d, 0x2e, 0x6b, 0xa7, - 0x51, 0x5d, 0x94, 0x4a, 0x94, 0x34, 0x08, 0x52, 0xa4, 0xa8, 0xac, 0x8b, 0xed, 0x44, 0x89, 0x95, - 0x95, 0x65, 0x17, 0x41, 0x81, 0xc5, 0x90, 0x3b, 0x22, 0x17, 0x5a, 0xee, 0xac, 0x67, 0x66, 0x29, - 0xf1, 0x4f, 0xf4, 0x17, 0xf4, 0xad, 0x40, 0xfb, 0xde, 0xc7, 0xfe, 0x10, 0xf7, 0xa7, 0xf4, 0xa1, - 0x0f, 0x2d, 0xe6, 0xb2, 0xe4, 0x2c, 0x49, 0xc9, 0x92, 0xe0, 0x02, 0x79, 0x11, 0x38, 0xdf, 0x39, - 0x73, 0x6e, 0x73, 0x6e, 0x0b, 0x41, 0x83, 0xa3, 0x76, 0x80, 0x79, 0x1f, 0x85, 0xa8, 0x8b, 0xa9, - 0x87, 0x38, 0x6a, 0x45, 0x94, 0x70, 0x62, 0x55, 0xa7, 0x08, 0x6b, 0x85, 0xb7, 0x31, 0xa6, 0x43, - 0x45, 0x5f, 0x2b, 0x73, 0x12, 0x91, 0x31, 0xff, 0xda, 0x32, 0xc5, 0x51, 0xe0, 0x77, 0x10, 0xf7, - 0x49, 0x68, 0xc0, 0xa5, 0x80, 0x74, 0x63, 0xee, 0x07, 0xea, 0x68, 0xff, 0x37, 0x03, 0x4b, 0xaf, - 0x84, 0xe0, 0x03, 0x7c, 0xee, 0x87, 0xbe, 0x60, 0xb6, 0x2c, 0x98, 0x0b, 0x51, 0x1f, 0x37, 0x33, - 0x9b, 0x99, 0xed, 0x45, 0x47, 0xfe, 0xb6, 0x56, 0x60, 0x81, 0x75, 0x7a, 0xb8, 0x8f, 0x9a, 0x59, - 0x89, 0xea, 0x93, 0xd5, 0x84, 0x07, 0x1d, 0x12, 0xc4, 0xfd, 0x90, 0x35, 0x73, 0x9b, 0xb9, 0xed, - 0x45, 0x27, 0x39, 0x5a, 0x2d, 0xa8, 0x45, 0xd4, 0xef, 0x23, 0x3a, 0x74, 0x2f, 0xf0, 0xd0, 0x4d, - 0xb8, 0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, - 0x67, 0x66, 0x1d, 0x41, 0xd9, 0x6b, 0xa7, 0x64, 0xa9, 0x0a, 0xda, 0x78, 0x8f, 0xc7, 0x4e, 0xc9, - 0x33, 0x4e, 0xcc, 0xfe, 0x04, 0x0a, 0x27, 0x7e, 0xd8, 0x75, 0xf0, 0xdb, 0x18, 0x33, 0x2e, 0x4a, - 0x29, 0x42, 0xc3, 0x80, 0x20, 0x4f, 0x3b, 0x99, 0x1c, 0xed, 0x6d, 0x28, 0x2a, 0x46, 0x16, 0x91, - 0x90, 0xe1, 0x1b, 0x38, 0x9f, 0x40, 0xf1, 0x34, 0xc0, 0x38, 0x4a, 0x64, 0xae, 0x41, 0xde, 0x8b, - 0xa9, 0x6c, 0xaa, 0x92, 0x35, 0xe7, 0x8c, 0xce, 0xf6, 0x12, 0x94, 0x34, 0xaf, 0x12, 0x6b, 0xff, - 0x2b, 0x03, 0xd6, 0xe1, 0x15, 0xee, 0xc4, 0x1c, 0x3f, 0x27, 0xe4, 0x22, 0x91, 0x31, 0xab, 0xbf, - 0xae, 0x03, 0x44, 0x88, 0xa2, 0x3e, 0xe6, 0x98, 0x2a, 0xf7, 0x17, 0x1d, 0x03, 0xb1, 0x4e, 0x60, - 0x11, 0x5f, 0x71, 0x8a, 0x5c, 0x1c, 0x0e, 0x64, 0xa7, 0x2d, 0xec, 0x7e, 0x3e, 0x23, 0x3a, 0xd3, - 0xda, 0x5a, 0x87, 0xe2, 0xda, 0x61, 0x38, 0x50, 0x39, 0x91, 0xc7, 0xfa, 0xb8, 0xf6, 0x3b, 0x28, - 0xa5, 0x48, 0x77, 0xca, 0x87, 0x73, 0xa8, 0xa5, 0x54, 0xe9, 0x38, 0x6e, 0x40, 0x01, 0x5f, 0xf9, - 0xdc, 0x65, 0x1c, 0xf1, 0x98, 0xe9, 0x00, 0x81, 0x80, 0x4e, 0x25, 0x22, 0xc7, 0x08, 0xf7, 0x48, - 0xcc, 0x47, 0x63, 0x44, 0x9e, 0x34, 0x8e, 0x69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x07, 0x9f, - 0x53, 0xcc, 0x7a, 0x22, 0xa5, 0x4c, 0x83, 0xd2, 0xb0, 0x66, 0x6f, 0xc0, 0xb2, 0x13, 0x87, 0xcf, - 0x31, 0x0a, 0x78, 0x4f, 0x0e, 0x8e, 0xe4, 0x42, 0x13, 0x56, 0x26, 0x09, 0xfa, 0xca, 0x17, 0xd0, - 0x7c, 0xd1, 0x0d, 0x09, 0xc5, 0x8a, 0x78, 0x48, 0x29, 0xa1, 0xa9, 0x96, 0xc2, 0x39, 0xa6, 0xe1, - 0xb8, 0x51, 0xc8, 0xa3, 0xfd, 0x10, 0x56, 0x67, 0xdc, 0xd2, 0x22, 0xbf, 0x16, 0x46, 0x8b, 0x7e, - 0x92, 0xce, 0xe4, 0x47, 0x50, 0xba, 0x44, 0x3e, 0x77, 0x23, 0xc2, 0xc6, 0xc9, 0xb4, 0xe8, 0x14, - 0x05, 0x78, 0xa2, 0x31, 0xe5, 0x99, 0x79, 0x57, 0xcb, 0xdc, 0x85, 0x95, 0x13, 0x8a, 0xcf, 0x03, - 0xbf, 0xdb, 0x9b, 0x28, 0x10, 0xb1, 0x93, 0xc9, 0xc0, 0x25, 0x15, 0x92, 0x1c, 0xed, 0x2e, 0x34, - 0xa6, 0xee, 0xe8, 0xbc, 0x3a, 0x86, 0xb2, 0xe2, 0x72, 0xa9, 0xdc, 0x2b, 0x92, 0x7e, 0xfe, 0xf1, - 0xb5, 0x99, 0x6d, 0x6e, 0x21, 0x4e, 0xa9, 0x63, 0x9c, 0x98, 0xfd, 0x9f, 0x0c, 0x58, 0x7b, 0x51, - 0x14, 0x0c, 0xd3, 0x96, 0x55, 0x20, 0xc7, 0xde, 0x06, 0x49, 0x8b, 0x61, 0x6f, 0x03, 0xd1, 0x62, - 0xce, 0x09, 0xed, 0x60, 0x5d, 0xac, 0xea, 0x20, 0xd6, 0x00, 0x14, 0x04, 0xe4, 0xd2, 0x35, 0x76, - 0x58, 0xd9, 0x19, 0xf2, 0x4e, 0x45, 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x59, 0x6e, 0x25, 0xff, 0x43, 0x39, 0x14, 0xa8, 0xa3, 0x88, 0x7a, 0x22, 0x72, 0x42, 0xf1, 0x11, - 0x25, 0xfd, 0x94, 0x5d, 0xf6, 0x1e, 0xac, 0xce, 0xa0, 0xdd, 0x45, 0xfc, 0xd3, 0x4f, 0x7f, 0x6a, - 0x0d, 0x7c, 0x8e, 0x19, 0x6b, 0xf9, 0x64, 0x47, 0xfd, 0xda, 0xe9, 0x92, 0x9d, 0x01, 0xdf, 0x91, - 0xff, 0xc9, 0xd9, 0x99, 0xfa, 0xf4, 0x6b, 0x2f, 0x48, 0xc2, 0xe7, 0xff, 0x0b, 0x00, 0x00, 0xff, - 0xff, 0x4b, 0xd6, 0x65, 0xc3, 0x53, 0x1a, 0x00, 0x00, + // 2067 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x59, 0xdd, 0x6e, 0x1b, 0xc7, + 0xf5, 0x07, 0x49, 0x49, 0xa6, 0x0e, 0x3f, 0x44, 0x2e, 0x29, 0x91, 0x92, 0xff, 0x91, 0xe4, 0xb5, + 0xf3, 0x8f, 0xea, 0xa2, 0x54, 0xa2, 0xa4, 0x41, 0x90, 0x22, 0x45, 0x65, 0x59, 0xb2, 0x9d, 0x28, + 0xb1, 0xb2, 0xb2, 0xec, 0x22, 0x28, 0xb0, 0x18, 0x72, 0x47, 0xe4, 0x42, 0xcb, 0x9d, 0xf5, 0xcc, + 0x2c, 0x25, 0xbe, 0x44, 0x9f, 0xa0, 0x77, 0x05, 0xda, 0xfb, 0x5e, 0xf6, 0x41, 0xd2, 0x47, 0xe9, + 0x45, 0x2f, 0x5a, 0xcc, 0xc7, 0x92, 0xb3, 0xe4, 0xca, 0x96, 0x04, 0x17, 0xe8, 0x8d, 0xc0, 0xf9, + 0x9d, 0xef, 0x33, 0xe7, 0x9c, 0x39, 0x0b, 0x41, 0x8b, 0xa3, 0x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 0x8f, 0x60, 0xe9, 0xdc, 0xc7, 0x81, 0xc7, 0xda, 0xc5, 0xed, 0xc2, 0x4e, 0x69, 0xaf, 0xdc, + 0x51, 0xf9, 0x3a, 0x12, 0xa0, 0xa3, 0x69, 0xf6, 0x5f, 0x72, 0x50, 0x3b, 0x95, 0xc1, 0x18, 0x29, + 0xf8, 0x04, 0x56, 0x84, 0x95, 0x2e, 0x62, 0xd8, 0xd5, 0x71, 0xab, 0x6c, 0x54, 0x13, 0x58, 0x89, + 0x58, 0x2f, 0x41, 0xdd, 0x8b, 0xeb, 0x4d, 0x84, 0x59, 0x3b, 0x2f, 0xcd, 0xd9, 0x9d, 0xf9, 0xab, + 0x9c, 0x49, 0xb5, 0x53, 0xe3, 0x69, 0x80, 0x89, 0x84, 0x8e, 0x30, 0x65, 0x3e, 0x09, 0xdb, 0x05, + 0x69, 0x31, 0x39, 0x0a, 0x47, 0x2d, 0x65, 0xf5, 0x60, 0x80, 0xc2, 0x3e, 0x76, 0x30, 0x8b, 0x03, + 0x6e, 0x3d, 0x87, 0x4a, 0x17, 0x9f, 0x13, 0x9a, 0x72, 0xb4, 0xb4, 0xf7, 0x30, 0xc3, 0xfa, 0x6c, + 0x98, 0x4e, 0x59, 0x49, 0xea, 0x58, 0x8e, 0xa0, 0x8c, 0xce, 0x39, 0xa6, 0xae, 0x71, 0xd3, 0x37, + 0x54, 0x54, 0x92, 0x82, 0x0a, 0xb6, 0xff, 0x99, 0x83, 0xea, 0x19, 0xc3, 0xf4, 0x04, 0xd3, 0xa1, + 0xcf, 0x98, 0x2e, 0xa9, 0x01, 0x61, 0x3c, 0x29, 0x29, 0xf1, 0x5b, 0x60, 0x31, 0xc3, 0x54, 0x17, + 0x94, 0xfc, 0x6d, 0xfd, 0x12, 0xea, 0x11, 0x62, 0xec, 0x92, 0x50, 0xcf, 0xed, 0x0d, 0x70, 0xef, + 0x82, 0xc5, 0x43, 0x99, 0x87, 0x05, 0xa7, 0x96, 0x10, 0x0e, 0x34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 0x4c, 0xe5, 0x50, 0x95, 0xac, 0x05, 0x67, 0x72, 0xb6, 0x57, 0xa0, 0xa2, 0x79, 0x95, 0x5a, + 0xfb, 0x1f, 0x39, 0xb0, 0x0e, 0xaf, 0x70, 0x2f, 0xe6, 0xf8, 0x39, 0x21, 0x17, 0x89, 0x8e, 0xac, + 0xf9, 0xba, 0x09, 0x10, 0x21, 0x8a, 0x86, 0x98, 0x63, 0xaa, 0xc2, 0x5f, 0x76, 0x0c, 0xc4, 0x3a, + 0x81, 0x65, 0x7c, 0xc5, 0x29, 0x72, 0x71, 0x38, 0x92, 0x93, 0xb6, 0xb4, 0xf7, 0x79, 0x46, 0x76, + 0xe6, 0xad, 0x75, 0x0e, 0x85, 0xd8, 0x61, 0x38, 0x52, 0x35, 0x51, 0xc4, 0xfa, 0xb8, 0xf1, 0x1b, + 0xa8, 0xa4, 0x48, 0xb7, 0xaa, 0x87, 0x73, 0x68, 0xa4, 0x4c, 0xe9, 0x3c, 0x6e, 0x41, 0x09, 0x5f, + 0xf9, 0xdc, 0x65, 0x1c, 0xf1, 0x98, 0xe9, 0x04, 0x81, 0x80, 0x4e, 0x25, 0x22, 0x9f, 0x11, 0xee, + 0x91, 0x98, 0x4f, 0x9e, 0x11, 0x79, 0xd2, 0x38, 0xa6, 0x49, 0x17, 0xe8, 0x93, 0x3d, 0x82, 0xda, + 0x33, 0xcc, 0xd5, 0x5c, 0x49, 0xd2, 0xb7, 0x06, 0x4b, 0x32, 0x70, 0x55, 0x71, 0xcb, 0x8e, 0x3e, + 0x59, 0x0f, 0xa1, 0xe2, 0x87, 0xbd, 0x20, 0xf6, 0xb0, 0x3b, 0xf2, 0xf1, 0x25, 0x93, 0x26, 0x8a, + 0x4e, 0x59, 0x83, 0xaf, 0x05, 0x66, 0x7d, 0x0c, 0x55, 0x7c, 0xa5, 0x98, 0xb4, 0x12, 0xf5, 0x6c, + 0x55, 0x34, 0x2a, 0x07, 0x34, 0xb3, 0x31, 0xd4, 0x0d, 0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 0x82, 0x55, + 0x2d, 0xa3, 0xbd, 0x34, 0x76, 0x92, 0x59, 0xc2, 0x0d, 0xd4, 0x9d, 0x42, 0xe5, 0x09, 0xea, 0x5d, + 0xc4, 0x93, 0xaa, 0xdf, 0x86, 0x52, 0x8f, 0x84, 0xbd, 0x98, 0x52, 0x1c, 0xf6, 0xc6, 0x7a, 0x46, + 0x9a, 0x90, 0xe0, 0x90, 0x1f, 0x64, 0xea, 0x26, 0xf5, 0x57, 0x9c, 0x09, 0xd9, 0x5f, 0x42, 0x35, + 0x51, 0xaa, 0x5d, 0x78, 0x04, 0x8b, 0x78, 0x34, 0xbd, 0xc9, 0x6a, 0x27, 0xf9, 0x97, 0xc4, 0xa1, + 0x40, 0x1d, 0x45, 0xd4, 0x2f, 0x22, 0x27, 0x14, 0x1f, 0x51, 0x32, 0x4c, 0xf9, 0x65, 0xef, 0xc3, + 0x7a, 0x06, 0xed, 0x36, 0xea, 0x9f, 0x7c, 0xfa, 0x53, 0x67, 0xe4, 0x73, 0xcc, 0x58, 0xc7, 0x27, + 0xbb, 0xea, 0xd7, 0x6e, 0x9f, 0xec, 0x8e, 0xf8, 0xae, 0xfc, 0xc7, 0xc8, 0xee, 0xdc, 0x97, 0x54, + 0x77, 0x49, 0x12, 0x3e, 0xff, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb4, 0xb5, 0x81, 0x15, 0xa2, + 0x19, 0x00, 0x00, } diff --git a/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go b/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go index 44bf80b1a70..e5fca39d81f 100644 --- a/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go +++ b/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go @@ -29,73 +29,70 @@ const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("tabletmanagerservice.proto", fileDescriptor_9ee75fe63cfd9360) } var fileDescriptor_9ee75fe63cfd9360 = []byte{ - // 1055 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0x5b, 0x6f, 0x5b, 0x45, - 0x10, 0xc7, 0xb1, 0x04, 0x95, 0x58, 0xae, 0x5d, 0x55, 0x14, 0x05, 0x89, 0x5b, 0x2f, 0x40, 0x8a, - 0xe2, 0xa6, 0xa1, 0xbc, 0xbb, 0x69, 0xd2, 0x06, 0x35, 0xc2, 0xd8, 0x0d, 0x41, 0x20, 0x21, 0x6d, - 0xec, 0x89, 0x7d, 0xc8, 0xf1, 0xee, 0x61, 0x77, 0x8f, 0xd5, 0x3c, 0x21, 0x21, 0xf1, 0x84, 0xc4, - 0x13, 0x1f, 0xb8, 0x3a, 0x97, 0xdd, 0x33, 0x7b, 0x3c, 0x67, 0x6d, 0xbf, 0x45, 0xfe, 0xff, 0x66, - 0x66, 0x2f, 0x33, 0xb3, 0x93, 0xc3, 0x76, 0xac, 0xb8, 0x48, 0xc1, 0x2e, 0x84, 0x14, 0x33, 0xd0, - 0x06, 0xf4, 0x32, 0x99, 0xc0, 0x5e, 0xa6, 0x95, 0x55, 0xfc, 0x16, 0xa5, 0xed, 0xdc, 0x0e, 0x7e, - 0x9d, 0x0a, 0x2b, 0x2a, 0xfc, 0xd1, 0xff, 0xf7, 0xd9, 0x7b, 0x2f, 0x4b, 0xed, 0xb4, 0xd2, 0xf8, - 0x09, 0x7b, 0x73, 0x98, 0xc8, 0x19, 0xff, 0x74, 0x6f, 0xd5, 0xa6, 0x10, 0x46, 0xf0, 0x67, 0x0e, - 0xc6, 0xee, 0x7c, 0xd6, 0xa9, 0x9b, 0x4c, 0x49, 0x03, 0x5f, 0xbe, 0xc1, 0x5f, 0xb0, 0xb7, 0xc6, - 0x29, 0x40, 0xc6, 0x29, 0xb6, 0x54, 0x9c, 0xb3, 0xcf, 0xbb, 0x01, 0xef, 0xed, 0x77, 0xf6, 0xce, - 0xd1, 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, 0x46, 0x2e, 0x02, 0xf6, 0x11, - 0xff, 0xeb, 0xb1, 0x4f, 0x8a, 0x37, 0x19, 0x95, 0xfb, 0x40, 0x4e, 0x8b, 0xce, 0x5a, 0xcd, 0x60, - 0x8f, 0x3b, 0xde, 0xf0, 0x0e, 0xde, 0x2d, 0xe3, 0xfb, 0x6d, 0xcd, 0x70, 0x95, 0xe0, 0x1b, 0x27, - 0xab, 0x04, 0x03, 0xb1, 0x2a, 0x09, 0x39, 0x3c, 0x06, 0xd6, 0x4a, 0xbd, 0x1c, 0x72, 0x0c, 0x0c, - 0x91, 0xd8, 0x18, 0xd8, 0x26, 0x7d, 0xa0, 0x9f, 0xd8, 0x8d, 0x27, 0x62, 0x72, 0x95, 0x67, 0x9c, - 0xfa, 0xa4, 0x53, 0x49, 0xce, 0xf1, 0x17, 0x11, 0xc2, 0x39, 0x7c, 0xd8, 0xe3, 0x9a, 0xdd, 0x2c, - 0xae, 0x51, 0x69, 0x38, 0xd6, 0x6a, 0x51, 0x7b, 0xef, 0x68, 0xe2, 0x21, 0x15, 0xcb, 0x10, 0x02, - 0x6e, 0x62, 0x3e, 0x39, 0xf8, 0x75, 0x7f, 0x99, 0x58, 0x30, 0x66, 0x2f, 0x51, 0xfd, 0xea, 0xaf, - 0xfe, 0x4c, 0xf5, 0x97, 0xb6, 0x5f, 0x7e, 0x36, 0xeb, 0x53, 0x1f, 0xd9, 0x2e, 0x6e, 0x94, 0xda, - 0xc1, 0xeb, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd0, 0x9a, 0xbc, 0x94, 0x9f, 0x13, 0x00, 0x00, + // 1002 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x98, 0xdf, 0x6f, 0x1c, 0x35, + 0x10, 0xc7, 0x89, 0x04, 0x95, 0x30, 0x3f, 0x6b, 0x55, 0x14, 0x05, 0x89, 0x5f, 0x4d, 0xf9, 0x91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 0xab, 0x63, 0x54, 0x06, 0x8e, 0x8d, + 0x5a, 0x34, 0xde, 0x7b, 0x86, 0x78, 0x4c, 0xa5, 0x2a, 0x84, 0x80, 0xdb, 0x98, 0x4f, 0x0e, 0x7f, + 0x79, 0xb4, 0xcc, 0x1d, 0x58, 0x7b, 0x90, 0xab, 0xc1, 0xea, 0xaf, 0xc1, 0x5c, 0x0d, 0x96, 0x6e, + 0x50, 0x7f, 0x23, 0x1a, 0x50, 0x5f, 0x94, 0x2e, 0x6e, 0xd5, 0xda, 0xe1, 0xff, 0x01, 0x00, 0x00, + 0xff, 0xff, 0xd4, 0x4a, 0x50, 0x02, 0x8c, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -151,32 +148,6 @@ type TabletManagerClient interface { // StartSlave starts the mysql replication until and including // the provided position StartSlaveUntilAfter(ctx context.Context, in *tabletmanagerdata.StartSlaveUntilAfterRequest, opts ...grpc.CallOption) (*tabletmanagerdata.StartSlaveUntilAfterResponse, error) - // TabletExternallyReparented tells a tablet that its underlying MySQL is - // currently the master. It is only used in environments (tabletmanagerdata.such as Vitess+MoB) - // in which MySQL is reparented by some agent external to Vitess, and then - // that agent simply notifies Vitess. - // - // This call is idempotent with respect to a single target tablet. - // However, the tablet assumes there is a cooling-off period following the - // initial external reparent from A to B, before this call is repeated on any - // tablet other than B. This assumption is configurable with the vttablet flag - // "finalize_external_reparent_timeout". - // - // For more information, see the design doc at go/vt-fast-failover. - TabletExternallyReparented(ctx context.Context, in *tabletmanagerdata.TabletExternallyReparentedRequest, opts ...grpc.CallOption) (*tabletmanagerdata.TabletExternallyReparentedResponse, error) - // TabletExternallyElected is an notification that may be sent in - // anticipation of potentially later sending TabletExternallyReparented. - // The tablet can use this extra lead time to prepare to react quickly if - // TabletExternallyReparented does follow. - // - // This call is effectively a no-op if it is not followed by a call to - // TabletExternallyReparented, so the external agent doing the reparent can - // still change its mind. - // - // The agent does not need to wait for this call or cancel it before calling - // TabletExternallyReparented if the external reparent operation finishes - // before TabletExternallyElected returns. - TabletExternallyElected(ctx context.Context, in *tabletmanagerdata.TabletExternallyElectedRequest, opts ...grpc.CallOption) (*tabletmanagerdata.TabletExternallyElectedResponse, error) // GetSlaves asks for the list of mysql slaves GetSlaves(ctx context.Context, in *tabletmanagerdata.GetSlavesRequest, opts ...grpc.CallOption) (*tabletmanagerdata.GetSlavesResponse, error) // VReplication API @@ -460,24 +431,6 @@ func (c *tabletManagerClient) StartSlaveUntilAfter(ctx context.Context, in *tabl return out, nil } -func (c *tabletManagerClient) TabletExternallyReparented(ctx context.Context, in *tabletmanagerdata.TabletExternallyReparentedRequest, opts ...grpc.CallOption) (*tabletmanagerdata.TabletExternallyReparentedResponse, error) { - out := new(tabletmanagerdata.TabletExternallyReparentedResponse) - err := c.cc.Invoke(ctx, "/tabletmanagerservice.TabletManager/TabletExternallyReparented", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *tabletManagerClient) TabletExternallyElected(ctx context.Context, in *tabletmanagerdata.TabletExternallyElectedRequest, opts ...grpc.CallOption) (*tabletmanagerdata.TabletExternallyElectedResponse, error) { - out := new(tabletmanagerdata.TabletExternallyElectedResponse) - err := c.cc.Invoke(ctx, "/tabletmanagerservice.TabletManager/TabletExternallyElected", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *tabletManagerClient) GetSlaves(ctx context.Context, in *tabletmanagerdata.GetSlavesRequest, opts ...grpc.CallOption) (*tabletmanagerdata.GetSlavesResponse, error) { out := new(tabletmanagerdata.GetSlavesResponse) err := c.cc.Invoke(ctx, "/tabletmanagerservice.TabletManager/GetSlaves", in, out, opts...) @@ -729,32 +682,6 @@ type TabletManagerServer interface { // StartSlave starts the mysql replication until and including // the provided position StartSlaveUntilAfter(context.Context, *tabletmanagerdata.StartSlaveUntilAfterRequest) (*tabletmanagerdata.StartSlaveUntilAfterResponse, error) - // TabletExternallyReparented tells a tablet that its underlying MySQL is - // currently the master. It is only used in environments (tabletmanagerdata.such as Vitess+MoB) - // in which MySQL is reparented by some agent external to Vitess, and then - // that agent simply notifies Vitess. - // - // This call is idempotent with respect to a single target tablet. - // However, the tablet assumes there is a cooling-off period following the - // initial external reparent from A to B, before this call is repeated on any - // tablet other than B. This assumption is configurable with the vttablet flag - // "finalize_external_reparent_timeout". - // - // For more information, see the design doc at go/vt-fast-failover. - TabletExternallyReparented(context.Context, *tabletmanagerdata.TabletExternallyReparentedRequest) (*tabletmanagerdata.TabletExternallyReparentedResponse, error) - // TabletExternallyElected is an notification that may be sent in - // anticipation of potentially later sending TabletExternallyReparented. - // The tablet can use this extra lead time to prepare to react quickly if - // TabletExternallyReparented does follow. - // - // This call is effectively a no-op if it is not followed by a call to - // TabletExternallyReparented, so the external agent doing the reparent can - // still change its mind. - // - // The agent does not need to wait for this call or cancel it before calling - // TabletExternallyReparented if the external reparent operation finishes - // before TabletExternallyElected returns. - TabletExternallyElected(context.Context, *tabletmanagerdata.TabletExternallyElectedRequest) (*tabletmanagerdata.TabletExternallyElectedResponse, error) // GetSlaves asks for the list of mysql slaves GetSlaves(context.Context, *tabletmanagerdata.GetSlavesRequest) (*tabletmanagerdata.GetSlavesResponse, error) // VReplication API @@ -878,12 +805,6 @@ func (*UnimplementedTabletManagerServer) StartSlave(ctx context.Context, req *ta func (*UnimplementedTabletManagerServer) StartSlaveUntilAfter(ctx context.Context, req *tabletmanagerdata.StartSlaveUntilAfterRequest) (*tabletmanagerdata.StartSlaveUntilAfterResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StartSlaveUntilAfter not implemented") } -func (*UnimplementedTabletManagerServer) TabletExternallyReparented(ctx context.Context, req *tabletmanagerdata.TabletExternallyReparentedRequest) (*tabletmanagerdata.TabletExternallyReparentedResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TabletExternallyReparented not implemented") -} -func (*UnimplementedTabletManagerServer) TabletExternallyElected(ctx context.Context, req *tabletmanagerdata.TabletExternallyElectedRequest) (*tabletmanagerdata.TabletExternallyElectedResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TabletExternallyElected not implemented") -} func (*UnimplementedTabletManagerServer) GetSlaves(ctx context.Context, req *tabletmanagerdata.GetSlavesRequest) (*tabletmanagerdata.GetSlavesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetSlaves not implemented") } @@ -1411,42 +1332,6 @@ func _TabletManager_StartSlaveUntilAfter_Handler(srv interface{}, ctx context.Co return interceptor(ctx, in, info, handler) } -func _TabletManager_TabletExternallyReparented_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(tabletmanagerdata.TabletExternallyReparentedRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TabletManagerServer).TabletExternallyReparented(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/tabletmanagerservice.TabletManager/TabletExternallyReparented", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TabletManagerServer).TabletExternallyReparented(ctx, req.(*tabletmanagerdata.TabletExternallyReparentedRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _TabletManager_TabletExternallyElected_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(tabletmanagerdata.TabletExternallyElectedRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(TabletManagerServer).TabletExternallyElected(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/tabletmanagerservice.TabletManager/TabletExternallyElected", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(TabletManagerServer).TabletExternallyElected(ctx, req.(*tabletmanagerdata.TabletExternallyElectedRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _TabletManager_GetSlaves_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(tabletmanagerdata.GetSlavesRequest) if err := dec(in); err != nil { @@ -1885,14 +1770,6 @@ var _TabletManager_serviceDesc = grpc.ServiceDesc{ MethodName: "StartSlaveUntilAfter", Handler: _TabletManager_StartSlaveUntilAfter_Handler, }, - { - MethodName: "TabletExternallyReparented", - Handler: _TabletManager_TabletExternallyReparented_Handler, - }, - { - MethodName: "TabletExternallyElected", - Handler: _TabletManager_TabletExternallyElected_Handler, - }, { MethodName: "GetSlaves", Handler: _TabletManager_GetSlaves_Handler, diff --git a/go/vt/vtcombo/tablet_map.go b/go/vt/vtcombo/tablet_map.go index e54a2058174..0593a51fc9b 100644 --- a/go/vt/vtcombo/tablet_map.go +++ b/go/vt/vtcombo/tablet_map.go @@ -625,10 +625,6 @@ func (itmc *internalTabletManagerClient) StartSlaveUntilAfter(ctx context.Contex return fmt.Errorf("not implemented in vtcombo") } -func (itmc *internalTabletManagerClient) TabletExternallyReparented(ctx context.Context, tablet *topodatapb.Tablet, externalID string) error { - return fmt.Errorf("not implemented in vtcombo") -} - func (itmc *internalTabletManagerClient) GetSlaves(ctx context.Context, tablet *topodatapb.Tablet) ([]string, error) { return nil, fmt.Errorf("not implemented in vtcombo") } diff --git a/go/vt/vttablet/agentrpctest/test_agent_rpc.go b/go/vt/vttablet/agentrpctest/test_agent_rpc.go index 388260f6f90..f294eac1cd4 100644 --- a/go/vt/vttablet/agentrpctest/test_agent_rpc.go +++ b/go/vt/vttablet/agentrpctest/test_agent_rpc.go @@ -818,26 +818,6 @@ func agentRPCTestStartSlavePanic(ctx context.Context, t *testing.T, client tmcli expectHandleRPCPanic(t, "StartSlave", true /*verbose*/, err) } -var testTabletExternallyReparentedCalled = false - -func (fra *fakeRPCAgent) TabletExternallyReparented(ctx context.Context, externalID string) error { - if fra.panics { - panic(fmt.Errorf("test-triggered panic")) - } - testTabletExternallyReparentedCalled = true - return nil -} - -func agentRPCTestTabletExternallyReparented(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) { - err := client.TabletExternallyReparented(ctx, tablet, "") - compareError(t, "TabletExternallyReparented", err, true, testTabletExternallyReparentedCalled) -} - -func agentRPCTestTabletExternallyReparentedPanic(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) { - err := client.TabletExternallyReparented(ctx, tablet, "") - expectHandleRPCPanic(t, "TabletExternallyReparented", false /*verbose*/, err) -} - var testGetSlavesResult = []string{"slave1", "slave2"} func (fra *fakeRPCAgent) GetSlaves(ctx context.Context) ([]string, error) { @@ -1295,7 +1275,6 @@ func Run(t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.T agentRPCTestStopSlaveMinimum(ctx, t, client, tablet) agentRPCTestStartSlave(ctx, t, client, tablet) agentRPCTestStartSlaveUntilAfter(ctx, t, client, tablet) - agentRPCTestTabletExternallyReparented(ctx, t, client, tablet) agentRPCTestGetSlaves(ctx, t, client, tablet) // VReplication methods @@ -1350,7 +1329,6 @@ func Run(t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.T agentRPCTestStopSlavePanic(ctx, t, client, tablet) agentRPCTestStopSlaveMinimumPanic(ctx, t, client, tablet) agentRPCTestStartSlavePanic(ctx, t, client, tablet) - agentRPCTestTabletExternallyReparentedPanic(ctx, t, client, tablet) agentRPCTestGetSlavesPanic(ctx, t, client, tablet) // VReplication methods diff --git a/go/vt/vttablet/faketmclient/fake_client.go b/go/vt/vttablet/faketmclient/fake_client.go index cc56fc26d92..bd0a8e51bf2 100644 --- a/go/vt/vttablet/faketmclient/fake_client.go +++ b/go/vt/vttablet/faketmclient/fake_client.go @@ -206,11 +206,6 @@ func (client *FakeTabletManagerClient) StartSlaveUntilAfter(ctx context.Context, return nil } -// TabletExternallyReparented is part of the tmclient.TabletManagerClient interface. -func (client *FakeTabletManagerClient) TabletExternallyReparented(ctx context.Context, tablet *topodatapb.Tablet, externalID string) error { - return nil -} - // GetSlaves is part of the tmclient.TabletManagerClient interface. func (client *FakeTabletManagerClient) GetSlaves(ctx context.Context, tablet *topodatapb.Tablet) ([]string, error) { return nil, nil diff --git a/go/vt/vttablet/grpctmclient/client.go b/go/vt/vttablet/grpctmclient/client.go index d95996a8ece..441ed22de2c 100644 --- a/go/vt/vttablet/grpctmclient/client.go +++ b/go/vt/vttablet/grpctmclient/client.go @@ -546,19 +546,6 @@ func (client *Client) StartSlaveUntilAfter(ctx context.Context, tablet *topodata return err } -// TabletExternallyReparented is part of the tmclient.TabletManagerClient interface. -func (client *Client) TabletExternallyReparented(ctx context.Context, tablet *topodatapb.Tablet, externalID string) error { - cc, c, err := client.dial(tablet) - if err != nil { - return err - } - defer cc.Close() - _, err = c.TabletExternallyReparented(ctx, &tabletmanagerdatapb.TabletExternallyReparentedRequest{ - ExternalId: externalID, - }) - return err -} - // GetSlaves is part of the tmclient.TabletManagerClient interface. func (client *Client) GetSlaves(ctx context.Context, tablet *topodatapb.Tablet) ([]string, error) { cc, c, err := client.dial(tablet) diff --git a/go/vt/vttablet/grpctmserver/server.go b/go/vt/vttablet/grpctmserver/server.go index d3dc8cbe04d..71f6a7b9de9 100644 --- a/go/vt/vttablet/grpctmserver/server.go +++ b/go/vt/vttablet/grpctmserver/server.go @@ -295,17 +295,6 @@ func (s *server) StartSlaveUntilAfter(ctx context.Context, request *tabletmanage return response, s.agent.StartSlaveUntilAfter(ctx, request.Position, time.Duration(request.WaitTimeout)) } -func (s *server) TabletExternallyReparented(ctx context.Context, request *tabletmanagerdatapb.TabletExternallyReparentedRequest) (response *tabletmanagerdatapb.TabletExternallyReparentedResponse, err error) { - defer s.agent.HandleRPCPanic(ctx, "TabletExternallyReparented", request, response, false /*verbose*/, &err) - ctx = callinfo.GRPCCallInfo(ctx) - response = &tabletmanagerdatapb.TabletExternallyReparentedResponse{} - return response, s.agent.TabletExternallyReparented(ctx, request.ExternalId) -} - -func (s *server) TabletExternallyElected(ctx context.Context, request *tabletmanagerdatapb.TabletExternallyElectedRequest) (*tabletmanagerdatapb.TabletExternallyElectedResponse, error) { - return &tabletmanagerdatapb.TabletExternallyElectedResponse{}, nil -} - func (s *server) GetSlaves(ctx context.Context, request *tabletmanagerdatapb.GetSlavesRequest) (response *tabletmanagerdatapb.GetSlavesResponse, err error) { defer s.agent.HandleRPCPanic(ctx, "GetSlaves", request, response, false /*verbose*/, &err) ctx = callinfo.GRPCCallInfo(ctx) diff --git a/go/vt/vttablet/tabletmanager/action_agent.go b/go/vt/vttablet/tabletmanager/action_agent.go index 271d1bd28c0..95f391d6ab1 100644 --- a/go/vt/vttablet/tabletmanager/action_agent.go +++ b/go/vt/vttablet/tabletmanager/action_agent.go @@ -121,10 +121,6 @@ type ActionAgent struct { // any background tasks spawned by the agent. batchCtx context.Context - // finalizeReparentCtx represents the background finalize step of a - // TabletExternallyReparented call. - finalizeReparentCtx context.Context - // History of the health checks, public so status // pages can display it History *history.History diff --git a/go/vt/vttablet/tabletmanager/rpc_agent.go b/go/vt/vttablet/tabletmanager/rpc_agent.go index 410f96823d4..96b7b2a30e7 100644 --- a/go/vt/vttablet/tabletmanager/rpc_agent.go +++ b/go/vt/vttablet/tabletmanager/rpc_agent.go @@ -92,8 +92,6 @@ type RPCAgent interface { StartSlaveUntilAfter(ctx context.Context, position string, waitTime time.Duration) error - TabletExternallyReparented(ctx context.Context, externalID string) error - GetSlaves(ctx context.Context) ([]string, error) // VReplication API diff --git a/go/vt/vttablet/tabletmanager/rpc_external_reparent.go b/go/vt/vttablet/tabletmanager/rpc_external_reparent.go deleted file mode 100644 index 2acecaa9f30..00000000000 --- a/go/vt/vttablet/tabletmanager/rpc_external_reparent.go +++ /dev/null @@ -1,271 +0,0 @@ -/* -Copyright 2019 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 tabletmanager - -import ( - "flag" - "sync" - "time" - - "github.com/golang/protobuf/proto" - "golang.org/x/net/context" - "vitess.io/vitess/go/event" - "vitess.io/vitess/go/stats" - "vitess.io/vitess/go/trace" - "vitess.io/vitess/go/vt/concurrency" - "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" - "vitess.io/vitess/go/vt/topotools" - "vitess.io/vitess/go/vt/topotools/events" - "vitess.io/vitess/go/vt/vttablet/tmclient" - - topodatapb "vitess.io/vitess/go/vt/proto/topodata" -) - -var ( - finalizeReparentTimeout = flag.Duration("finalize_external_reparent_timeout", 30*time.Second, "Timeout for the finalize stage of a fast external reparent reconciliation.") - - externalReparentStats = stats.NewTimings("ExternalReparents", "External reparenting time", "stage", "NewMasterVisible", "FullRebuild") -) - -// SetReparentFlags changes flag values. It should only be used in tests. -func SetReparentFlags(timeout time.Duration) { - *finalizeReparentTimeout = timeout -} - -// TabletExternallyReparented updates all topo records so the current -// tablet is the new master for this shard. -func (agent *ActionAgent) TabletExternallyReparented(ctx context.Context, externalID string) error { - if err := agent.lock(ctx); err != nil { - return err - } - defer agent.unlock() - - startTime := time.Now() - - // If there is a finalize step running, wait for it to finish or time out - // before checking the global shard record again. - if agent.finalizeReparentCtx != nil { - select { - case <-agent.finalizeReparentCtx.Done(): - agent.finalizeReparentCtx = nil - case <-ctx.Done(): - return ctx.Err() - } - } - - tablet := agent.Tablet() - - // Check the global shard record. - si, err := agent.TopoServer.GetShard(ctx, tablet.Keyspace, tablet.Shard) - if err != nil { - log.Warningf("fastTabletExternallyReparented: failed to read global shard record for %v/%v: %v", tablet.Keyspace, tablet.Shard, err) - return err - } - - // The external failover tool told us that we are still the MASTER. - // Update the timestamp to the current time (start a new term). - agent.setMasterTermStartTime(startTime) - - // Create a reusable Reparent event with available info. - ev := &events.Reparent{ - ShardInfo: *si, - NewMaster: *tablet, - OldMaster: topodatapb.Tablet{ - Alias: si.MasterAlias, - Type: topodatapb.TabletType_MASTER, - }, - ExternalID: externalID, - } - defer func() { - if err != nil { - event.DispatchUpdate(ev, "failed: "+err.Error()) - } - }() - event.DispatchUpdate(ev, "starting external from tablet (fast)") - - // We may get called on the current master multiple times in order to fix incomplete external reparents. - // We update the tablet here only if it is not currently master - if tablet.Type != topodatapb.TabletType_MASTER { - log.Infof("fastTabletExternallyReparented: executing change callback for state change to MASTER") - // Execute state change to master by force-updating only the local copy of the - // tablet record. The actual record in topo will be updated later. - newTablet := proto.Clone(tablet).(*topodatapb.Tablet) - newTablet.Type = topodatapb.TabletType_MASTER - newTablet.MasterTermStartTime = logutil.TimeToProto(agent.masterTermStartTime()) - // This is where updateState will block for gracePeriod, while it gives - // vtgate a chance to stop sending replica queries. - agent.updateState(ctx, newTablet, "fastTabletExternallyReparented") - } - // Start the finalize stage with a background context, but connect the trace. - bgCtx, cancel := context.WithTimeout(agent.batchCtx, *finalizeReparentTimeout) - bgCtx = trace.CopySpan(bgCtx, ctx) - agent.finalizeReparentCtx = bgCtx - go func() { - err := agent.finalizeTabletExternallyReparented(bgCtx, si, ev) - cancel() - - if err != nil { - log.Warningf("finalizeTabletExternallyReparented error: %v", err) - event.DispatchUpdate(ev, "failed: "+err.Error()) - return - } - externalReparentStats.Record("FullRebuild", startTime) - }() - - return nil -} - -// finalizeTabletExternallyReparented performs slow, synchronized reconciliation -// tasks that ensure topology is self-consistent. -// It first updates new and old master tablet records, then updates -// the global shard record, then refreshes the old master. -// After that it attempts to detect and clean up any lingering old masters. -// Note that an up-to-date shard record does not necessarily mean that -// the reparent completed all the actions successfully -func (agent *ActionAgent) finalizeTabletExternallyReparented(ctx context.Context, si *topo.ShardInfo, ev *events.Reparent) (err error) { - var wg sync.WaitGroup - var errs concurrency.AllErrorRecorder - var oldMasterTablet *topodatapb.Tablet - oldMasterAlias := si.MasterAlias - - // Update the new and old master tablet records concurrently. - event.DispatchUpdate(ev, "updating old and new master tablet records") - log.Infof("finalizeTabletExternallyReparented: updating tablet records") - wg.Add(1) - go func() { - defer wg.Done() - log.Infof("finalizeTabletExternallyReparented: updating tablet record for new master: %v", agent.TabletAlias) - // Update our own record to master if needed - // The internal state of agent has already been updated. No need to call RefreshState for this change. - _, err := topotools.ChangeType(ctx, agent.TopoServer, agent.TabletAlias, topodatapb.TabletType_MASTER, logutil.TimeToProto(agent.masterTermStartTime())) - if err != nil { - errs.RecordError(err) - } - }() - - tmc := tmclient.NewTabletManagerClient() - defer tmc.Close() - // If TER is called twice, then oldMasterAlias is the same as agent.TabletAlias - if !topoproto.TabletAliasIsZero(oldMasterAlias) && !topoproto.TabletAliasEqual(oldMasterAlias, agent.TabletAlias) { - wg.Add(1) - go func() { - defer wg.Done() - log.Infof("finalizeTabletExternallyReparented: updating tablet record for old master: %v", oldMasterAlias) - - // Forcibly demote the old master in topology, since we can't rely on the - // old master to be up to change its own record. - // Call UpdateTabletFields instead of ChangeType so that we can check the type - // before changing it and avoid unnecessary topo updates - oldti, err := agent.TopoServer.GetTablet(ctx, oldMasterAlias) - if err != nil { - errs.RecordError(err) - return - } - oldMasterTablet = oldti.Tablet - if err := tmc.ChangeType(ctx, oldMasterTablet, topodatapb.TabletType_REPLICA); err != nil { - log.Warningf("Error demoting old master: %v", err) - } - - // We now know more about the old master, so add it to event data. - // oldMasterTablet will be nil if no update was needed - if oldMasterTablet != nil { - ev.OldMaster = *oldMasterTablet - } - }() - } - // Wait for the tablet records to be updated. At that point, any rebuild will - // see the new master, so we're ready to mark the reparent as done in the - // global shard record. - wg.Wait() - if errs.HasErrors() { - return errs.Error() - } - - masterTablet := agent.Tablet() - - event.DispatchUpdate(ev, "updating global shard record") - log.Infof("finalizeTabletExternallyReparented: updating global shard record if needed") - wg.Add(1) - go func() { - defer wg.Done() - // Update the master field in the global shard record. We don't use a lock - // here anymore. The lock was only to ensure that the global shard record - // didn't get modified between the time when we read it and the time when we - // write it back. Now we use an update loop pattern to do that instead. - _, err = agent.TopoServer.UpdateShardFields(ctx, masterTablet.Keyspace, masterTablet.Shard, func(currentSi *topo.ShardInfo) error { - if topoproto.TabletAliasEqual(currentSi.MasterAlias, masterTablet.Alias) { - // returning NoUpdateNeeded avoids unnecessary calls to UpdateTablet - return topo.NewError(topo.NoUpdateNeeded, masterTablet.Alias.String()) - } - if !topoproto.TabletAliasEqual(currentSi.MasterAlias, oldMasterAlias) { - log.Warningf("old master alias (%v) not found in the global Shard record i.e. it has changed in the meantime."+ - " We're not overwriting the value with the new master (%v) because the current value is probably newer."+ - " (initial Shard record = %#v, current Shard record = %#v)", - oldMasterAlias, masterTablet.Alias, si, currentSi) - // returning NoUpdateNeeded avoids unnecessary calls to UpdateTablet - return topo.NewError(topo.NoUpdateNeeded, oldMasterAlias.String()) - } - currentSi.MasterAlias = masterTablet.Alias - return nil - }) - if err != nil { - errs.RecordError(err) - } - }() - - wg.Wait() - if errs.HasErrors() { - return errs.Error() - } - - // Look for any other tablets claiming to be master and fix them up on a best-effort basis - tabletMap, err := agent.TopoServer.GetTabletMapForShard(ctx, masterTablet.Keyspace, masterTablet.Shard) - if err != nil { - log.Errorf("ignoring error %v from GetTabletMapForShard so that we can process any partial results", err) - } - - for _, tabletInfo := range tabletMap { - alias := tabletInfo.Tablet.Alias - if !topoproto.TabletAliasEqual(alias, agent.TabletAlias) && !topoproto.TabletAliasEqual(alias, oldMasterAlias) && tabletInfo.Tablet.Type == topodatapb.TabletType_MASTER { - log.Infof("finalizeTabletExternallyReparented: updating tablet record for another old master: %v", alias) - wg.Add(1) - go func(alias *topodatapb.TabletAlias) { - defer wg.Done() - var err error - tablet, err := agent.TopoServer.GetTablet(ctx, alias) - if err != nil { - errs.RecordError(err) - return - } - log.Infof("finalizeTabletExternallyReparented: Refresh state for tablet: %v", topoproto.TabletAliasString(tablet.Alias)) - if err := tmc.ChangeType(ctx, tablet.Tablet, topodatapb.TabletType_REPLICA); err != nil { - log.Warningf("Error calling ChangeType on old master %v: %v", topoproto.TabletAliasString(tablet.Alias), err) - } - }(alias) - } - } - wg.Wait() - if errs.HasErrors() { - return errs.Error() - } - - event.DispatchUpdate(ev, "finished") - return nil -} diff --git a/go/vt/vttablet/tabletmanager/rpc_external_reparent_test.go b/go/vt/vttablet/tabletmanager/rpc_external_reparent_test.go deleted file mode 100644 index 1d50454108b..00000000000 --- a/go/vt/vttablet/tabletmanager/rpc_external_reparent_test.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2019 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 tabletmanager - -import ( - "context" - "testing" -) - -func TestTabletExternallyReparentedAlwaysUpdatesTimestamp(t *testing.T) { - ctx := context.Background() - agent := createTestAgent(ctx, t, nil) - - // Initial call sets the timestamp. - if err := agent.TabletExternallyReparented(ctx, "unused_id"); err != nil { - t.Fatal(err) - } - if agent._masterTermStartTime.IsZero() { - t.Fatalf("master_term_start_time should have been updated") - } - - // Run RPC again and verify that the timestamp was updated. - ter1 := agent._masterTermStartTime - if err := agent.TabletExternallyReparented(ctx, "unused_id"); err != nil { - t.Fatal(err) - } - ter2 := agent._masterTermStartTime - if ter1 == ter2 { - t.Fatalf("subsequent TER call did not update the master_term_start_time: %v = %v", ter1, ter2) - } -} diff --git a/go/vt/vttablet/tmclient/rpc_client_api.go b/go/vt/vttablet/tmclient/rpc_client_api.go index 7029cda982e..1aa1723ee11 100644 --- a/go/vt/vttablet/tmclient/rpc_client_api.go +++ b/go/vt/vttablet/tmclient/rpc_client_api.go @@ -132,14 +132,6 @@ type TabletManagerClient interface { // StartSlaveUntilAfter starts replication until after the position specified StartSlaveUntilAfter(ctx context.Context, tablet *topodatapb.Tablet, position string, duration time.Duration) error - // TabletExternallyReparented tells a tablet it is now the master, after an - // external tool has already promoted the underlying mysqld to master and - // reparented the other mysqld servers to it. - // - // externalID is an optional string provided by the external tool that - // vttablet will emit in logs to facilitate cross-referencing. - TabletExternallyReparented(ctx context.Context, tablet *topodatapb.Tablet, externalID string) error - // GetSlaves returns the addresses of the slaves GetSlaves(ctx context.Context, tablet *topodatapb.Tablet) ([]string, error) diff --git a/go/vt/worker/legacy_split_clone_test.go b/go/vt/worker/legacy_split_clone_test.go index 3abe00d19b8..4be808ac07d 100644 --- a/go/vt/worker/legacy_split_clone_test.go +++ b/go/vt/worker/legacy_split_clone_test.go @@ -36,7 +36,6 @@ import ( "vitess.io/vitess/go/vt/topo/memorytopo" "vitess.io/vitess/go/vt/vttablet/grpcqueryservice" "vitess.io/vitess/go/vt/vttablet/queryservice/fakes" - "vitess.io/vitess/go/vt/vttablet/tmclient" "vitess.io/vitess/go/vt/wrangler/testlib" querypb "vitess.io/vitess/go/vt/proto/query" @@ -371,66 +370,6 @@ func TestLegacySplitCloneV2_RetryDueToReadonly(t *testing.T) { } } -// TestLegacySplitCloneV2_RetryDueToReparent tests that vtworker correctly failovers -// during a reparent. -// NOTE: worker.py is an end-to-end test which tests this as well. -func TestLegacySplitCloneV2_RetryDueToReparent(t *testing.T) { - tc := &legacySplitCloneTestCase{t: t} - tc.setUp(false /* v3 */) - defer tc.tearDown() - - // Provoke a reparent just before the copy finishes. - // leftReplica will take over for the last, 30th, insert and the vreplication checkpoint. - tc.leftReplicaFakeDb.AddExpectedQuery("INSERT INTO `vt_ks`.`table1` (`id`, `msg`, `keyspace_id`) VALUES (*", nil) - - // Do not let leftMaster succeed the 30th write. - tc.leftMasterFakeDb.DeleteAllEntriesAfterIndex(28) - tc.leftMasterFakeDb.AddExpectedQuery("INSERT INTO `vt_ks`.`table1` (`id`, `msg`, `keyspace_id`) VALUES (*", errReadOnly) - tc.leftMasterFakeDb.EnableInfinite() - // When vtworker encounters the readonly error on leftMaster, do the reparent. - tc.leftMasterFakeDb.GetEntry(29).AfterFunc = func() { - // Reparent from leftMaster to leftReplica. - // NOTE: This step is actually not necessary due to our fakes which bypass - // a lot of logic. Let's keep it for correctness though. - ti, err := tc.ts.GetTablet(context.Background(), tc.leftReplica.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet failed: %v", err) - } - tmc := tmclient.NewTabletManagerClient() - if err := tmc.TabletExternallyReparented(context.Background(), ti.Tablet, "wait id 1"); err != nil { - t.Fatalf("TabletExternallyReparented(replica) failed: %v", err) - } - - // Update targets in fake query service and send out a new health response. - tc.leftMasterQs.UpdateType(topodatapb.TabletType_REPLICA) - tc.leftMasterQs.AddDefaultHealthResponse() - tc.leftReplicaQs.UpdateType(topodatapb.TabletType_MASTER) - tc.leftReplicaQs.AddDefaultHealthResponse() - - // After this, vtworker will retry. The following situations can occur: - // 1. HealthCheck picked up leftReplica as new MASTER - // => retry will succeed. - // 2. HealthCheck picked up no changes (leftMaster remains MASTER) - // => retry will hit leftMaster which keeps responding with readonly err. - // 3. HealthCheck picked up leftMaster as REPLICA, but leftReplica is still - // a REPLICA. - // => vtworker has no MASTER to go to and will keep retrying. - } - - // Only wait 1 ms between retries, so that the test passes faster. - *executeFetchRetryTime = 1 * time.Millisecond - - // Run the vtworker command. - if err := runCommand(t, tc.wi, tc.wi.wr, tc.defaultWorkerArgs); err != nil { - t.Fatal(err) - } - - wantRetryCountMin := int64(1) - if got := statsRetryCount.Get(); got < wantRetryCountMin { - t.Errorf("Wrong statsRetryCounter: got %v, wanted >= %v", got, wantRetryCountMin) - } -} - // TestLegacySplitCloneV2_NoMasterAvailable tests that vtworker correctly retries // even in a period where no MASTER tablet is available according to the // HealthCheck instance. diff --git a/go/vt/worker/split_clone_flaky_test.go b/go/vt/worker/split_clone_flaky_test.go index 5c425e0889c..b0ccd38dc65 100644 --- a/go/vt/worker/split_clone_flaky_test.go +++ b/go/vt/worker/split_clone_flaky_test.go @@ -39,7 +39,6 @@ import ( "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/vttablet/grpcqueryservice" "vitess.io/vitess/go/vt/vttablet/queryservice/fakes" - "vitess.io/vitess/go/vt/vttablet/tmclient" "vitess.io/vitess/go/vt/wrangler/testlib" querypb "vitess.io/vitess/go/vt/proto/query" @@ -928,66 +927,6 @@ func TestSplitCloneV2_RetryDueToReadonly(t *testing.T) { } } -// TestSplitCloneV2_RetryDueToReparent tests that vtworker correctly failovers -// during a reparent. -// NOTE: worker.py is an end-to-end test which tests this as well. -func TestSplitCloneV2_RetryDueToReparent(t *testing.T) { - tc := &splitCloneTestCase{t: t} - tc.setUp(false /* v3 */) - defer tc.tearDown() - - // Only wait 1 ms between retries, so that the test passes faster. - *executeFetchRetryTime = 1 * time.Millisecond - - // Provoke a reparent just before the copy finishes. - // leftReplica will take over for the last, 30th, insert and the vreplication checkpoint. - tc.leftReplicaFakeDb.AddExpectedQuery("INSERT INTO `vt_ks`.`table1` (`id`, `msg`, `keyspace_id`) VALUES (*", nil) - - // Do not let leftMaster succeed the 30th write. - tc.leftMasterFakeDb.DeleteAllEntriesAfterIndex(28) - tc.leftMasterFakeDb.AddExpectedQuery("INSERT INTO `vt_ks`.`table1` (`id`, `msg`, `keyspace_id`) VALUES (*", errReadOnly) - tc.leftMasterFakeDb.EnableInfinite() - // When vtworker encounters the readonly error on leftMaster, do the reparent. - tc.leftMasterFakeDb.GetEntry(29).AfterFunc = func() { - // Reparent from leftMaster to leftReplica. - // NOTE: This step is actually not necessary due to our fakes which bypass - // a lot of logic. Let's keep it for correctness though. - ti, err := tc.ts.GetTablet(context.Background(), tc.leftReplica.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet failed: %v", err) - } - tmc := tmclient.NewTabletManagerClient() - if err := tmc.TabletExternallyReparented(context.Background(), ti.Tablet, "wait id 1"); err != nil { - t.Fatalf("TabletExternallyReparented(replica) failed: %v", err) - } - - // Update targets in fake query service and send out a new health response. - tc.leftMasterQs.UpdateType(topodatapb.TabletType_REPLICA) - tc.leftMasterQs.AddDefaultHealthResponse() - tc.leftReplicaQs.UpdateType(topodatapb.TabletType_MASTER) - tc.leftReplicaQs.AddDefaultHealthResponse() - - // After this, vtworker will retry. The following situations can occur: - // 1. HealthCheck picked up leftReplica as new MASTER - // => retry will succeed. - // 2. HealthCheck picked up no changes (leftMaster remains MASTER) - // => retry will hit leftMaster which keeps responding with readonly err. - // 3. HealthCheck picked up leftMaster as REPLICA, but leftReplica is still - // a REPLICA. - // => vtworker has no MASTER to go to and will keep retrying. - } - - // Run the vtworker command. - if err := runCommand(t, tc.wi, tc.wi.wr, tc.defaultWorkerArgs); err != nil { - t.Fatal(err) - } - - wantRetryCountMin := int64(1) - if got := statsRetryCount.Get(); got < wantRetryCountMin { - t.Errorf("Wrong statsRetryCounter: got %v, wanted >= %v", got, wantRetryCountMin) - } -} - // TestSplitCloneV2_NoMasterAvailable tests that vtworker correctly retries // even in a period where no MASTER tablet is available according to the // HealthCheck instance. diff --git a/go/vt/wrangler/testlib/find_tablet_test.go b/go/vt/wrangler/testlib/find_tablet_test.go index d6835ce053c..e594b8d72db 100644 --- a/go/vt/wrangler/testlib/find_tablet_test.go +++ b/go/vt/wrangler/testlib/find_tablet_test.go @@ -18,7 +18,6 @@ package testlib import ( "testing" - "time" "golang.org/x/net/context" @@ -27,7 +26,6 @@ import ( "vitess.io/vitess/go/vt/topo/memorytopo" "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/topotools" - "vitess.io/vitess/go/vt/vttablet/tabletmanager" "vitess.io/vitess/go/vt/vttablet/tmclient" "vitess.io/vitess/go/vt/wrangler" @@ -35,8 +33,6 @@ import ( ) func TestFindTablet(t *testing.T) { - tabletmanager.SetReparentFlags(time.Minute /* finalizeTimeout */) - ctx := context.Background() ts := memorytopo.NewServer("cell1", "cell2") wr := wrangler.New(logutil.NewConsoleLogger(), ts, tmclient.NewTabletManagerClient()) diff --git a/go/vt/wrangler/testlib/rpc_reparent_external_test.go b/go/vt/wrangler/testlib/rpc_reparent_external_test.go deleted file mode 100644 index 6390e6ff71b..00000000000 --- a/go/vt/wrangler/testlib/rpc_reparent_external_test.go +++ /dev/null @@ -1,649 +0,0 @@ -/* -Copyright 2019 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 testlib - -import ( - "fmt" - "sync" - "testing" - "time" - - "golang.org/x/net/context" - - "vitess.io/vitess/go/event" - "vitess.io/vitess/go/vt/logutil" - "vitess.io/vitess/go/vt/topo/memorytopo" - "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/vttablet/tabletmanager" - "vitess.io/vitess/go/vt/vttablet/tmclient" - "vitess.io/vitess/go/vt/wrangler" - - topodatapb "vitess.io/vitess/go/vt/proto/topodata" -) - -func TestRPCTabletExternallyReparented(t *testing.T) { - tabletmanager.SetReparentFlags(time.Minute /* finalizeTimeout */) - - ctx := context.Background() - ts := memorytopo.NewServer("cell1", "cell2") - wr := wrangler.New(logutil.NewConsoleLogger(), ts, tmclient.NewTabletManagerClient()) - - // Create an old master and a new master - oldMaster := NewFakeTablet(t, wr, "cell1", 0, topodatapb.TabletType_MASTER, nil) - newMaster := NewFakeTablet(t, wr, "cell2", 1, topodatapb.TabletType_REPLICA, nil) - - // Build keyspace graph - err := topotools.RebuildKeyspace(context.Background(), logutil.NewConsoleLogger(), ts, oldMaster.Tablet.Keyspace, []string{"cell1", "cell2"}) - if err != nil { - t.Fatalf("RebuildKeyspaceLocked failed: %v", err) - } - - // On the elected master, we will respond to - // TabletActionSlaveWasPromoted - newMaster.StartActionLoop(t, wr) - defer newMaster.StopActionLoop(t) - - oldMaster.FakeMysqlDaemon.SetMasterInput = topoproto.MysqlAddr(newMaster.Tablet) - oldMaster.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{ - "FAKE SET MASTER", - "START SLAVE", - } - // On the old master, we will only respond to - // TabletActionSlaveWasRestarted. - oldMaster.StartActionLoop(t, wr) - defer oldMaster.StopActionLoop(t) - - // First test: reparent to the same master, make sure it works - // as expected. - tmc := tmclient.NewTabletManagerClient() - _, err = ts.GetTablet(ctx, oldMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet failed: %v", err) - } - waitID := makeWaitID() - if err := tmc.TabletExternallyReparented(context.Background(), oldMaster.Tablet, waitID); err != nil { - t.Fatalf("TabletExternallyReparented(same master) should have worked: %v", err) - } - waitForExternalReparent(t, "TestRPCTabletExternallyReparented: same master", waitID) - - // This tests the good case, where everything works as planned - t.Logf("TabletExternallyReparented(new master) expecting success") - ti, err := ts.GetTablet(ctx, newMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet failed: %v", err) - } - waitID = makeWaitID() - if err := tmc.TabletExternallyReparented(context.Background(), ti.Tablet, waitID); err != nil { - t.Fatalf("TabletExternallyReparented(replica) failed: %v", err) - } - waitForExternalReparent(t, "TestRPCTabletExternallyReparented: good case", waitID) -} - -func TestRPCTabletExternallyReparentedSlaveMysql(t *testing.T) { - tabletmanager.SetReparentFlags(time.Minute /* finalizeTimeout */) - - ctx := context.Background() - ts := memorytopo.NewServer("cell1", "cell2") - wr := wrangler.New(logutil.NewConsoleLogger(), ts, tmclient.NewTabletManagerClient()) - - // Create an old master, a new master, two good slaves, one bad slave - oldMaster := NewFakeTablet(t, wr, "cell1", 0, topodatapb.TabletType_MASTER, nil) - newMaster := NewFakeTablet(t, wr, "cell2", 1, topodatapb.TabletType_REPLICA, nil) - newMaster.FakeMysqlDaemon.ReadOnly = true - newMaster.FakeMysqlDaemon.Replicating = true - - // Build keyspace graph - err := topotools.RebuildKeyspace(context.Background(), logutil.NewConsoleLogger(), ts, oldMaster.Tablet.Keyspace, []string{"cell1", "cell2"}) - if err != nil { - t.Fatalf("RebuildKeyspaceLocked failed: %v", err) - } - - // On the elected master, we will respond to - // TabletActionSlaveWasPromoted - newMaster.StartActionLoop(t, wr) - defer newMaster.StopActionLoop(t) - - oldMaster.FakeMysqlDaemon.SetMasterInput = topoproto.MysqlAddr(newMaster.Tablet) - oldMaster.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{ - "FAKE SET MASTER", - "START SLAVE", - } - // On the old master, we will only respond to - // TabletActionSlaveWasRestarted. - oldMaster.StartActionLoop(t, wr) - defer oldMaster.StopActionLoop(t) - - // This tests a bad case: the new designated master is a slave, - // but we should do what we're told anyway. - tmc := tmclient.NewTabletManagerClient() - ti, err := ts.GetTablet(ctx, newMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet failed: %v", err) - } - waitID := makeWaitID() - if err := tmc.TabletExternallyReparented(context.Background(), ti.Tablet, waitID); err != nil { - t.Fatalf("TabletExternallyReparented(slave) error: %v", err) - } - waitForExternalReparent(t, "TestRPCTabletExternallyReparented: slave designated as master", waitID) - -} - -// TestRPCTabletExternallyReparentedWithDifferentMysqlPort makes sure -// that if mysql is restarted on the master-elect tablet and has a different -// port, we pick it up correctly. -func TestRPCTabletExternallyReparentedWithDifferentMysqlPort(t *testing.T) { - tabletmanager.SetReparentFlags(time.Minute /* finalizeTimeout */) - - ctx := context.Background() - ts := memorytopo.NewServer("cell1") - wr := wrangler.New(logutil.NewConsoleLogger(), ts, tmclient.NewTabletManagerClient()) - - // Create an old master, a new master, two good slaves, one bad slave - oldMaster := NewFakeTablet(t, wr, "cell1", 0, topodatapb.TabletType_MASTER, nil) - newMaster := NewFakeTablet(t, wr, "cell1", 1, topodatapb.TabletType_REPLICA, nil) - goodSlave := NewFakeTablet(t, wr, "cell1", 2, topodatapb.TabletType_REPLICA, nil) - - // Build keyspace graph - err := topotools.RebuildKeyspace(context.Background(), logutil.NewConsoleLogger(), ts, oldMaster.Tablet.Keyspace, []string{"cell1"}) - if err != nil { - t.Fatalf("RebuildKeyspaceLocked failed: %v", err) - } - // Now we're restarting mysql on a different port, 3301->3303 - // but without updating the Tablet record in topology. - - // On the elected master, we will respond to - // TabletActionSlaveWasPromoted, so we need a MysqlDaemon - // that returns no master, and the new port (as returned by mysql) - newMaster.FakeMysqlDaemon.MysqlPort = 3303 - newMaster.StartActionLoop(t, wr) - defer newMaster.StopActionLoop(t) - - oldMaster.FakeMysqlDaemon.SetMasterInput = topoproto.MysqlAddr(newMaster.Tablet) - oldMaster.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{ - "FAKE SET MASTER", - "START SLAVE", - } - // On the old master, we will only respond to - // TabletActionSlaveWasRestarted and point to the new mysql port - oldMaster.StartActionLoop(t, wr) - defer oldMaster.StopActionLoop(t) - - // On the good slaves, we will respond to - // TabletActionSlaveWasRestarted and point to the new mysql port - goodSlave.StartActionLoop(t, wr) - defer goodSlave.StopActionLoop(t) - - // This tests the good case, where everything works as planned - t.Logf("TabletExternallyReparented(new master) expecting success") - tmc := tmclient.NewTabletManagerClient() - ti, err := ts.GetTablet(ctx, newMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet failed: %v", err) - } - waitID := makeWaitID() - if err := tmc.TabletExternallyReparented(context.Background(), ti.Tablet, waitID); err != nil { - t.Fatalf("TabletExternallyReparented(replica) failed: %v", err) - } - waitForExternalReparent(t, "TestRPCTabletExternallyReparentedWithDifferentMysqlPort: good case", waitID) -} - -// TestRPCTabletExternallyReparentedContinueOnUnexpectedMaster makes sure -// that we ignore mysql's master if the flag is set -func TestRPCTabletExternallyReparentedContinueOnUnexpectedMaster(t *testing.T) { - tabletmanager.SetReparentFlags(time.Minute /* finalizeTimeout */) - - ctx := context.Background() - ts := memorytopo.NewServer("cell1") - wr := wrangler.New(logutil.NewConsoleLogger(), ts, tmclient.NewTabletManagerClient()) - - // Create an old master, a new master, two good slaves, one bad slave - oldMaster := NewFakeTablet(t, wr, "cell1", 0, topodatapb.TabletType_MASTER, nil) - newMaster := NewFakeTablet(t, wr, "cell1", 1, topodatapb.TabletType_REPLICA, nil) - goodSlave := NewFakeTablet(t, wr, "cell1", 2, topodatapb.TabletType_REPLICA, nil) - - // Build keyspace graph - err := topotools.RebuildKeyspace(context.Background(), logutil.NewConsoleLogger(), ts, oldMaster.Tablet.Keyspace, []string{"cell1"}) - if err != nil { - t.Fatalf("RebuildKeyspaceLocked failed: %v", err) - } - // On the elected master, we will respond to - // TabletActionSlaveWasPromoted, so we need a MysqlDaemon - // that returns no master, and the new port (as returned by mysql) - newMaster.StartActionLoop(t, wr) - defer newMaster.StopActionLoop(t) - - oldMaster.FakeMysqlDaemon.SetMasterInput = topoproto.MysqlAddr(newMaster.Tablet) - oldMaster.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{ - "FAKE SET MASTER", - "START SLAVE", - } - // On the old master, we will only respond to - // TabletActionSlaveWasRestarted and point to a bad host - oldMaster.StartActionLoop(t, wr) - defer oldMaster.StopActionLoop(t) - - // On the good slave, we will respond to - // TabletActionSlaveWasRestarted and point to a bad host - goodSlave.StartActionLoop(t, wr) - defer goodSlave.StopActionLoop(t) - - // This tests the good case, where everything works as planned - t.Logf("TabletExternallyReparented(new master) expecting success") - tmc := tmclient.NewTabletManagerClient() - ti, err := ts.GetTablet(ctx, newMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet failed: %v", err) - } - waitID := makeWaitID() - if err := tmc.TabletExternallyReparented(context.Background(), ti.Tablet, waitID); err != nil { - t.Fatalf("TabletExternallyReparented(replica) failed: %v", err) - } - waitForExternalReparent(t, "TestRPCTabletExternallyReparentedContinueOnUnexpectedMaster: good case", waitID) -} - -func TestRPCTabletExternallyReparentedFailedOldMaster(t *testing.T) { - // The 'RefreshState' call on the old master will timeout on - // this value, so it has to be smaller than the 10s of the - // wait for the 'finished' state of waitForExternalReparent. - tabletmanager.SetReparentFlags(2 * time.Second /* finalizeTimeout */) - - ctx := context.Background() - ts := memorytopo.NewServer("cell1", "cell2") - wr := wrangler.New(logutil.NewConsoleLogger(), ts, tmclient.NewTabletManagerClient()) - - // Create an old master, a new master, and a good slave. - oldMaster := NewFakeTablet(t, wr, "cell1", 0, topodatapb.TabletType_MASTER, nil) - newMaster := NewFakeTablet(t, wr, "cell1", 1, topodatapb.TabletType_REPLICA, nil) - goodSlave := NewFakeTablet(t, wr, "cell1", 2, topodatapb.TabletType_REPLICA, nil) - - // Build keyspace graph - err := topotools.RebuildKeyspace(context.Background(), logutil.NewConsoleLogger(), ts, oldMaster.Tablet.Keyspace, []string{"cell1"}) - if err != nil { - t.Fatalf("RebuildKeyspaceLocked failed: %v", err) - } - // Reparent to a replica, and pretend the old master is not responding. - - // On the elected master, we will respond to - // TabletActionSlaveWasPromoted. - newMaster.StartActionLoop(t, wr) - defer newMaster.StopActionLoop(t) - - // On the old master, we will only get a RefreshState call, - // let's just not respond to it at all, and let it timeout. - oldMaster.FakeMysqlDaemon.SetMasterInput = topoproto.MysqlAddr(newMaster.Tablet) - oldMaster.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{ - "FAKE SET MASTER", - "START SLAVE", - } - - // On the oldMaster, we expect a ChangeType to REPLICA. - oldMaster.StartActionLoop(t, wr) - defer oldMaster.StopActionLoop(t) - - // On the good slave, we will respond to - // TabletActionSlaveWasRestarted. - goodSlave.StartActionLoop(t, wr) - defer goodSlave.StopActionLoop(t) - - // The reparent should work as expected here - tmc := tmclient.NewTabletManagerClient() - ti, err := ts.GetTablet(ctx, newMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet failed: %v", err) - } - waitID := makeWaitID() - if err := tmc.TabletExternallyReparented(context.Background(), ti.Tablet, waitID); err != nil { - t.Fatalf("TabletExternallyReparented(replica) failed: %v", err) - } - waitForExternalReparent(t, "TestRPCTabletExternallyReparentedFailedOldMaster: good case", waitID) - - // check the old master was converted to replica - tablet, err := ts.GetTablet(ctx, oldMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet(%v) failed: %v", oldMaster.Tablet.Alias, err) - } - if tablet.Type != topodatapb.TabletType_REPLICA { - t.Fatalf("old master should be replica but is: %v", tablet.Type) - } -} - -func TestRPCTabletExternallyReparentedImpostorMaster(t *testing.T) { - tabletmanager.SetReparentFlags(time.Minute /* finalizeTimeout */) - - ctx := context.Background() - ts := memorytopo.NewServer("cell1", "cell2") - wr := wrangler.New(logutil.NewConsoleLogger(), ts, tmclient.NewTabletManagerClient()) - - // Create an old master, a new master, and a bad slave. - badSlave := NewFakeTablet(t, wr, "cell1", 2, topodatapb.TabletType_MASTER, nil) - // do this after badSlave so that the shard record has the expected master - oldMaster := NewFakeTablet(t, wr, "cell1", 0, topodatapb.TabletType_MASTER, nil, ForceInitTablet()) - newMaster := NewFakeTablet(t, wr, "cell1", 1, topodatapb.TabletType_REPLICA, nil) - - // Build keyspace graph - err := topotools.RebuildKeyspace(context.Background(), logutil.NewConsoleLogger(), ts, oldMaster.Tablet.Keyspace, []string{"cell1"}) - if err != nil { - t.Fatalf("RebuildKeyspaceLocked failed: %v", err) - } - // check the old master is really master - tablet, err := ts.GetTablet(ctx, oldMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet(%v) failed: %v", oldMaster.Tablet.Alias, err) - } - if tablet.Type != topodatapb.TabletType_MASTER { - t.Fatalf("old master should be MASTER but is: %v", tablet.Type) - } - - // check the impostor also claims to be master - tablet, err = ts.GetTablet(ctx, badSlave.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet(%v) failed: %v", badSlave.Tablet.Alias, err) - } - if tablet.Type != topodatapb.TabletType_MASTER { - t.Fatalf("impostor should be MASTER but is: %v", tablet.Type) - } - - // On the elected master, we will respond to - // TabletActionSlaveWasPromoted. - newMaster.StartActionLoop(t, wr) - defer newMaster.StopActionLoop(t) - - oldMaster.FakeMysqlDaemon.SetMasterInput = topoproto.MysqlAddr(newMaster.Tablet) - oldMaster.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{ - "FAKE SET MASTER", - "START SLAVE", - } - // On the old master, we will only respond to - // TabletActionSlaveWasRestarted. - oldMaster.StartActionLoop(t, wr) - defer oldMaster.StopActionLoop(t) - - // set this to old master because as soon as badSlave starts, it detects that - // there is a master with a later timestamp and demotes itself - badSlave.FakeMysqlDaemon.SetMasterInput = topoproto.MysqlAddr(oldMaster.Tablet) - badSlave.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{ - "FAKE SET MASTER", - "START SLAVE", - } - // On the bad slave, we will respond to - // TabletActionSlaveWasRestarted. - badSlave.StartActionLoop(t, wr) - defer badSlave.StopActionLoop(t) - - // The reparent should work as expected here - tmc := tmclient.NewTabletManagerClient() - ti, err := ts.GetTablet(ctx, newMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet failed: %v", err) - } - waitID := makeWaitID() - if err := tmc.TabletExternallyReparented(context.Background(), ti.Tablet, waitID); err != nil { - t.Fatalf("TabletExternallyReparented(replica) failed: %v", err) - } - waitForExternalReparent(t, "TestRPCTabletExternallyReparentedImpostorMaster: good case", waitID) - - // check the new master is really master - tablet, err = ts.GetTablet(ctx, newMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet(%v) failed: %v", newMaster.Tablet.Alias, err) - } - if tablet.Type != topodatapb.TabletType_MASTER { - t.Fatalf("new master should be MASTER but is: %v", tablet.Type) - } - - // check the old master was converted to replica - tablet, err = ts.GetTablet(ctx, oldMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet(%v) failed: %v", oldMaster.Tablet.Alias, err) - } - if tablet.Type != topodatapb.TabletType_REPLICA { - t.Fatalf("old master should be replica but is: %v", tablet.Type) - } - - // check the impostor master was converted to replica - tablet, err = ts.GetTablet(ctx, badSlave.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet(%v) failed: %v", badSlave.Tablet.Alias, err) - } - if tablet.Type != topodatapb.TabletType_REPLICA { - t.Fatalf("bad slave should be replica but is: %v", tablet.Type) - } -} - -func TestRPCTabletExternallyReparentedFailedImpostorMaster(t *testing.T) { - tabletmanager.SetReparentFlags(2 * time.Second /* finalizeTimeout */) - - ctx := context.Background() - ts := memorytopo.NewServer("cell1", "cell2") - wr := wrangler.New(logutil.NewConsoleLogger(), ts, tmclient.NewTabletManagerClient()) - - // Create an old master, a new master, and a bad slave. - badSlave := NewFakeTablet(t, wr, "cell1", 2, topodatapb.TabletType_MASTER, nil) - // do this after badSlave so that the shard record has the expected master - oldMaster := NewFakeTablet(t, wr, "cell1", 0, topodatapb.TabletType_MASTER, nil, ForceInitTablet()) - newMaster := NewFakeTablet(t, wr, "cell1", 1, topodatapb.TabletType_REPLICA, nil) - - // Build keyspace graph - err := topotools.RebuildKeyspace(context.Background(), logutil.NewConsoleLogger(), ts, oldMaster.Tablet.Keyspace, []string{"cell1"}) - if err != nil { - t.Fatalf("RebuildKeyspaceLocked failed: %v", err) - } - // check the old master is really master - tablet, err := ts.GetTablet(ctx, oldMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet(%v) failed: %v", oldMaster.Tablet.Alias, err) - } - if tablet.Type != topodatapb.TabletType_MASTER { - t.Fatalf("old master should be MASTER but is: %v", tablet.Type) - } - - // check the impostor also claims to be master - tablet, err = ts.GetTablet(ctx, badSlave.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet(%v) failed: %v", badSlave.Tablet.Alias, err) - } - if tablet.Type != topodatapb.TabletType_MASTER { - t.Fatalf("old master should be MASTER but is: %v", tablet.Type) - } - - // On the elected master, we will respond to - // TabletActionSlaveWasPromoted. - newMaster.StartActionLoop(t, wr) - defer newMaster.StopActionLoop(t) - - oldMaster.FakeMysqlDaemon.SetMasterInput = topoproto.MysqlAddr(newMaster.Tablet) - oldMaster.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{ - "FAKE SET MASTER", - "START SLAVE", - } - // On the old master, we will only respond to - // TabletActionSlaveWasRestarted. - oldMaster.StartActionLoop(t, wr) - defer oldMaster.StopActionLoop(t) - - // On the bad slave, we expect a ChangeType to REPLICA. - badSlave.StartActionLoop(t, wr) - defer badSlave.StopActionLoop(t) - - // The reparent should work as expected here - tmc := tmclient.NewTabletManagerClient() - ti, err := ts.GetTablet(ctx, newMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet failed: %v", err) - } - waitID := makeWaitID() - if err := tmc.TabletExternallyReparented(context.Background(), ti.Tablet, waitID); err != nil { - t.Fatalf("TabletExternallyReparented(replica) failed: %v", err) - } - waitForExternalReparent(t, "TestRPCTabletExternallyReparentedImpostorMaster: good case", waitID) - - // check the new master is really master - tablet, err = ts.GetTablet(ctx, newMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet(%v) failed: %v", newMaster.Tablet.Alias, err) - } - if tablet.Type != topodatapb.TabletType_MASTER { - t.Fatalf("new master should be MASTER but is: %v", tablet.Type) - } - - // check the old master was converted to replica - tablet, err = ts.GetTablet(ctx, oldMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet(%v) failed: %v", oldMaster.Tablet.Alias, err) - } - if tablet.Type != topodatapb.TabletType_REPLICA { - t.Fatalf("old master should be replica but is: %v", tablet.Type) - } - - // check the impostor master was converted to replica - tablet, err = ts.GetTablet(ctx, badSlave.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet(%v) failed: %v", badSlave.Tablet.Alias, err) - } - if tablet.Type != topodatapb.TabletType_REPLICA { - t.Fatalf("bad slave should be replica but is: %v", tablet.Type) - } -} - -func TestRPCTabletExternallyReparentedRerun(t *testing.T) { - tabletmanager.SetReparentFlags(time.Minute /* finalizeTimeout */) - - ctx := context.Background() - ts := memorytopo.NewServer("cell1", "cell2") - wr := wrangler.New(logutil.NewConsoleLogger(), ts, tmclient.NewTabletManagerClient()) - - // Create an old master, a new master, and a good slave. - oldMaster := NewFakeTablet(t, wr, "cell1", 0, topodatapb.TabletType_MASTER, nil) - newMaster := NewFakeTablet(t, wr, "cell1", 1, topodatapb.TabletType_REPLICA, nil) - goodSlave := NewFakeTablet(t, wr, "cell1", 2, topodatapb.TabletType_REPLICA, nil) - - // Build keyspace graph - err := topotools.RebuildKeyspace(context.Background(), logutil.NewConsoleLogger(), ts, oldMaster.Tablet.Keyspace, []string{"cell1"}) - if err != nil { - t.Fatalf("RebuildKeyspaceLocked failed: %v", err) - } - // On the elected master, we will respond to - // TabletActionSlaveWasPromoted. - newMaster.StartActionLoop(t, wr) - defer newMaster.StopActionLoop(t) - - oldMaster.FakeMysqlDaemon.SetMasterInput = topoproto.MysqlAddr(newMaster.Tablet) - oldMaster.FakeMysqlDaemon.ExpectedExecuteSuperQueryList = []string{ - "FAKE SET MASTER", - "START SLAVE", - } - // On the old master, we will only respond to - // TabletActionSlaveWasRestarted. - oldMaster.StartActionLoop(t, wr) - defer oldMaster.StopActionLoop(t) - - // On the good slave, we will respond to - // TabletActionSlaveWasRestarted. - goodSlave.StartActionLoop(t, wr) - defer goodSlave.StopActionLoop(t) - - // The reparent should work as expected here - tmc := tmclient.NewTabletManagerClient() - ti, err := ts.GetTablet(ctx, newMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet failed: %v", err) - } - waitID := makeWaitID() - if err := tmc.TabletExternallyReparented(context.Background(), ti.Tablet, waitID); err != nil { - t.Fatalf("TabletExternallyReparented(replica) failed: %v", err) - } - waitForExternalReparent(t, "TestRPCTabletExternallyReparentedFailedOldMaster: good case", waitID) - - // check the old master was converted to replica - tablet, err := ts.GetTablet(ctx, oldMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet(%v) failed: %v", oldMaster.Tablet.Alias, err) - } - if tablet.Type != topodatapb.TabletType_REPLICA { - t.Fatalf("old master should be replica but is: %v", tablet.Type) - } - - // run TER again and make sure the master is still correct - waitID = makeWaitID() - if err := tmc.TabletExternallyReparented(context.Background(), ti.Tablet, waitID); err != nil { - t.Fatalf("TabletExternallyReparented(replica) failed: %v", err) - } - waitForExternalReparent(t, "TestRPCTabletExternallyReparentedFailedOldMaster: good case", waitID) - - // check the new master is still master - tablet, err = ts.GetTablet(ctx, newMaster.Tablet.Alias) - if err != nil { - t.Fatalf("GetTablet(%v) failed: %v", newMaster.Tablet.Alias, err) - } - if tablet.Type != topodatapb.TabletType_MASTER { - t.Fatalf("new master should be MASTER but is: %v", tablet.Type) - } - -} - -var ( - externalReparents = make(map[string]chan struct{}) - externalReparentsMutex sync.Mutex -) - -// makeWaitID generates a unique externalID that can be passed to -// TabletExternallyReparented, and then to waitForExternalReparent. -func makeWaitID() string { - externalReparentsMutex.Lock() - id := fmt.Sprintf("wait id %v", len(externalReparents)) - externalReparents[id] = make(chan struct{}) - externalReparentsMutex.Unlock() - return id -} - -func init() { - event.AddListener(func(ev *events.Reparent) { - if ev.Status == "finished" { - externalReparentsMutex.Lock() - if c, ok := externalReparents[ev.ExternalID]; ok { - close(c) - } - externalReparentsMutex.Unlock() - } - }) -} - -// waitForExternalReparent waits up to a fixed duration for the external -// reparent with the given ID to finish. The ID must have been previously -// generated by makeWaitID(). -// -// The TabletExternallyReparented RPC returns as soon as the -// new master is visible in the serving graph. Before checking things like -// replica endpoints and old master status, we should wait for the finalize -// stage, which happens in the background. -func waitForExternalReparent(t *testing.T, name, externalID string) { - timer := time.NewTimer(10 * time.Second) - defer timer.Stop() - - externalReparentsMutex.Lock() - c := externalReparents[externalID] - externalReparentsMutex.Unlock() - - select { - case <-c: - return - case <-timer.C: - t.Fatalf("deadline exceeded waiting for finalized external reparent %q for test %v", externalID, name) - } -} diff --git a/proto/tabletmanagerdata.proto b/proto/tabletmanagerdata.proto index c9165e3a95e..73d165f0b59 100644 --- a/proto/tabletmanagerdata.proto +++ b/proto/tabletmanagerdata.proto @@ -311,22 +311,6 @@ message StartSlaveUntilAfterRequest { message StartSlaveUntilAfterResponse { } -message TabletExternallyReparentedRequest { - // external_id is an string value that may be provided by an external - // agent for tracking purposes. The tablet will emit this string in - // events triggered by TabletExternallyReparented, such as VitessReparent. - string external_id = 1; -} - -message TabletExternallyReparentedResponse { -} - -message TabletExternallyElectedRequest { -} - -message TabletExternallyElectedResponse { -} - message GetSlavesRequest { } diff --git a/proto/tabletmanagerservice.proto b/proto/tabletmanagerservice.proto index 85ed11594ee..d3a113832f2 100644 --- a/proto/tabletmanagerservice.proto +++ b/proto/tabletmanagerservice.proto @@ -105,34 +105,6 @@ service TabletManager { // the provided position rpc StartSlaveUntilAfter(tabletmanagerdata.StartSlaveUntilAfterRequest) returns (tabletmanagerdata.StartSlaveUntilAfterResponse) {}; - // TabletExternallyReparented tells a tablet that its underlying MySQL is - // currently the master. It is only used in environments (tabletmanagerdata.such as Vitess+MoB) - // in which MySQL is reparented by some agent external to Vitess, and then - // that agent simply notifies Vitess. - // - // This call is idempotent with respect to a single target tablet. - // However, the tablet assumes there is a cooling-off period following the - // initial external reparent from A to B, before this call is repeated on any - // tablet other than B. This assumption is configurable with the vttablet flag - // "finalize_external_reparent_timeout". - // - // For more information, see the design doc at go/vt-fast-failover. - rpc TabletExternallyReparented(tabletmanagerdata.TabletExternallyReparentedRequest) returns (tabletmanagerdata.TabletExternallyReparentedResponse) {}; - - // TabletExternallyElected is an notification that may be sent in - // anticipation of potentially later sending TabletExternallyReparented. - // The tablet can use this extra lead time to prepare to react quickly if - // TabletExternallyReparented does follow. - // - // This call is effectively a no-op if it is not followed by a call to - // TabletExternallyReparented, so the external agent doing the reparent can - // still change its mind. - // - // The agent does not need to wait for this call or cancel it before calling - // TabletExternallyReparented if the external reparent operation finishes - // before TabletExternallyElected returns. - rpc TabletExternallyElected(tabletmanagerdata.TabletExternallyElectedRequest) returns (tabletmanagerdata.TabletExternallyElectedResponse) {}; - // GetSlaves asks for the list of mysql slaves rpc GetSlaves(tabletmanagerdata.GetSlavesRequest) returns (tabletmanagerdata.GetSlavesResponse) {}; From 7e09a38785b5de548127cd8450cb2c17ff2ef104 Mon Sep 17 00:00:00 2001 From: Sugu Sougoumarane Date: Sat, 2 May 2020 17:58:53 -0700 Subject: [PATCH 3/5] tm revamp: delete obsolete schemaswap It was making direct updates to the tablet record. Signed-off-by: Sugu Sougoumarane --- go/vt/schemamanager/schemaswap/schema_swap.go | 1311 ----------------- go/vt/vtctld/workflow.go | 4 - 2 files changed, 1315 deletions(-) delete mode 100644 go/vt/schemamanager/schemaswap/schema_swap.go diff --git a/go/vt/schemamanager/schemaswap/schema_swap.go b/go/vt/schemamanager/schemaswap/schema_swap.go deleted file mode 100644 index 95302ca1e44..00000000000 --- a/go/vt/schemamanager/schemaswap/schema_swap.go +++ /dev/null @@ -1,1311 +0,0 @@ -/* -Copyright 2019 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 schemaswap - -import ( - "bytes" - "encoding/json" - "errors" - "flag" - "fmt" - "io" - "sort" - "sync" - "time" - - "vitess.io/vitess/go/vt/vtgate/evalengine" - - "golang.org/x/net/context" - - "vitess.io/vitess/go/sqltypes" - "vitess.io/vitess/go/vt/concurrency" - "vitess.io/vitess/go/vt/discovery" - "vitess.io/vitess/go/vt/hook" - "vitess.io/vitess/go/vt/log" - "vitess.io/vitess/go/vt/logutil" - "vitess.io/vitess/go/vt/mysqlctl" - topodatapb "vitess.io/vitess/go/vt/proto/topodata" - workflowpb "vitess.io/vitess/go/vt/proto/workflow" - "vitess.io/vitess/go/vt/topo" - "vitess.io/vitess/go/vt/topo/topoproto" - "vitess.io/vitess/go/vt/vtctl" - "vitess.io/vitess/go/vt/vttablet/tmclient" - "vitess.io/vitess/go/vt/workflow" - "vitess.io/vitess/go/vt/wrangler" -) - -var ( - delayBetweenErrors = flag.Duration("schema_swap_delay_between_errors", time.Minute, - "time to wait after a retryable error happened in the schema swap process") - adminQueryTimeout = flag.Duration("schema_swap_admin_query_timeout", 30*time.Second, - "timeout for SQL queries used to save and retrieve meta information for schema swap process") - backupConcurrency = flag.Int("schema_swap_backup_concurrency", 4, - "number of simultaneous compression/checksum jobs to run for seed backup during schema swap") - reparentTimeout = flag.Duration("schema_swap_reparent_timeout", 30*time.Second, - "timeout to wait for slaves when doing reparent during schema swap") - - errOnlyMasterLeft = errors.New("only master is left to swap schema") - errNoBackupWithSwap = errors.New("restore from backup cannot pick up new schema") -) - -const ( - lastStartedMetadataName = "LastStartedSchemaSwap" - lastFinishedMetadataName = "LastFinishedSchemaSwap" - currentSQLMetadataName = "CurrentSchemaSwapSQL" - lastAppliedMetadataName = "LastAppliedSchemaSwap" - - workflowFactoryName = "schema_swap" -) - -// Swap contains meta-information and methods controlling schema swap process as a whole. -type Swap struct { - // ctx is the context of the whole schema swap process. Once this context is cancelled - // the schema swap process stops. - ctx context.Context - - // workflowManager is the manager for the workflow represented by this Swap object. - workflowManager *workflow.Manager - // rootUINode is the root node in workflow UI representing this schema swap. - rootUINode *workflow.Node - // uiLogger is the logger collecting logs that will be displayed in the UI. - uiLogger *logutil.MemoryLogger - - // retryMutex is a mutex protecting access to retryChannel and to Actions in rootUINode. - retryMutex sync.Mutex - // retryChannel is a channel that gets closed when Retry button is pressed. - retryChannel chan struct{} - - // keyspace is the name of the keyspace on which schema swap process operates. - keyspace string - // sql is the query representing schema change being propagated via schema swap process. - sql string - // swapID is the id of the executed schema swap. This is recorded in the database to - // distinguish backups from before and after an applied schema change, and to prevent - // several schema swaps from running at the same time. - swapID uint64 - - // topoServer is the topo server implementation used to discover the topology of the keyspace. - topoServer *topo.Server - // tabletClient is the client implementation used by the schema swap process to control - // all tablets in the keyspace. - tabletClient tmclient.TabletManagerClient - - // allShards is a list of schema swap objects for each shard in the keyspace. - allShards []*shardSchemaSwap -} - -// shardSchemaSwap contains data related to schema swap happening on a specific shard. -type shardSchemaSwap struct { - // parent is the structure with meta-information about the whole schema swap process. - parent *Swap - // shardName is the name of the shard this struct operates on. - shardName string - - // The following is a set of UI nodes representing this shard. - - shardUINode *workflow.Node - applySchemaUINode *workflow.Node - backupUINode *workflow.Node - propagationUINode *workflow.Node - reparentUINode *workflow.Node - - // shardUILogger is the logger collecting logs that will be displayed in the UI - // for the whole shard. - shardUILogger *logutil.MemoryLogger - // propagationUILogger is the logger collecting logs that will be displayed in the UI - // for the propagation task. - propagationUILogger *logutil.MemoryLogger - - // numTabletsTotal is the total number of tablets in the shard. - numTabletsTotal int - // numTabletsSwapped is number of tablets that have schema swapped already. - numTabletsSwapped int - - // tabletHealthCheck watches after the healthiness of all tablets in the shard. - tabletHealthCheck discovery.LegacyHealthCheck - // tabletWatchers contains list of topology watchers monitoring changes in the shard - // topology. There are several of them because the watchers are per-cell. - tabletWatchers []*discovery.LegacyTopologyWatcher - - // allTabletsLock is a mutex protecting access to contents of health check related - // variables below. - allTabletsLock sync.RWMutex - // allTablets is the list of all tablets on the shard mapped by the key provided - // by discovery. The contents of the map is guarded by allTabletsLock. - allTablets map[string]*discovery.LegacyTabletStats - // healthWaitingTablet is a key (the same key as used in allTablets) of a tablet that - // is currently being waited on to become healthy and to catch up with replication. - // The variable is guarded by allTabletsLock. - healthWaitingTablet string - // healthWaitingChannel is a channel that should be closed when the tablet that is - // currently being waited on becomes healthy and catches up with replication. The - // variable is set to nil when nothing is waited on at the moment. The variable is - // protected by allTabletsLock. - healthWaitingChannel *chan interface{} -} - -// shardSwapMetadata contains full metadata about schema swaps on a certain shard. -type shardSwapMetadata struct { - err error - // IDs of last started and last finished schema swap on the shard - lastStartedSwap, lastFinishedSwap uint64 - // currentSQL is the SQL of the currentlr running schema swap (if there is any) - currentSQL string -} - -// SwapWorkflowFactory is a factory to create Swap objects as workflows. -type SwapWorkflowFactory struct{} - -// swapWorkflowData contains info about a new schema swap that is about to be started. -type swapWorkflowData struct { - Keyspace, SQL string -} - -// RegisterWorkflowFactory registers schema swap as a valid factory in the workflow framework. -func RegisterWorkflowFactory() { - workflow.Register(workflowFactoryName, &SwapWorkflowFactory{}) -} - -// Init is a part of workflow.Factory interface. It initializes a Workflow protobuf object. -func (*SwapWorkflowFactory) Init(_ *workflow.Manager, workflowProto *workflowpb.Workflow, args []string) error { - subFlags := flag.NewFlagSet(workflowFactoryName, flag.ContinueOnError) - - keyspace := subFlags.String("keyspace", "", "Name of a keyspace to perform schema swap on") - sql := subFlags.String("sql", "", "Query representing schema change being pushed by schema swap") - if err := subFlags.Parse(args); err != nil { - return err - } - if *keyspace == "" || *sql == "" { - return fmt.Errorf("keyspace name and SQL query must be provided for schema swap") - } - - workflowProto.Name = fmt.Sprintf("Schema swap on keyspace %s", *keyspace) - data := &swapWorkflowData{ - Keyspace: *keyspace, - SQL: *sql, - } - var err error - workflowProto.Data, err = json.Marshal(data) - if err != nil { - return err - } - return nil -} - -// Instantiate is a part of workflow.Factory interface. It instantiates workflow.Workflow object from -// workflowpb.Workflow protobuf object. -func (*SwapWorkflowFactory) Instantiate(_ *workflow.Manager, workflowProto *workflowpb.Workflow, rootNode *workflow.Node) (workflow.Workflow, error) { - data := &swapWorkflowData{} - if err := json.Unmarshal(workflowProto.Data, data); err != nil { - return nil, err - } - rootNode.Message = fmt.Sprintf("Schema swap is executed on the keyspace %s", data.Keyspace) - - return &Swap{ - keyspace: data.Keyspace, - sql: data.SQL, - rootUINode: rootNode, - uiLogger: logutil.NewMemoryLogger(), - }, nil -} - -// Run is a part of workflow.Workflow interface. This is the main entrance point of the schema swap workflow. -func (schemaSwap *Swap) Run(ctx context.Context, manager *workflow.Manager, workflowInfo *topo.WorkflowInfo) error { - schemaSwap.ctx = ctx - schemaSwap.workflowManager = manager - schemaSwap.topoServer = manager.TopoServer() - schemaSwap.tabletClient = tmclient.NewTabletManagerClient() - - log.Infof("Starting schema swap on keyspace %v with the following SQL: %v", schemaSwap.keyspace, schemaSwap.sql) - - for { - err := schemaSwap.executeSwap() - if err == nil { - return nil - } - // If context is cancelled then return right away, otherwise move on to allow - // user to retry. - select { - case <-schemaSwap.ctx.Done(): - schemaSwap.setUIMessage(fmt.Sprintf("Error: %v", err)) - return err - default: - } - - schemaSwap.retryMutex.Lock() - retryAction := &workflow.Action{ - Name: "Retry", - State: workflow.ActionStateEnabled, - Style: workflow.ActionStyleWaiting, - } - schemaSwap.rootUINode.Actions = []*workflow.Action{retryAction} - schemaSwap.rootUINode.Listener = schemaSwap - schemaSwap.retryChannel = make(chan struct{}) - schemaSwap.retryMutex.Unlock() - // setUIMessage broadcasts changes to rootUINode. - schemaSwap.setUIMessage(fmt.Sprintf("Error: %v", err)) - - select { - case <-schemaSwap.retryChannel: - schemaSwap.setUIMessage("Retrying schema swap after an error") - continue - case <-schemaSwap.ctx.Done(): - schemaSwap.closeRetryChannel() - return schemaSwap.ctx.Err() - } - } -} - -// closeRetryChannel closes the retryChannel and empties the Actions list in the rootUINode -// to indicate that the channel is closed and Retry action is not waited for anymore. -func (schemaSwap *Swap) closeRetryChannel() { - schemaSwap.retryMutex.Lock() - defer schemaSwap.retryMutex.Unlock() - - if len(schemaSwap.rootUINode.Actions) != 0 { - schemaSwap.rootUINode.Actions = []*workflow.Action{} - close(schemaSwap.retryChannel) - } -} - -// Action is a part of workflow.ActionListener interface. It registers "Retry" actions -// from UI. -func (schemaSwap *Swap) Action(ctx context.Context, path, name string) error { - if name != "Retry" { - return fmt.Errorf("unknown action on schema swap: %v", name) - } - schemaSwap.closeRetryChannel() - schemaSwap.rootUINode.BroadcastChanges(false /* updateChildren */) - return nil -} - -// executeSwap is the main entry point of the schema swap process. It drives the process from start -// to finish, including possible restart of already started process. In the latter case the -// method should be just called again and it will pick up already started process. The only -// input argument is the SQL statements that comprise the schema change that needs to be -// pushed using the schema swap process. -func (schemaSwap *Swap) executeSwap() error { - schemaSwap.setUIMessage("Initializing schema swap") - if len(schemaSwap.allShards) == 0 { - if err := schemaSwap.createShardObjects(); err != nil { - return err - } - schemaSwap.rootUINode.BroadcastChanges(true /* updateChildren */) - } - if err := schemaSwap.initializeSwap(); err != nil { - return err - } - errHealthWatchers := schemaSwap.runOnAllShards( - func(shard *shardSchemaSwap) error { - return shard.startHealthWatchers(schemaSwap.ctx) - }) - // Note: this defer statement is before the error is checked because some shards may - // succeed while others fail. We should try to stop health watching on all shards no - // matter if there was some failure or not. - defer schemaSwap.stopAllHealthWatchers() - if errHealthWatchers != nil { - return errHealthWatchers - } - - schemaSwap.setUIMessage("Applying schema change on seed tablets") - err := schemaSwap.runOnAllShards( - func(shard *shardSchemaSwap) error { - shard.setShardInProgress(true) - err := shard.applySeedSchemaChange() - shard.setShardInProgress(false) - return err - }) - if err != nil { - return err - } - schemaSwap.setUIMessage("Taking seed backups") - err = schemaSwap.runOnAllShards( - func(shard *shardSchemaSwap) error { - shard.setShardInProgress(true) - err := shard.takeSeedBackup() - shard.setShardInProgress(false) - return err - }) - if err != nil { - return err - } - schemaSwap.setUIMessage("Propagating backups to non-master tablets") - err = schemaSwap.runOnAllShards( - func(shard *shardSchemaSwap) error { - shard.setShardInProgress(true) - err := shard.propagateToAllTablets(false /* withMasterReparent */) - shard.setShardInProgress(false) - return err - }) - if err != nil { - return err - } - schemaSwap.setUIMessage("Propagating backups to master tablets") - err = schemaSwap.runOnAllShards( - func(shard *shardSchemaSwap) error { - shard.setShardInProgress(true) - err := shard.propagateToAllTablets(true /* withMasterReparent */) - shard.setShardInProgress(false) - return err - }) - if err != nil { - return err - } - schemaSwap.setUIMessage("Finalizing schema swap") - err = schemaSwap.finalizeSwap() - if err != nil { - return err - } - for _, shard := range schemaSwap.allShards { - shard.shardUINode.State = workflowpb.WorkflowState_Done - } - schemaSwap.rootUINode.BroadcastChanges(true /* updateChildren */) - schemaSwap.setUIMessage("Schema swap is finished") - return nil -} - -// setUIMessage updates message on the schema swap's root UI node and broadcasts changes. -func (schemaSwap *Swap) setUIMessage(message string) { - log.Infof("Schema swap on keyspace %v: %v", schemaSwap.keyspace, message) - schemaSwap.uiLogger.Infof(message) - schemaSwap.rootUINode.Log = schemaSwap.uiLogger.String() - schemaSwap.rootUINode.Message = message - schemaSwap.rootUINode.BroadcastChanges(false /* updateChildren */) -} - -// runOnAllShards is a helper method that executes the passed function for all shards in parallel. -// The method returns no error if the function succeeds on all shards. If on any of the shards -// the function fails then the method returns error. If several shards return error then only one -// of them is returned. -func (schemaSwap *Swap) runOnAllShards(shardFunc func(shard *shardSchemaSwap) error) error { - var errorRecorder concurrency.AllErrorRecorder - var waitGroup sync.WaitGroup - for _, shardSwap := range schemaSwap.allShards { - waitGroup.Add(1) - go func(shard *shardSchemaSwap) { - defer waitGroup.Done() - errorRecorder.RecordError(shardFunc(shard)) - }(shardSwap) - } - waitGroup.Wait() - return errorRecorder.Error() -} - -// createShardObjects creates per-shard swap objects for all shards in the keyspace. -func (schemaSwap *Swap) createShardObjects() error { - shardsList, err := schemaSwap.topoServer.FindAllShardsInKeyspace(schemaSwap.ctx, schemaSwap.keyspace) - if err != nil { - return err - } - for _, shardInfo := range shardsList { - shardSwap := &shardSchemaSwap{ - parent: schemaSwap, - shardName: shardInfo.ShardName(), - shardUINode: &workflow.Node{ - Name: fmt.Sprintf("Shard %v", shardInfo.ShardName()), - PathName: shardInfo.ShardName(), - State: workflowpb.WorkflowState_Running, - }, - applySchemaUINode: &workflow.Node{ - Name: "Apply schema on seed tablet", - PathName: "apply_schema", - }, - backupUINode: &workflow.Node{ - Name: "Take seed backup", - PathName: "backup", - }, - propagationUINode: &workflow.Node{ - Name: "Propagate backup", - PathName: "propagate", - }, - reparentUINode: &workflow.Node{ - Name: "Reparent from old master", - PathName: "reparent", - }, - shardUILogger: logutil.NewMemoryLogger(), - propagationUILogger: logutil.NewMemoryLogger(), - } - schemaSwap.rootUINode.Children = append(schemaSwap.rootUINode.Children, shardSwap.shardUINode) - shardSwap.shardUINode.Children = []*workflow.Node{ - shardSwap.applySchemaUINode, - shardSwap.backupUINode, - shardSwap.propagationUINode, - shardSwap.reparentUINode, - } - schemaSwap.allShards = append(schemaSwap.allShards, shardSwap) - } - return nil -} - -// stopAllHealthWatchers stops watching for health on each shard. It's separated into a separate -// function mainly to make "defer" statement where it's used simpler. -func (schemaSwap *Swap) stopAllHealthWatchers() { - schemaSwap.runOnAllShards( - func(shard *shardSchemaSwap) error { - shard.stopHealthWatchers() - return nil - }) -} - -// initializeSwap starts the schema swap process. If there is already a schema swap process started -// the method just picks up that. Otherwise it starts a new one and writes into the database that -// the process was started. -func (schemaSwap *Swap) initializeSwap() error { - var waitGroup sync.WaitGroup - metadataList := make([]shardSwapMetadata, len(schemaSwap.allShards)) - for i, shard := range schemaSwap.allShards { - waitGroup.Add(1) - go shard.readShardMetadata(&metadataList[i], &waitGroup) - } - waitGroup.Wait() - - var recorder concurrency.AllErrorRecorder - var lastFinishedSwapID uint64 - for i, metadata := range metadataList { - if metadata.err != nil { - recorder.RecordError(metadata.err) - } else if metadata.lastStartedSwap < metadata.lastFinishedSwap || metadata.lastStartedSwap > metadata.lastFinishedSwap+1 { - recorder.RecordError(fmt.Errorf( - "bad swap metadata on shard %v: LastFinishedSchemaSwap=%v, LastStartedSchemaSwap=%v", - schemaSwap.allShards[i].shardName, metadata.lastFinishedSwap, metadata.lastStartedSwap)) - } else if metadata.lastStartedSwap != metadata.lastFinishedSwap { - if metadata.currentSQL != schemaSwap.sql { - recorder.RecordError(fmt.Errorf( - "shard %v has an already started schema swap with a different set of SQL statements", - schemaSwap.allShards[i].shardName)) - } - } - if lastFinishedSwapID == 0 || metadata.lastFinishedSwap < lastFinishedSwapID { - lastFinishedSwapID = metadata.lastFinishedSwap - } - } - if recorder.HasErrors() { - return recorder.Error() - } - - schemaSwap.swapID = lastFinishedSwapID + 1 - var haveNotStartedSwap, haveFinishedSwap bool - for i, metadata := range metadataList { - if metadata.lastStartedSwap == metadata.lastFinishedSwap { - // The shard doesn't have schema swap started yet or it's already finished. - if schemaSwap.swapID != metadata.lastFinishedSwap && schemaSwap.swapID != metadata.lastFinishedSwap+1 { - recorder.RecordError(fmt.Errorf( - "shard %v has last finished swap id euqal to %v which doesn't align with swap id for the keyspace equal to %v", - schemaSwap.allShards[i].shardName, metadata.lastFinishedSwap, schemaSwap.swapID)) - } else if schemaSwap.swapID == metadata.lastFinishedSwap { - haveFinishedSwap = true - } else { - haveNotStartedSwap = true - } - } else if schemaSwap.swapID != metadata.lastStartedSwap { - recorder.RecordError(fmt.Errorf( - "shard %v has an already started schema swap with an id %v, while for the keyspace it should be equal to %v", - schemaSwap.allShards[i].shardName, metadata.lastStartedSwap, schemaSwap.swapID)) - } - } - if haveNotStartedSwap && haveFinishedSwap { - recorder.RecordError(errors.New("impossible state: there are shards with finished swap and shards where swap was not started")) - } - if recorder.HasErrors() { - return recorder.Error() - } - - if haveNotStartedSwap { - return schemaSwap.runOnAllShards( - func(shard *shardSchemaSwap) error { - return shard.writeStartedSwap() - }) - } - return nil -} - -// finalizeSwap finishes the completed swap process by modifying the database to register the completion. -func (schemaSwap *Swap) finalizeSwap() error { - return schemaSwap.runOnAllShards( - func(shard *shardSchemaSwap) error { - return shard.writeFinishedSwap() - }) -} - -// setShardInProgress changes the way shard looks in the UI. Either it's "in progress" (has -// animated progress bar) or not (has empty look without progress bar). -func (shardSwap *shardSchemaSwap) setShardInProgress(value bool) { - if value { - shardSwap.shardUINode.Display = workflow.NodeDisplayIndeterminate - } else { - shardSwap.shardUINode.Display = workflow.NodeDisplayNone - } - shardSwap.shardUINode.BroadcastChanges(false /* updateChildren */) -} - -// markStepInProgress marks one step of the shard schema swap workflow as running. -func (shardSwap *shardSchemaSwap) markStepInProgress(uiNode *workflow.Node) { - uiNode.Message = "" - uiNode.State = workflowpb.WorkflowState_Running - uiNode.Display = workflow.NodeDisplayIndeterminate - uiNode.BroadcastChanges(false /* updateChildren */) -} - -// addShardLog prints the message into logs and adds it into logs displayed in UI on the -// shard node. -func (shardSwap *shardSchemaSwap) addShardLog(message string) { - log.Infof("Shard %v: %v", shardSwap.shardName, message) - shardSwap.shardUILogger.Infof(message) - shardSwap.shardUINode.Log = shardSwap.shardUILogger.String() - shardSwap.shardUINode.BroadcastChanges(false /* updateChildren */) -} - -// markStepDone marks one step of the shard schema swap workflow as finished successfully -// or with an error. -func (shardSwap *shardSchemaSwap) markStepDone(uiNode *workflow.Node, err *error) { - if *err != nil { - msg := fmt.Sprintf("Error: %v", *err) - shardSwap.addShardLog(msg) - uiNode.Message = msg - } - uiNode.State = workflowpb.WorkflowState_Done - uiNode.Display = workflow.NodeDisplayNone - uiNode.BroadcastChanges(false /* updateChildren */) -} - -// getMasterTablet returns the tablet that is currently master on the shard. -func (shardSwap *shardSchemaSwap) getMasterTablet() (*topodatapb.Tablet, error) { - topoServer := shardSwap.parent.topoServer - shardInfo, err := topoServer.GetShard(shardSwap.parent.ctx, shardSwap.parent.keyspace, shardSwap.shardName) - if err != nil { - return nil, err - } - tabletInfo, err := topoServer.GetTablet(shardSwap.parent.ctx, shardInfo.MasterAlias) - if err != nil { - return nil, err - } - return tabletInfo.Tablet, nil -} - -// readShardMetadata reads info about schema swaps on this shard from _vt.shard_metadata table. -func (shardSwap *shardSchemaSwap) readShardMetadata(metadata *shardSwapMetadata, waitGroup *sync.WaitGroup) { - defer waitGroup.Done() - - tablet, err := shardSwap.getMasterTablet() - if err != nil { - metadata.err = err - return - } - query := fmt.Sprintf( - "SELECT name, value FROM _vt.shard_metadata WHERE db_name = '%s' and name in ('%s', '%s', '%s')", - topoproto.TabletDbName(tablet), lastStartedMetadataName, lastFinishedMetadataName, currentSQLMetadataName) - queryResult, err := shardSwap.executeAdminQuery(tablet, query, 3 /* maxRows */) - if err != nil { - metadata.err = err - return - } - for _, row := range queryResult.Rows { - switch row[0].ToString() { - case lastStartedMetadataName: - swapID, err := evalengine.ToUint64(row[1]) - if err != nil { - log.Warningf("Could not parse value of last started schema swap id %v, ignoring the value: %v", row[1], err) - } else { - metadata.lastStartedSwap = swapID - } - case lastFinishedMetadataName: - swapID, err := evalengine.ToUint64(row[1]) - if err != nil { - log.Warningf("Could not parse value of last finished schema swap id %v, ignoring the value: %v", row[1], err) - } else { - metadata.lastFinishedSwap = swapID - } - case currentSQLMetadataName: - metadata.currentSQL = row[1].ToString() - } - } -} - -// writeStartedSwap registers in the _vt.shard_metadata table in the database the information -// about the new schema swap process being started. -func (shardSwap *shardSchemaSwap) writeStartedSwap() error { - tablet, err := shardSwap.getMasterTablet() - if err != nil { - return err - } - queryBuf := bytes.Buffer{} - queryBuf.WriteString("INSERT INTO _vt.shard_metadata (db_name, name, value) VALUES ('") - queryBuf.WriteString(topoproto.TabletDbName(tablet)) - queryBuf.WriteString("',") - queryBuf.WriteString(currentSQLMetadataName) - queryBuf.WriteString("',") - sqlValue := sqltypes.NewVarChar(shardSwap.parent.sql) - sqlValue.EncodeSQL(&queryBuf) - queryBuf.WriteString(") ON DUPLICATE KEY UPDATE value = ") - sqlValue.EncodeSQL(&queryBuf) - _, err = shardSwap.executeAdminQuery(tablet, queryBuf.String(), 0 /* maxRows */) - if err != nil { - return err - } - query := fmt.Sprintf( - "INSERT INTO _vt.shard_metadata (name, value) VALUES ('%s', '%d') ON DUPLICATE KEY UPDATE value = '%d'", - lastStartedMetadataName, shardSwap.parent.swapID, shardSwap.parent.swapID) - _, err = shardSwap.executeAdminQuery(tablet, query, 0 /* maxRows */) - return err -} - -// writeFinishedSwap registers in the _vt.shard_metadata table in the database that the schema -// swap process has finished. -func (shardSwap *shardSchemaSwap) writeFinishedSwap() error { - tablet, err := shardSwap.getMasterTablet() - if err != nil { - return err - } - query := fmt.Sprintf( - "INSERT INTO _vt.shard_metadata (db_name, name, value) VALUES ('%s', '%s', '%d') ON DUPLICATE KEY UPDATE value = '%d'", - topoproto.TabletDbName(tablet), lastFinishedMetadataName, shardSwap.parent.swapID, shardSwap.parent.swapID) - _, err = shardSwap.executeAdminQuery(tablet, query, 0 /* maxRows */) - if err != nil { - return err - } - query = fmt.Sprintf("DELETE FROM _vt.shard_metadata WHERE db_name = '%s' AND name = '%s'", topoproto.TabletDbName(tablet), currentSQLMetadataName) - _, err = shardSwap.executeAdminQuery(tablet, query, 0 /* maxRows */) - return err -} - -// startHealthWatchers launches the topology watchers and health checking to monitor -// all tablets on the shard. Function should be called before the start of the schema -// swap process. -func (shardSwap *shardSchemaSwap) startHealthWatchers(ctx context.Context) error { - shardSwap.allTablets = make(map[string]*discovery.LegacyTabletStats) - - shardSwap.tabletHealthCheck = discovery.NewLegacyHealthCheck(*vtctl.HealthcheckRetryDelay, *vtctl.HealthCheckTimeout) - shardSwap.tabletHealthCheck.SetListener(shardSwap, true /* sendDownEvents */) - - topoServer := shardSwap.parent.topoServer - cellList, err := topoServer.GetKnownCells(shardSwap.parent.ctx) - if err != nil { - return err - } - for _, cell := range cellList { - watcher := discovery.NewLegacyShardReplicationWatcher( - ctx, - topoServer, - shardSwap.tabletHealthCheck, - cell, - shardSwap.parent.keyspace, - shardSwap.shardName, - *vtctl.HealthCheckTimeout, - discovery.DefaultTopoReadConcurrency) - shardSwap.tabletWatchers = append(shardSwap.tabletWatchers, watcher) - } - for _, watcher := range shardSwap.tabletWatchers { - if err := watcher.WaitForInitialTopology(); err != nil { - return err - } - } - shardSwap.tabletHealthCheck.WaitForInitialStatsUpdates() - - // Wait for all health connections to be either established or get broken. -waitHealthChecks: - for { - tabletList := shardSwap.getTabletList() - for _, tabletStats := range tabletList { - if tabletStats.Stats == nil && tabletStats.LastError == nil { - select { - case <-shardSwap.parent.ctx.Done(): - return shardSwap.parent.ctx.Err() - case <-time.After(100 * time.Millisecond): - } - continue waitHealthChecks - } - } - break waitHealthChecks - } - return nil -} - -// stopHealthWatchers stops the health checking and topology monitoring. The function -// should be called when schema swap process has finished (successfully or with error) -// and this struct is going to be disposed. -func (shardSwap *shardSchemaSwap) stopHealthWatchers() { - for _, watcher := range shardSwap.tabletWatchers { - watcher.Stop() - } - shardSwap.tabletWatchers = nil - err := shardSwap.tabletHealthCheck.Close() - if err != nil { - log.Errorf("Error closing health checking: %v", err) - } -} - -// isTabletHealthy verifies that the given LegacyTabletStats represents a healthy tablet that is -// caught up with replication to a serving level. -func isTabletHealthy(tabletStats *discovery.LegacyTabletStats) bool { - return tabletStats.Stats.HealthError == "" && !discovery.LegacyIsReplicationLagHigh(tabletStats) -} - -// startWaitingOnUnhealthyTablet registers the tablet as being waited on in a way that -// doesn't race with StatsUpdate(). If the tablet is already healthy then the function -// will return nil as the channel and nil as the error. If the tablet is unhealthy now -// then function will return the channel that will be closed once tablet becomes healthy -// and caught up with replication. Note that the channel is returned so that the caller -// could wait on it without necessity to lock allTabletsLock. -func (shardSwap *shardSchemaSwap) startWaitingOnUnhealthyTablet(tablet *topodatapb.Tablet) (*chan interface{}, error) { - shardSwap.allTabletsLock.Lock() - defer shardSwap.allTabletsLock.Unlock() - - tabletKey := discovery.TabletToMapKey(tablet) - tabletStats, tabletFound := shardSwap.allTablets[tabletKey] - if !tabletFound { - return nil, fmt.Errorf("tablet %v has disappeared while doing schema swap", tablet.Alias) - } - if isTabletHealthy(tabletStats) { - return nil, nil - } - waitingChannel := make(chan interface{}) - shardSwap.healthWaitingChannel = &waitingChannel - shardSwap.healthWaitingTablet = tabletKey - return shardSwap.healthWaitingChannel, nil -} - -// checkWaitingTabletHealthiness verifies whether the provided LegacyTabletStats represent the -// tablet that is being waited to become healthy, and notifies the waiting go routine if -// it is the tablet and if it is healthy now. -// The function should be called with shardSwap.allTabletsLock mutex locked. -func (shardSwap *shardSchemaSwap) checkWaitingTabletHealthiness(tabletStats *discovery.LegacyTabletStats) { - if shardSwap.healthWaitingTablet == tabletStats.Key && isTabletHealthy(tabletStats) { - close(*shardSwap.healthWaitingChannel) - shardSwap.healthWaitingChannel = nil - shardSwap.healthWaitingTablet = "" - } -} - -// StatsUpdate is the part of discovery.LegacyHealthCheckStatsListener interface. It makes sure -// that when a change of tablet health happens it's recorded in allTablets list, and if -// this is the tablet that is being waited for after restore, the function wakes up the -// waiting go routine. -func (shardSwap *shardSchemaSwap) StatsUpdate(newTabletStats *discovery.LegacyTabletStats) { - shardSwap.allTabletsLock.Lock() - defer shardSwap.allTabletsLock.Unlock() - - existingStats, found := shardSwap.allTablets[newTabletStats.Key] - if newTabletStats.Up { - if found { - *existingStats = *newTabletStats - } else { - shardSwap.allTablets[newTabletStats.Key] = newTabletStats - } - shardSwap.checkWaitingTabletHealthiness(newTabletStats) - } else { - delete(shardSwap.allTablets, newTabletStats.Key) - } -} - -// getTabletList returns the list of all known tablets in the shard so that the caller -// could operate with it without holding the allTabletsLock. -func (shardSwap *shardSchemaSwap) getTabletList() []discovery.LegacyTabletStats { - shardSwap.allTabletsLock.RLock() - defer shardSwap.allTabletsLock.RUnlock() - - tabletList := make([]discovery.LegacyTabletStats, 0, len(shardSwap.allTablets)) - for _, tabletStats := range shardSwap.allTablets { - tabletList = append(tabletList, *tabletStats) - } - return tabletList -} - -// orderTabletsForSwap is an alias for the slice of LegacyTabletStats. It implements -// sort.Interface interface so that it's possible to sort the array in the order -// in which schema swap will propagate. -type orderTabletsForSwap []discovery.LegacyTabletStats - -// Len is part of sort.Interface interface. -func (array orderTabletsForSwap) Len() int { - return len(array) -} - -// Swap is part of sort.Interface interface. -func (array orderTabletsForSwap) Swap(i, j int) { - array[i], array[j] = array[j], array[i] -} - -// getTabletTypeFromStats returns the tablet type saved in the LegacyTabletStats object. If there is Target -// data in the LegacyTabletStats object then the function returns TabletType from it because it will be more -// up-to-date. But if that's not available then it returns Tablet.Type which will contain data read -// from the topology during initialization of health watchers. -func getTabletTypeFromStats(tabletStats *discovery.LegacyTabletStats) topodatapb.TabletType { - if tabletStats.Target == nil || tabletStats.Target.TabletType == topodatapb.TabletType_UNKNOWN { - return tabletStats.Tablet.Type - } - return tabletStats.Target.TabletType -} - -// tabletSortIndex returns a number representing the order in which schema swap will -// be propagated to the tablet. The last should be the master, then tablets doing -// backup/restore to not interrupt that process, then unhealthy tablets (so that we -// don't wait for them and the new schema is propagated to healthy tablets faster), -// then will go 'replica' tablets, and the first will be 'rdonly' and all other -// non-replica and non-master types. The sorting order within each of those 5 buckets -// doesn't matter. -func tabletSortIndex(tabletStats *discovery.LegacyTabletStats) int { - tabletType := getTabletTypeFromStats(tabletStats) - switch { - case tabletType == topodatapb.TabletType_MASTER: - return 5 - case tabletType == topodatapb.TabletType_BACKUP || tabletType == topodatapb.TabletType_RESTORE: - return 4 - case tabletStats.LastError != nil || tabletStats.Stats == nil || tabletStats.Stats.HealthError != "": - return 3 - case tabletType == topodatapb.TabletType_REPLICA: - return 2 - default: - return 1 - } -} - -// Less is part of sort.Interface interface. It should compare too elements of the array. -func (array orderTabletsForSwap) Less(i, j int) bool { - return tabletSortIndex(&array[i]) < tabletSortIndex(&array[j]) -} - -// executeAdminQuery executes a query on a given tablet as 'allprivs' user. The query is executed -// using timeout value from --schema_swap_admin_query_timeout flag. -func (shardSwap *shardSchemaSwap) executeAdminQuery(tablet *topodatapb.Tablet, query string, maxRows int) (*sqltypes.Result, error) { - sqlCtx, cancelSQLCtx := context.WithTimeout(shardSwap.parent.ctx, *adminQueryTimeout) - defer cancelSQLCtx() - - sqlResultProto, err := shardSwap.parent.tabletClient.ExecuteFetchAsAllPrivs( - sqlCtx, - tablet, - []byte(query), - maxRows, - false /* reloadSchema */) - if err != nil { - return nil, err - } - return sqltypes.Proto3ToResult(sqlResultProto), nil -} - -// isSwapApplied verifies whether the schema swap was already applied to the tablet. It's -// considered to be applied if _vt.local_metadata table has the swap id in the row titled -// 'LastAppliedSchemaSwap'. -func (shardSwap *shardSchemaSwap) isSwapApplied(tablet *topodatapb.Tablet) (bool, error) { - swapIDResult, err := shardSwap.executeAdminQuery( - tablet, - fmt.Sprintf("SELECT value FROM _vt.local_metadata WHERE db_name = '%s' AND name = '%s'", topoproto.TabletDbName(tablet), lastAppliedMetadataName), - 1 /* maxRows */) - if err != nil { - return false, err - } - if len(swapIDResult.Rows) == 0 { - // No such row means we need to apply the swap. - return false, nil - } - swapID, err := evalengine.ToUint64(swapIDResult.Rows[0][0]) - if err != nil { - return false, err - } - return swapID == shardSwap.parent.swapID, nil -} - -// findNextTabletToSwap searches for the next tablet where we need to apply the schema swap. The -// tablets are processed in the order described in tabletSortIndex() function above. If -// it hits any error while searching for the tablet it returns the error to the caller. If the -// only tablet that's left without schema swap applied is the master then the function -// returns the master tablet and errOnlyMasterLeft as the error. When all tablets have schema -// swap applied the function returns nil as the tablet. The function also makes sure that -// values of numTabletsTotal and numTabletsSwapped correctly represent current state of the -// shard (it's convenient to do this in this function because it iterates over all tablets in -// the shard). -func (shardSwap *shardSchemaSwap) findNextTabletToSwap() (*topodatapb.Tablet, error) { - tabletList := shardSwap.getTabletList() - sort.Sort(orderTabletsForSwap(tabletList)) - - shardSwap.numTabletsTotal = len(tabletList) - var numTabletsSwapped int - for _, tabletStats := range tabletList { - tabletType := getTabletTypeFromStats(&tabletStats) - if tabletType == topodatapb.TabletType_BACKUP || tabletType == topodatapb.TabletType_RESTORE { - return nil, fmt.Errorf("tablet %v still has type %v", tabletStats.Tablet.Alias, tabletType) - } - swapApplied, err := shardSwap.isSwapApplied(tabletStats.Tablet) - if err != nil { - return nil, err - } - if swapApplied { - numTabletsSwapped++ - } else { - if numTabletsSwapped > shardSwap.numTabletsSwapped { - // We save the calculated value only if it's bigger than the number - // we actually swapped, because we might not have seen all the tablets - // that have the schema swapped at this point. - shardSwap.numTabletsSwapped = numTabletsSwapped - } - if tabletType == topodatapb.TabletType_MASTER { - return tabletStats.Tablet, errOnlyMasterLeft - } - return tabletStats.Tablet, nil - } - } - shardSwap.numTabletsSwapped = numTabletsSwapped - return nil, nil -} - -// undrainSeedTablet undrains the tablet that was used to apply seed schema change, -// and returns it to the same type as it was before. -func (shardSwap *shardSchemaSwap) undrainSeedTablet(seedTablet *topodatapb.Tablet, tabletType topodatapb.TabletType) error { - _, err := shardSwap.parent.topoServer.UpdateTabletFields(shardSwap.parent.ctx, seedTablet.Alias, - func(tablet *topodatapb.Tablet) error { - delete(tablet.Tags, "drain_reason") - return nil - }) - if err != nil { - // This is not a critical error, we'll just log it. - log.Errorf("Got error trying to set drain_reason on tablet %v: %v", seedTablet.Alias, err) - } - err = shardSwap.parent.tabletClient.ChangeType(shardSwap.parent.ctx, seedTablet, tabletType) - if err != nil { - return err - } - return nil -} - -// applySeedSchemaChange chooses a healthy tablet as a schema swap seed and applies the schema change -// on it. In the choice of the seed tablet any RDONLY tablet is preferred, but if there are no healthy -// RDONLY tablets the REPLICA one is chosen. If there are any non-MASTER tablets indicating that the -// schema swap was already applied on them, then the method assumes that it's the seed tablet from the -// already started process and doesn't try to apply the schema change on any other tablet. -func (shardSwap *shardSchemaSwap) applySeedSchemaChange() (err error) { - shardSwap.markStepInProgress(shardSwap.applySchemaUINode) - defer shardSwap.markStepDone(shardSwap.applySchemaUINode, &err) - - tabletList := shardSwap.getTabletList() - sort.Sort(orderTabletsForSwap(tabletList)) - for _, tabletStats := range tabletList { - swapApplied, err := shardSwap.isSwapApplied(tabletStats.Tablet) - if err != nil { - return err - } - if swapApplied && getTabletTypeFromStats(&tabletStats) != topodatapb.TabletType_MASTER { - return nil - } - } - seedTablet := tabletList[0].Tablet - seedTabletType := getTabletTypeFromStats(&tabletList[0]) - if seedTabletType == topodatapb.TabletType_MASTER { - return fmt.Errorf("the only candidate for a schema swap seed is the master %v, aborting", seedTablet) - } - shardSwap.addShardLog(fmt.Sprintf("Applying schema change on the seed tablet %v", seedTablet.Alias)) - - // Draining the tablet for it to not be used for execution of user queries. - err = shardSwap.parent.tabletClient.ChangeType(shardSwap.parent.ctx, seedTablet, topodatapb.TabletType_DRAINED) - if err != nil { - return err - } - _, err = shardSwap.parent.topoServer.UpdateTabletFields(shardSwap.parent.ctx, seedTablet.Alias, - func(tablet *topodatapb.Tablet) error { - if tablet.Tags == nil { - tablet.Tags = make(map[string]string) - } - tablet.Tags["drain_reason"] = "Drained as online schema swap seed" - return nil - }) - if err != nil { - // This is not a critical error, we'll just log it. - log.Errorf("Got error trying to set drain_reason on tablet %v: %v", seedTablet.Alias, err) - } - - // TODO: Add support for multi-statement schema swaps. - _, err = shardSwap.parent.tabletClient.ExecuteFetchAsDba( - shardSwap.parent.ctx, - seedTablet, - true, /* usePool */ - []byte(shardSwap.parent.sql), - 0, /* maxRows */ - true, /* disableBinlogs */ - true /* reloadSchema */) - if err != nil { - if undrainErr := shardSwap.undrainSeedTablet(seedTablet, seedTabletType); undrainErr != nil { - // We won't return error of undraining because we already have error of SQL execution. - log.Errorf("Got error undraining seed tablet: %v", undrainErr) - } - return err - } - updateAppliedSwapQuery := fmt.Sprintf( - "INSERT INTO _vt.local_metadata (db_name, name, value) VALUES ('%s', '%s', '%d') ON DUPLICATE KEY UPDATE value = '%d'", - topoproto.TabletDbName(seedTablet), lastAppliedMetadataName, shardSwap.parent.swapID, shardSwap.parent.swapID) - _, err = shardSwap.parent.tabletClient.ExecuteFetchAsDba( - shardSwap.parent.ctx, - seedTablet, - true, /* usePool */ - []byte(updateAppliedSwapQuery), - 0, /* maxRows */ - true, /* disableBinlogs */ - false /* reloadSchema */) - if err != nil { - if undrainErr := shardSwap.undrainSeedTablet(seedTablet, seedTabletType); undrainErr != nil { - // We won't return error of undraining because we already have error of SQL execution. - log.Errorf("Got error undraining seed tablet: %v", undrainErr) - } - return err - } - - if err = shardSwap.undrainSeedTablet(seedTablet, seedTabletType); err != nil { - return err - } - - shardSwap.addShardLog("Schema applied on the seed tablet") - return nil -} - -// takeSeedBackup takes backup on the seed tablet. The method assumes that the seed tablet is any tablet that -// has info that schema swap was already applied on it. This way the function can be re-used if the seed backup -// is lost somewhere half way through the schema swap process. -func (shardSwap *shardSchemaSwap) takeSeedBackup() (err error) { - shardSwap.markStepInProgress(shardSwap.backupUINode) - defer shardSwap.markStepDone(shardSwap.backupUINode, &err) - - tabletList := shardSwap.getTabletList() - sort.Sort(orderTabletsForSwap(tabletList)) - var seedTablet *topodatapb.Tablet - for seedTablet == nil { - for _, tabletStats := range tabletList { - swapApplied, err := shardSwap.isSwapApplied(tabletStats.Tablet) - if err != nil { - return err - } - if swapApplied && getTabletTypeFromStats(&tabletStats) != topodatapb.TabletType_MASTER { - seedTablet = tabletStats.Tablet - break - } - } - if seedTablet == nil { - shardSwap.addShardLog("Cannot find the seed tablet to take backup.") - if err := shardSwap.applySeedSchemaChange(); err != nil { - return err - } - } - } - - shardSwap.addShardLog(fmt.Sprintf("Taking backup on the seed tablet %v", seedTablet.Alias)) - eventStream, err := shardSwap.parent.tabletClient.Backup(shardSwap.parent.ctx, seedTablet, *backupConcurrency, false) - if err != nil { - return err - } -waitForBackup: - for { - event, err := eventStream.Recv() - switch err { - case nil: - log.Infof("Backup process on tablet %v: %v", seedTablet.Alias, logutil.EventString(event)) - case io.EOF: - break waitForBackup - default: - return err - } - } - - shardSwap.addShardLog(fmt.Sprintf("Waiting for the seed tablet %v to become healthy", seedTablet.Alias)) - return shardSwap.waitForTabletToBeHealthy(seedTablet) -} - -// swapOnTablet performs the schema swap on the provided tablet and then waits for it -// to become healthy and to catch up with replication. -func (shardSwap *shardSchemaSwap) swapOnTablet(tablet *topodatapb.Tablet) error { - shardSwap.addPropagationLog(fmt.Sprintf("Restoring tablet %v from backup", tablet.Alias)) - eventStream, err := shardSwap.parent.tabletClient.RestoreFromBackup(shardSwap.parent.ctx, tablet) - if err != nil { - return err - } - -waitForRestore: - for { - event, err := eventStream.Recv() - switch err { - case nil: - log.Infof("Restore process on tablet %v: %v", tablet.Alias, logutil.EventString(event)) - case io.EOF: - break waitForRestore - default: - return err - } - } - // Check if the tablet has restored from a backup with schema change applied. - swapApplied, err := shardSwap.isSwapApplied(tablet) - if err != nil { - return err - } - if !swapApplied { - shardSwap.addPropagationLog(fmt.Sprintf("Tablet %v is restored but doesn't have schema swap applied", tablet.Alias)) - return errNoBackupWithSwap - } - - shardSwap.addPropagationLog(fmt.Sprintf("Waiting for tablet %v to become healthy", tablet.Alias)) - return shardSwap.waitForTabletToBeHealthy(tablet) -} - -// waitForTabletToBeHealthy waits until the given tablet becomes healthy and caught up with -// replication. If the tablet is already healthy and caught up when this method is called then -// it returns immediately. -func (shardSwap *shardSchemaSwap) waitForTabletToBeHealthy(tablet *topodatapb.Tablet) error { - waitChannel, err := shardSwap.startWaitingOnUnhealthyTablet(tablet) - if err != nil { - return err - } - if waitChannel != nil { - select { - case <-shardSwap.parent.ctx.Done(): - return shardSwap.parent.ctx.Err() - case <-*waitChannel: - // Tablet has caught up, we can return successfully. - } - } - return nil -} - -// updatePropagationProgressUI updates the progress bar in the workflow UI to reflect appropriate -// percentage in line with how many tablets have schema swapped already. -func (shardSwap *shardSchemaSwap) updatePropagationProgressUI() { - shardSwap.propagationUINode.ProgressMessage = fmt.Sprintf("%v/%v", shardSwap.numTabletsSwapped, shardSwap.numTabletsTotal) - if shardSwap.numTabletsTotal == 0 { - shardSwap.propagationUINode.Progress = 0 - } else { - shardSwap.propagationUINode.Progress = shardSwap.numTabletsSwapped * 100 / shardSwap.numTabletsTotal - } - shardSwap.propagationUINode.BroadcastChanges(false /* updateChildren */) -} - -// markPropagationInProgress marks the propagation step of the shard schema swap workflow as running. -func (shardSwap *shardSchemaSwap) markPropagationInProgress() { - shardSwap.propagationUINode.Message = "" - shardSwap.propagationUINode.State = workflowpb.WorkflowState_Running - shardSwap.propagationUINode.Display = workflow.NodeDisplayDeterminate - shardSwap.propagationUINode.BroadcastChanges(false /* updateChildren */) -} - -// addPropagationLog prints the message to logs, adds it to logs displayed in the UI on the "Propagate to all tablets" -// node and adds the message to the logs displayed on the overall shard node, so that everything happening to this -// shard was visible in one log. -func (shardSwap *shardSchemaSwap) addPropagationLog(message string) { - shardSwap.propagationUILogger.Infof(message) - shardSwap.propagationUINode.Log = shardSwap.propagationUILogger.String() - shardSwap.propagationUINode.Message = message - shardSwap.propagationUINode.BroadcastChanges(false /* updateChildren */) - shardSwap.addShardLog(message) -} - -// markPropagationDone marks the propagation step of the shard schema swap workflow as finished successfully -// or with an error. -func (shardSwap *shardSchemaSwap) markPropagationDone(err *error) { - if *err != nil { - msg := fmt.Sprintf("Error: %v", *err) - shardSwap.addPropagationLog(msg) - shardSwap.propagationUINode.Message = msg - shardSwap.propagationUINode.State = workflowpb.WorkflowState_Done - } else if shardSwap.numTabletsSwapped == shardSwap.numTabletsTotal { - shardSwap.propagationUINode.State = workflowpb.WorkflowState_Done - } - shardSwap.propagationUINode.BroadcastChanges(false /* updateChildren */) -} - -// propagateToNonMasterTablets propagates the schema change to all non-master tablets -// in the shard. When it returns nil it means that only master can remain left with the -// old schema, everything else is verified to have schema swap applied. -func (shardSwap *shardSchemaSwap) propagateToAllTablets(withMasterReparent bool) (err error) { - shardSwap.markPropagationInProgress() - defer shardSwap.markPropagationDone(&err) - - for { - shardSwap.updatePropagationProgressUI() - tablet, err := shardSwap.findNextTabletToSwap() - // Update UI immediately after finding next tablet because the total number of tablets or - // the number of tablets with swapped schema can change in it. - shardSwap.updatePropagationProgressUI() - if err == errOnlyMasterLeft { - if withMasterReparent { - err = shardSwap.reparentFromMaster(tablet) - if err != nil { - return err - } - } else { - return nil - } - } - if err == nil { - if tablet == nil { - shardSwap.propagationUINode.Message = "" - shardSwap.propagationUINode.BroadcastChanges(false /* updateChildren */) - return nil - } - err = shardSwap.swapOnTablet(tablet) - if err == nil { - shardSwap.numTabletsSwapped++ - shardSwap.addPropagationLog(fmt.Sprintf("Schema is successfully swapped on tablet %v.", tablet.Alias)) - continue - } - if err == errNoBackupWithSwap { - if err := shardSwap.takeSeedBackup(); err != nil { - return err - } - continue - } - shardSwap.addPropagationLog(fmt.Sprintf("Error swapping schema on tablet %v: %v", tablet.Alias, err)) - } else { - shardSwap.addPropagationLog(fmt.Sprintf("Error searching for next tablet to swap schema on: %v.", err)) - } - - shardSwap.addPropagationLog(fmt.Sprintf("Sleeping for %v.", *delayBetweenErrors)) - select { - case <-shardSwap.parent.ctx.Done(): - return shardSwap.parent.ctx.Err() - case <-time.After(*delayBetweenErrors): - // Waiting is done going to the next loop. - } - shardSwap.propagationUINode.Message = "" - shardSwap.propagationUINode.BroadcastChanges(false /* updateChildren */) - } -} - -// propagateToMaster propagates the schema change to the master. If the master already has -// the schema change applied then the method does nothing. -func (shardSwap *shardSchemaSwap) reparentFromMaster(masterTablet *topodatapb.Tablet) (err error) { - shardSwap.markStepInProgress(shardSwap.reparentUINode) - defer shardSwap.markStepDone(shardSwap.reparentUINode, &err) - - shardSwap.addShardLog(fmt.Sprintf("Reparenting away from master %v", masterTablet.Alias)) - if *mysqlctl.DisableActiveReparents { - hk := &hook.Hook{ - Name: "reparent_away", - } - hookResult, err := shardSwap.parent.tabletClient.ExecuteHook(shardSwap.parent.ctx, masterTablet, hk) - if err != nil { - return err - } - if hookResult.ExitStatus != hook.HOOK_SUCCESS { - return fmt.Errorf("error executing 'reparent_away' hook: %v", hookResult.String()) - } - } else { - wr := wrangler.New(logutil.NewConsoleLogger(), shardSwap.parent.topoServer, shardSwap.parent.tabletClient) - err = wr.PlannedReparentShard( - shardSwap.parent.ctx, - shardSwap.parent.keyspace, - shardSwap.shardName, - nil, /* masterElectTabletAlias */ - masterTablet.Alias, /* avoidMasterAlias */ - *reparentTimeout) - if err != nil { - return err - } - } - return nil -} diff --git a/go/vt/vtctld/workflow.go b/go/vt/vtctld/workflow.go index f9527409cdb..aaa10d1802d 100644 --- a/go/vt/vtctld/workflow.go +++ b/go/vt/vtctld/workflow.go @@ -25,7 +25,6 @@ import ( "vitess.io/vitess/go/flagutil" "vitess.io/vitess/go/vt/log" - "vitess.io/vitess/go/vt/schemamanager/schemaswap" "vitess.io/vitess/go/vt/servenv" "vitess.io/vitess/go/vt/topo" "vitess.io/vitess/go/vt/vtctl" @@ -55,9 +54,6 @@ func initWorkflowManager(ts *topo.Server) { topovalidator.RegisterShardValidator() topovalidator.Register() - // Register the Schema Swap workflow. - schemaswap.RegisterWorkflowFactory() - // Register the Horizontal Resharding workflow. resharding.Register() From c033d50f4b78f7a1e5178ff6df1e6b66f3f9fa38 Mon Sep 17 00:00:00 2001 From: Sugu Sougoumarane Date: Sat, 2 May 2020 12:39:29 -0700 Subject: [PATCH 4/5] tm revamp: remove unnecessary runHealthCheck ChangeType was invoking a runHealthCheck at the end, but this is unnecessary because the refreshTablet call already runs it. I found it while changing tests that were using the old TER to use the new ChangeType calls. Signed-off-by: Sugu Sougoumarane --- go/vt/vtcombo/tablet_map.go | 2 +- .../tabletmanager/healthcheck_test.go | 7 +++--- go/vt/vttablet/tabletmanager/rpc_actions.go | 4 +--- .../vttablet/tabletmanager/rpc_replication.go | 23 +++---------------- 4 files changed, 8 insertions(+), 28 deletions(-) diff --git a/go/vt/vtcombo/tablet_map.go b/go/vt/vtcombo/tablet_map.go index 0593a51fc9b..cb711f5b80a 100644 --- a/go/vt/vtcombo/tablet_map.go +++ b/go/vt/vtcombo/tablet_map.go @@ -88,7 +88,7 @@ func CreateTablet(ctx context.Context, ts *topo.Server, cell string, uid uint32, } agent := tabletmanager.NewComboActionAgent(ctx, ts, alias, int32(8000+uid), int32(9000+uid), controller, dbcfgs, mysqld, keyspace, shard, dbname, strings.ToLower(initTabletType.String())) if tabletType == topodatapb.TabletType_MASTER { - if err := agent.TabletExternallyReparented(ctx, ""); err != nil { + if err := agent.ChangeType(ctx, topodatapb.TabletType_MASTER); err != nil { return fmt.Errorf("TabletExternallyReparented failed on master %v: %v", topoproto.TabletAliasString(alias), err) } } diff --git a/go/vt/vttablet/tabletmanager/healthcheck_test.go b/go/vt/vttablet/tabletmanager/healthcheck_test.go index 42ddc8452c3..9085f4820e9 100644 --- a/go/vt/vttablet/tabletmanager/healthcheck_test.go +++ b/go/vt/vttablet/tabletmanager/healthcheck_test.go @@ -717,13 +717,12 @@ func TestStateChangeImmediateHealthBroadcast(t *testing.T) { t.Fatal(err) } - // Run TER to turn us into a proper master, wait for it to finish. + // Change to master. agent.HealthReporter.(*fakeHealthCheck).reportReplicationDelay = 19 * time.Second - if err := agent.TabletExternallyReparented(ctx, "unused_id"); err != nil { + if err := agent.ChangeType(ctx, topodatapb.TabletType_MASTER); err != nil { t.Fatalf("TabletExternallyReparented failed: %v", err) } - <-agent.finalizeReparentCtx.Done() - // It is not enough to wait for finalizeReparentCtx to be done, we have to wait for shard_sync to finish + // Wait for shard_sync to finish startTime := time.Now() for { if time.Since(startTime) > 10*time.Second /* timeout */ { diff --git a/go/vt/vttablet/tabletmanager/rpc_actions.go b/go/vt/vttablet/tabletmanager/rpc_actions.go index e4a4ac3a4cf..300baefc164 100644 --- a/go/vt/vttablet/tabletmanager/rpc_actions.go +++ b/go/vt/vttablet/tabletmanager/rpc_actions.go @@ -94,6 +94,7 @@ func (agent *ActionAgent) changeTypeLocked(ctx context.Context, tabletType topod } // let's update our internal state (stop query service and other things) + // refreshTablet will runHealthCheck. if err := agent.refreshTablet(ctx, "ChangeType"); err != nil { return err } @@ -102,9 +103,6 @@ func (agent *ActionAgent) changeTypeLocked(ctx context.Context, tabletType topod if err := agent.fixSemiSyncAndReplication(agent.Tablet().Type); err != nil { return vterrors.Wrap(err, "fixSemiSyncAndReplication failed, may not ack correctly") } - - // and re-run health check - agent.runHealthCheckLocked() return nil } diff --git a/go/vt/vttablet/tabletmanager/rpc_replication.go b/go/vt/vttablet/tabletmanager/rpc_replication.go index 248a0dc9a2c..21e16ec1384 100644 --- a/go/vt/vttablet/tabletmanager/rpc_replication.go +++ b/go/vt/vttablet/tabletmanager/rpc_replication.go @@ -22,17 +22,14 @@ import ( "strings" "time" - "vitess.io/vitess/go/vt/logutil" - "vitess.io/vitess/go/vt/topo" - "vitess.io/vitess/go/vt/topotools" - "vitess.io/vitess/go/vt/vterrors" - "golang.org/x/net/context" "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/mysqlctl" + "vitess.io/vitess/go/vt/topo" "vitess.io/vitess/go/vt/topo/topoproto" + "vitess.io/vitess/go/vt/vterrors" replicationdatapb "vitess.io/vitess/go/vt/proto/replicationdata" topodatapb "vitess.io/vitess/go/vt/proto/topodata" @@ -227,21 +224,7 @@ func (agent *ActionAgent) InitMaster(ctx context.Context) (string, error) { return "", err } - // This section is similar to changeTypeLocked except that we don't - // invoke runHealthCheck. This is because the tabletserver cannot come - // up until the database is created, which happens after the replicas - // are pointed at this new master. - startTime := time.Now() - _, err = topotools.ChangeType(ctx, agent.TopoServer, agent.TabletAlias, topodatapb.TabletType_MASTER, logutil.TimeToProto(startTime)) - if err != nil { - return "", err - } - // We only update agent's masterTermStartTime if we were able to update the topo. - // This ensures that in case of a failure, we are never in a situation where the - // tablet's timestamp is ahead of the topo's timestamp. - agent.setMasterTermStartTime(startTime) - // and refresh our state - if err := agent.refreshTablet(ctx, "InitMaster"); err != nil { + if err := agent.changeTypeLocked(ctx, topodatapb.TabletType_MASTER); err != nil { return "", err } return mysql.EncodePosition(pos), nil From 740c92de4fdce0dfbf98186111f19a64ba0c16d6 Mon Sep 17 00:00:00 2001 From: Sugu Sougoumarane Date: Tue, 2 Jun 2020 13:52:59 -0700 Subject: [PATCH 5/5] tm revamp: address review comments Signed-off-by: Sugu Sougoumarane --- go/vt/vttablet/tabletmanager/rpc_actions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/vt/vttablet/tabletmanager/rpc_actions.go b/go/vt/vttablet/tabletmanager/rpc_actions.go index 300baefc164..b6d88215628 100644 --- a/go/vt/vttablet/tabletmanager/rpc_actions.go +++ b/go/vt/vttablet/tabletmanager/rpc_actions.go @@ -94,7 +94,7 @@ func (agent *ActionAgent) changeTypeLocked(ctx context.Context, tabletType topod } // let's update our internal state (stop query service and other things) - // refreshTablet will runHealthCheck. + // refreshTablet will invoke broadcastHealth if needed. if err := agent.refreshTablet(ctx, "ChangeType"); err != nil { return err }