From d7f45366089c7c44fcff884fe99ccc8f82a89acc Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Sun, 16 Jul 2023 16:21:14 +0300 Subject: [PATCH 01/15] proto: support for CheckThrottler, CheckThrottlerRequest, CheckThrottlerResponse Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- .../tabletmanagerdata/tabletmanagerdata.pb.go | 283 ++++++++-- .../tabletmanagerdata_vtproto.pb.go | 419 ++++++++++++++ .../tabletmanagerservice.pb.go | 219 ++++---- .../tabletmanagerservice_grpc.pb.go | 38 ++ proto/tabletmanagerdata.proto | 20 + proto/tabletmanagerservice.proto | 2 + web/vtadmin/src/proto/vtadmin.d.ts | 224 ++++++++ web/vtadmin/src/proto/vtadmin.js | 522 ++++++++++++++++++ 8 files changed, 1573 insertions(+), 154 deletions(-) diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go index 1af62590644..ec5daf2ddd7 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go @@ -5364,6 +5364,147 @@ func (*ResetSequencesResponse) Descriptor() ([]byte, []int) { return file_tabletmanagerdata_proto_rawDescGZIP(), []int{105} } +type CheckThrottlerRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + AppName string `protobuf:"bytes,1,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` +} + +func (x *CheckThrottlerRequest) Reset() { + *x = CheckThrottlerRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_tabletmanagerdata_proto_msgTypes[106] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CheckThrottlerRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckThrottlerRequest) ProtoMessage() {} + +func (x *CheckThrottlerRequest) ProtoReflect() protoreflect.Message { + mi := &file_tabletmanagerdata_proto_msgTypes[106] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckThrottlerRequest.ProtoReflect.Descriptor instead. +func (*CheckThrottlerRequest) Descriptor() ([]byte, []int) { + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{106} +} + +func (x *CheckThrottlerRequest) GetAppName() string { + if x != nil { + return x.AppName + } + return "" +} + +type CheckThrottlerResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // StatusCode is HTTP compliant response code (e.g. 200 for OK) + StatusCode int32 `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` + // Value is the metric value collected by the tablet + Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` + // Threshold is the throttling threshold the table was comparing the value with + Threshold float64 `protobuf:"fixed64,3,opt,name=threshold,proto3" json:"threshold,omitempty"` + // Error indicates an error retrieving the value + Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` + // Message + Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` + // RecentlyChecked indicates that the tablet has been hit with a user-facing check, which can then imply + // that heartbeats lease should be renwed. + RecentlyChecked bool `protobuf:"varint,6,opt,name=recently_checked,json=recentlyChecked,proto3" json:"recently_checked,omitempty"` +} + +func (x *CheckThrottlerResponse) Reset() { + *x = CheckThrottlerResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_tabletmanagerdata_proto_msgTypes[107] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CheckThrottlerResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CheckThrottlerResponse) ProtoMessage() {} + +func (x *CheckThrottlerResponse) ProtoReflect() protoreflect.Message { + mi := &file_tabletmanagerdata_proto_msgTypes[107] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CheckThrottlerResponse.ProtoReflect.Descriptor instead. +func (*CheckThrottlerResponse) Descriptor() ([]byte, []int) { + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{107} +} + +func (x *CheckThrottlerResponse) GetStatusCode() int32 { + if x != nil { + return x.StatusCode + } + return 0 +} + +func (x *CheckThrottlerResponse) GetValue() float64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *CheckThrottlerResponse) GetThreshold() float64 { + if x != nil { + return x.Threshold + } + return 0 +} + +func (x *CheckThrottlerResponse) GetError() string { + if x != nil { + return x.Error + } + return "" +} + +func (x *CheckThrottlerResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *CheckThrottlerResponse) GetRecentlyChecked() bool { + if x != nil { + return x.RecentlyChecked + } + return false +} + var File_tabletmanagerdata_proto protoreflect.FileDescriptor var file_tabletmanagerdata_proto_rawDesc = []byte{ @@ -5922,11 +6063,27 @@ var file_tabletmanagerdata_proto_rawDesc = []byte{ 0x75, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x22, 0x18, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x65, 0x74, 0x53, 0x65, - 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, - 0x30, 0x5a, 0x2e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x69, 0x74, - 0x65, 0x73, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, - 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x32, 0x0a, 0x15, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, + 0x61, 0x6d, 0x65, 0x22, 0xc8, 0x01, 0x0a, 0x16, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x68, 0x72, + 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, + 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, + 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x5f, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x72, + 0x65, 0x63, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x42, 0x30, + 0x5a, 0x2e, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x69, 0x74, 0x65, + 0x73, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -5941,7 +6098,7 @@ func file_tabletmanagerdata_proto_rawDescGZIP() []byte { return file_tabletmanagerdata_proto_rawDescData } -var file_tabletmanagerdata_proto_msgTypes = make([]protoimpl.MessageInfo, 109) +var file_tabletmanagerdata_proto_msgTypes = make([]protoimpl.MessageInfo, 111) var file_tabletmanagerdata_proto_goTypes = []interface{}{ (*TableDefinition)(nil), // 0: tabletmanagerdata.TableDefinition (*SchemaDefinition)(nil), // 1: tabletmanagerdata.SchemaDefinition @@ -6049,67 +6206,69 @@ var file_tabletmanagerdata_proto_goTypes = []interface{}{ (*UpdateVRWorkflowResponse)(nil), // 103: tabletmanagerdata.UpdateVRWorkflowResponse (*ResetSequencesRequest)(nil), // 104: tabletmanagerdata.ResetSequencesRequest (*ResetSequencesResponse)(nil), // 105: tabletmanagerdata.ResetSequencesResponse - nil, // 106: tabletmanagerdata.UserPermission.PrivilegesEntry - nil, // 107: tabletmanagerdata.DbPermission.PrivilegesEntry - nil, // 108: tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry - (*query.Field)(nil), // 109: query.Field - (topodata.TabletType)(0), // 110: topodata.TabletType - (*vtrpc.CallerID)(nil), // 111: vtrpc.CallerID - (*query.QueryResult)(nil), // 112: query.QueryResult - (*replicationdata.Status)(nil), // 113: replicationdata.Status - (*replicationdata.PrimaryStatus)(nil), // 114: replicationdata.PrimaryStatus - (*topodata.TabletAlias)(nil), // 115: topodata.TabletAlias - (*replicationdata.FullStatus)(nil), // 116: replicationdata.FullStatus - (replicationdata.StopReplicationMode)(0), // 117: replicationdata.StopReplicationMode - (*replicationdata.StopReplicationStatus)(nil), // 118: replicationdata.StopReplicationStatus - (*logutil.Event)(nil), // 119: logutil.Event - (*vttime.Time)(nil), // 120: vttime.Time - (binlogdata.OnDDLAction)(0), // 121: binlogdata.OnDDLAction + (*CheckThrottlerRequest)(nil), // 106: tabletmanagerdata.CheckThrottlerRequest + (*CheckThrottlerResponse)(nil), // 107: tabletmanagerdata.CheckThrottlerResponse + nil, // 108: tabletmanagerdata.UserPermission.PrivilegesEntry + nil, // 109: tabletmanagerdata.DbPermission.PrivilegesEntry + nil, // 110: tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry + (*query.Field)(nil), // 111: query.Field + (topodata.TabletType)(0), // 112: topodata.TabletType + (*vtrpc.CallerID)(nil), // 113: vtrpc.CallerID + (*query.QueryResult)(nil), // 114: query.QueryResult + (*replicationdata.Status)(nil), // 115: replicationdata.Status + (*replicationdata.PrimaryStatus)(nil), // 116: replicationdata.PrimaryStatus + (*topodata.TabletAlias)(nil), // 117: topodata.TabletAlias + (*replicationdata.FullStatus)(nil), // 118: replicationdata.FullStatus + (replicationdata.StopReplicationMode)(0), // 119: replicationdata.StopReplicationMode + (*replicationdata.StopReplicationStatus)(nil), // 120: replicationdata.StopReplicationStatus + (*logutil.Event)(nil), // 121: logutil.Event + (*vttime.Time)(nil), // 122: vttime.Time + (binlogdata.OnDDLAction)(0), // 123: binlogdata.OnDDLAction } var file_tabletmanagerdata_proto_depIdxs = []int32{ - 109, // 0: tabletmanagerdata.TableDefinition.fields:type_name -> query.Field + 111, // 0: tabletmanagerdata.TableDefinition.fields:type_name -> query.Field 0, // 1: tabletmanagerdata.SchemaDefinition.table_definitions:type_name -> tabletmanagerdata.TableDefinition 1, // 2: tabletmanagerdata.SchemaChangeResult.before_schema:type_name -> tabletmanagerdata.SchemaDefinition 1, // 3: tabletmanagerdata.SchemaChangeResult.after_schema:type_name -> tabletmanagerdata.SchemaDefinition - 106, // 4: tabletmanagerdata.UserPermission.privileges:type_name -> tabletmanagerdata.UserPermission.PrivilegesEntry - 107, // 5: tabletmanagerdata.DbPermission.privileges:type_name -> tabletmanagerdata.DbPermission.PrivilegesEntry + 108, // 4: tabletmanagerdata.UserPermission.privileges:type_name -> tabletmanagerdata.UserPermission.PrivilegesEntry + 109, // 5: tabletmanagerdata.DbPermission.privileges:type_name -> tabletmanagerdata.DbPermission.PrivilegesEntry 3, // 6: tabletmanagerdata.Permissions.user_permissions:type_name -> tabletmanagerdata.UserPermission 4, // 7: tabletmanagerdata.Permissions.db_permissions:type_name -> tabletmanagerdata.DbPermission - 108, // 8: tabletmanagerdata.ExecuteHookRequest.extra_env:type_name -> tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry + 110, // 8: tabletmanagerdata.ExecuteHookRequest.extra_env:type_name -> tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry 1, // 9: tabletmanagerdata.GetSchemaResponse.schema_definition:type_name -> tabletmanagerdata.SchemaDefinition 5, // 10: tabletmanagerdata.GetPermissionsResponse.permissions:type_name -> tabletmanagerdata.Permissions - 110, // 11: tabletmanagerdata.ChangeTypeRequest.tablet_type:type_name -> topodata.TabletType + 112, // 11: tabletmanagerdata.ChangeTypeRequest.tablet_type:type_name -> topodata.TabletType 2, // 12: tabletmanagerdata.PreflightSchemaResponse.change_results:type_name -> tabletmanagerdata.SchemaChangeResult 1, // 13: tabletmanagerdata.ApplySchemaRequest.before_schema:type_name -> tabletmanagerdata.SchemaDefinition 1, // 14: tabletmanagerdata.ApplySchemaRequest.after_schema:type_name -> tabletmanagerdata.SchemaDefinition 1, // 15: tabletmanagerdata.ApplySchemaResponse.before_schema:type_name -> tabletmanagerdata.SchemaDefinition 1, // 16: tabletmanagerdata.ApplySchemaResponse.after_schema:type_name -> tabletmanagerdata.SchemaDefinition - 111, // 17: tabletmanagerdata.ExecuteQueryRequest.caller_id:type_name -> vtrpc.CallerID - 112, // 18: tabletmanagerdata.ExecuteQueryResponse.result:type_name -> query.QueryResult - 112, // 19: tabletmanagerdata.ExecuteFetchAsDbaResponse.result:type_name -> query.QueryResult - 112, // 20: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse.result:type_name -> query.QueryResult - 112, // 21: tabletmanagerdata.ExecuteFetchAsAppResponse.result:type_name -> query.QueryResult - 113, // 22: tabletmanagerdata.ReplicationStatusResponse.status:type_name -> replicationdata.Status - 114, // 23: tabletmanagerdata.PrimaryStatusResponse.status:type_name -> replicationdata.PrimaryStatus - 112, // 24: tabletmanagerdata.VReplicationExecResponse.result:type_name -> query.QueryResult - 115, // 25: tabletmanagerdata.PopulateReparentJournalRequest.primary_alias:type_name -> topodata.TabletAlias - 115, // 26: tabletmanagerdata.InitReplicaRequest.parent:type_name -> topodata.TabletAlias - 114, // 27: tabletmanagerdata.DemotePrimaryResponse.primary_status:type_name -> replicationdata.PrimaryStatus - 116, // 28: tabletmanagerdata.FullStatusResponse.status:type_name -> replicationdata.FullStatus - 115, // 29: tabletmanagerdata.SetReplicationSourceRequest.parent:type_name -> topodata.TabletAlias - 115, // 30: tabletmanagerdata.ReplicaWasRestartedRequest.parent:type_name -> topodata.TabletAlias - 117, // 31: tabletmanagerdata.StopReplicationAndGetStatusRequest.stop_replication_mode:type_name -> replicationdata.StopReplicationMode - 118, // 32: tabletmanagerdata.StopReplicationAndGetStatusResponse.status:type_name -> replicationdata.StopReplicationStatus - 119, // 33: tabletmanagerdata.BackupResponse.event:type_name -> logutil.Event - 120, // 34: tabletmanagerdata.RestoreFromBackupRequest.backup_time:type_name -> vttime.Time - 119, // 35: tabletmanagerdata.RestoreFromBackupResponse.event:type_name -> logutil.Event + 113, // 17: tabletmanagerdata.ExecuteQueryRequest.caller_id:type_name -> vtrpc.CallerID + 114, // 18: tabletmanagerdata.ExecuteQueryResponse.result:type_name -> query.QueryResult + 114, // 19: tabletmanagerdata.ExecuteFetchAsDbaResponse.result:type_name -> query.QueryResult + 114, // 20: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse.result:type_name -> query.QueryResult + 114, // 21: tabletmanagerdata.ExecuteFetchAsAppResponse.result:type_name -> query.QueryResult + 115, // 22: tabletmanagerdata.ReplicationStatusResponse.status:type_name -> replicationdata.Status + 116, // 23: tabletmanagerdata.PrimaryStatusResponse.status:type_name -> replicationdata.PrimaryStatus + 114, // 24: tabletmanagerdata.VReplicationExecResponse.result:type_name -> query.QueryResult + 117, // 25: tabletmanagerdata.PopulateReparentJournalRequest.primary_alias:type_name -> topodata.TabletAlias + 117, // 26: tabletmanagerdata.InitReplicaRequest.parent:type_name -> topodata.TabletAlias + 116, // 27: tabletmanagerdata.DemotePrimaryResponse.primary_status:type_name -> replicationdata.PrimaryStatus + 118, // 28: tabletmanagerdata.FullStatusResponse.status:type_name -> replicationdata.FullStatus + 117, // 29: tabletmanagerdata.SetReplicationSourceRequest.parent:type_name -> topodata.TabletAlias + 117, // 30: tabletmanagerdata.ReplicaWasRestartedRequest.parent:type_name -> topodata.TabletAlias + 119, // 31: tabletmanagerdata.StopReplicationAndGetStatusRequest.stop_replication_mode:type_name -> replicationdata.StopReplicationMode + 120, // 32: tabletmanagerdata.StopReplicationAndGetStatusResponse.status:type_name -> replicationdata.StopReplicationStatus + 121, // 33: tabletmanagerdata.BackupResponse.event:type_name -> logutil.Event + 122, // 34: tabletmanagerdata.RestoreFromBackupRequest.backup_time:type_name -> vttime.Time + 121, // 35: tabletmanagerdata.RestoreFromBackupResponse.event:type_name -> logutil.Event 101, // 36: tabletmanagerdata.VDiffRequest.options:type_name -> tabletmanagerdata.VDiffOptions - 112, // 37: tabletmanagerdata.VDiffResponse.output:type_name -> query.QueryResult + 114, // 37: tabletmanagerdata.VDiffResponse.output:type_name -> query.QueryResult 98, // 38: tabletmanagerdata.VDiffOptions.picker_options:type_name -> tabletmanagerdata.VDiffPickerOptions 100, // 39: tabletmanagerdata.VDiffOptions.core_options:type_name -> tabletmanagerdata.VDiffCoreOptions 99, // 40: tabletmanagerdata.VDiffOptions.report_options:type_name -> tabletmanagerdata.VDiffReportOptions - 121, // 41: tabletmanagerdata.UpdateVRWorkflowRequest.on_ddl:type_name -> binlogdata.OnDDLAction - 112, // 42: tabletmanagerdata.UpdateVRWorkflowResponse.result:type_name -> query.QueryResult + 123, // 41: tabletmanagerdata.UpdateVRWorkflowRequest.on_ddl:type_name -> binlogdata.OnDDLAction + 114, // 42: tabletmanagerdata.UpdateVRWorkflowResponse.result:type_name -> query.QueryResult 43, // [43:43] is the sub-list for method output_type 43, // [43:43] is the sub-list for method input_type 43, // [43:43] is the sub-list for extension type_name @@ -7395,6 +7554,30 @@ func file_tabletmanagerdata_proto_init() { return nil } } + file_tabletmanagerdata_proto_msgTypes[106].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckThrottlerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tabletmanagerdata_proto_msgTypes[107].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckThrottlerResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -7402,7 +7585,7 @@ func file_tabletmanagerdata_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_tabletmanagerdata_proto_rawDesc, NumEnums: 0, - NumMessages: 109, + NumMessages: 111, NumExtensions: 0, NumServices: 0, }, diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go index 692459c6f94..0aaebfe2545 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go @@ -5,9 +5,11 @@ package tabletmanagerdata import ( + binary "encoding/binary" fmt "fmt" protoimpl "google.golang.org/protobuf/runtime/protoimpl" io "io" + math "math" bits "math/bits" binlogdata "vitess.io/vitess/go/vt/proto/binlogdata" logutil "vitess.io/vitess/go/vt/proto/logutil" @@ -4757,6 +4759,120 @@ func (m *ResetSequencesResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *CheckThrottlerRequest) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CheckThrottlerRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *CheckThrottlerRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.AppName) > 0 { + i -= len(m.AppName) + copy(dAtA[i:], m.AppName) + i = encodeVarint(dAtA, i, uint64(len(m.AppName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CheckThrottlerResponse) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CheckThrottlerResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *CheckThrottlerResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.RecentlyChecked { + i-- + if m.RecentlyChecked { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = encodeVarint(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0x2a + } + if len(m.Error) > 0 { + i -= len(m.Error) + copy(dAtA[i:], m.Error) + i = encodeVarint(dAtA, i, uint64(len(m.Error))) + i-- + dAtA[i] = 0x22 + } + if m.Threshold != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Threshold)))) + i-- + dAtA[i] = 0x19 + } + if m.Value != 0 { + i -= 8 + binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) + i-- + dAtA[i] = 0x11 + } + if m.StatusCode != 0 { + i = encodeVarint(dAtA, i, uint64(m.StatusCode)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarint(dAtA []byte, offset int, v uint64) int { offset -= sov(v) base := offset @@ -6415,6 +6531,50 @@ func (m *ResetSequencesResponse) SizeVT() (n int) { return n } +func (m *CheckThrottlerRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AppName) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *CheckThrottlerResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.StatusCode != 0 { + n += 1 + sov(uint64(m.StatusCode)) + } + if m.Value != 0 { + n += 9 + } + if m.Threshold != 0 { + n += 9 + } + l = len(m.Error) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.RecentlyChecked { + n += 2 + } + n += len(m.unknownFields) + return n +} + func sov(x uint64) (n int) { return (bits.Len64(x|1) + 6) / 7 } @@ -16406,6 +16566,265 @@ func (m *ResetSequencesResponse) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *CheckThrottlerRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CheckThrottlerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CheckThrottlerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AppName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AppName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CheckThrottlerResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CheckThrottlerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CheckThrottlerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StatusCode", wireType) + } + m.StatusCode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StatusCode |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Value = float64(math.Float64frombits(v)) + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Threshold", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Threshold = float64(math.Float64frombits(v)) + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Error = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RecentlyChecked", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.RecentlyChecked = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skip(dAtA []byte) (n int, err error) { l := len(dAtA) diff --git a/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go b/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go index e42173ae84b..38e807c4460 100644 --- a/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go +++ b/go/vt/proto/tabletmanagerservice/tabletmanagerservice.pb.go @@ -45,7 +45,7 @@ var file_tabletmanagerservice_proto_rawDesc = []byte{ 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x1a, 0x17, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x9e, 0x28, 0x0a, 0x0d, + 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x32, 0x87, 0x29, 0x0a, 0x0d, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x12, 0x49, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x1e, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, @@ -367,11 +367,18 @@ var file_tabletmanagerservice_proto_rawDesc = []byte{ 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x42, 0x33, 0x5a, 0x31, - 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, - 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x67, 0x0a, 0x0e, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x12, 0x28, + 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x33, 0x5a, 0x31, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2e, + 0x69, 0x6f, 0x2f, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x74, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var file_tabletmanagerservice_proto_goTypes = []interface{}{ @@ -423,54 +430,56 @@ var file_tabletmanagerservice_proto_goTypes = []interface{}{ (*tabletmanagerdata.PromoteReplicaRequest)(nil), // 45: tabletmanagerdata.PromoteReplicaRequest (*tabletmanagerdata.BackupRequest)(nil), // 46: tabletmanagerdata.BackupRequest (*tabletmanagerdata.RestoreFromBackupRequest)(nil), // 47: tabletmanagerdata.RestoreFromBackupRequest - (*tabletmanagerdata.PingResponse)(nil), // 48: tabletmanagerdata.PingResponse - (*tabletmanagerdata.SleepResponse)(nil), // 49: tabletmanagerdata.SleepResponse - (*tabletmanagerdata.ExecuteHookResponse)(nil), // 50: tabletmanagerdata.ExecuteHookResponse - (*tabletmanagerdata.GetSchemaResponse)(nil), // 51: tabletmanagerdata.GetSchemaResponse - (*tabletmanagerdata.GetPermissionsResponse)(nil), // 52: tabletmanagerdata.GetPermissionsResponse - (*tabletmanagerdata.SetReadOnlyResponse)(nil), // 53: tabletmanagerdata.SetReadOnlyResponse - (*tabletmanagerdata.SetReadWriteResponse)(nil), // 54: tabletmanagerdata.SetReadWriteResponse - (*tabletmanagerdata.ChangeTypeResponse)(nil), // 55: tabletmanagerdata.ChangeTypeResponse - (*tabletmanagerdata.RefreshStateResponse)(nil), // 56: tabletmanagerdata.RefreshStateResponse - (*tabletmanagerdata.RunHealthCheckResponse)(nil), // 57: tabletmanagerdata.RunHealthCheckResponse - (*tabletmanagerdata.ReloadSchemaResponse)(nil), // 58: tabletmanagerdata.ReloadSchemaResponse - (*tabletmanagerdata.PreflightSchemaResponse)(nil), // 59: tabletmanagerdata.PreflightSchemaResponse - (*tabletmanagerdata.ApplySchemaResponse)(nil), // 60: tabletmanagerdata.ApplySchemaResponse - (*tabletmanagerdata.ResetSequencesResponse)(nil), // 61: tabletmanagerdata.ResetSequencesResponse - (*tabletmanagerdata.LockTablesResponse)(nil), // 62: tabletmanagerdata.LockTablesResponse - (*tabletmanagerdata.UnlockTablesResponse)(nil), // 63: tabletmanagerdata.UnlockTablesResponse - (*tabletmanagerdata.ExecuteQueryResponse)(nil), // 64: tabletmanagerdata.ExecuteQueryResponse - (*tabletmanagerdata.ExecuteFetchAsDbaResponse)(nil), // 65: tabletmanagerdata.ExecuteFetchAsDbaResponse - (*tabletmanagerdata.ExecuteFetchAsAllPrivsResponse)(nil), // 66: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse - (*tabletmanagerdata.ExecuteFetchAsAppResponse)(nil), // 67: tabletmanagerdata.ExecuteFetchAsAppResponse - (*tabletmanagerdata.ReplicationStatusResponse)(nil), // 68: tabletmanagerdata.ReplicationStatusResponse - (*tabletmanagerdata.PrimaryStatusResponse)(nil), // 69: tabletmanagerdata.PrimaryStatusResponse - (*tabletmanagerdata.PrimaryPositionResponse)(nil), // 70: tabletmanagerdata.PrimaryPositionResponse - (*tabletmanagerdata.WaitForPositionResponse)(nil), // 71: tabletmanagerdata.WaitForPositionResponse - (*tabletmanagerdata.StopReplicationResponse)(nil), // 72: tabletmanagerdata.StopReplicationResponse - (*tabletmanagerdata.StopReplicationMinimumResponse)(nil), // 73: tabletmanagerdata.StopReplicationMinimumResponse - (*tabletmanagerdata.StartReplicationResponse)(nil), // 74: tabletmanagerdata.StartReplicationResponse - (*tabletmanagerdata.StartReplicationUntilAfterResponse)(nil), // 75: tabletmanagerdata.StartReplicationUntilAfterResponse - (*tabletmanagerdata.GetReplicasResponse)(nil), // 76: tabletmanagerdata.GetReplicasResponse - (*tabletmanagerdata.VReplicationExecResponse)(nil), // 77: tabletmanagerdata.VReplicationExecResponse - (*tabletmanagerdata.VReplicationWaitForPosResponse)(nil), // 78: tabletmanagerdata.VReplicationWaitForPosResponse - (*tabletmanagerdata.UpdateVRWorkflowResponse)(nil), // 79: tabletmanagerdata.UpdateVRWorkflowResponse - (*tabletmanagerdata.VDiffResponse)(nil), // 80: tabletmanagerdata.VDiffResponse - (*tabletmanagerdata.ResetReplicationResponse)(nil), // 81: tabletmanagerdata.ResetReplicationResponse - (*tabletmanagerdata.InitPrimaryResponse)(nil), // 82: tabletmanagerdata.InitPrimaryResponse - (*tabletmanagerdata.PopulateReparentJournalResponse)(nil), // 83: tabletmanagerdata.PopulateReparentJournalResponse - (*tabletmanagerdata.InitReplicaResponse)(nil), // 84: tabletmanagerdata.InitReplicaResponse - (*tabletmanagerdata.DemotePrimaryResponse)(nil), // 85: tabletmanagerdata.DemotePrimaryResponse - (*tabletmanagerdata.UndoDemotePrimaryResponse)(nil), // 86: tabletmanagerdata.UndoDemotePrimaryResponse - (*tabletmanagerdata.ReplicaWasPromotedResponse)(nil), // 87: tabletmanagerdata.ReplicaWasPromotedResponse - (*tabletmanagerdata.ResetReplicationParametersResponse)(nil), // 88: tabletmanagerdata.ResetReplicationParametersResponse - (*tabletmanagerdata.FullStatusResponse)(nil), // 89: tabletmanagerdata.FullStatusResponse - (*tabletmanagerdata.SetReplicationSourceResponse)(nil), // 90: tabletmanagerdata.SetReplicationSourceResponse - (*tabletmanagerdata.ReplicaWasRestartedResponse)(nil), // 91: tabletmanagerdata.ReplicaWasRestartedResponse - (*tabletmanagerdata.StopReplicationAndGetStatusResponse)(nil), // 92: tabletmanagerdata.StopReplicationAndGetStatusResponse - (*tabletmanagerdata.PromoteReplicaResponse)(nil), // 93: tabletmanagerdata.PromoteReplicaResponse - (*tabletmanagerdata.BackupResponse)(nil), // 94: tabletmanagerdata.BackupResponse - (*tabletmanagerdata.RestoreFromBackupResponse)(nil), // 95: tabletmanagerdata.RestoreFromBackupResponse + (*tabletmanagerdata.CheckThrottlerRequest)(nil), // 48: tabletmanagerdata.CheckThrottlerRequest + (*tabletmanagerdata.PingResponse)(nil), // 49: tabletmanagerdata.PingResponse + (*tabletmanagerdata.SleepResponse)(nil), // 50: tabletmanagerdata.SleepResponse + (*tabletmanagerdata.ExecuteHookResponse)(nil), // 51: tabletmanagerdata.ExecuteHookResponse + (*tabletmanagerdata.GetSchemaResponse)(nil), // 52: tabletmanagerdata.GetSchemaResponse + (*tabletmanagerdata.GetPermissionsResponse)(nil), // 53: tabletmanagerdata.GetPermissionsResponse + (*tabletmanagerdata.SetReadOnlyResponse)(nil), // 54: tabletmanagerdata.SetReadOnlyResponse + (*tabletmanagerdata.SetReadWriteResponse)(nil), // 55: tabletmanagerdata.SetReadWriteResponse + (*tabletmanagerdata.ChangeTypeResponse)(nil), // 56: tabletmanagerdata.ChangeTypeResponse + (*tabletmanagerdata.RefreshStateResponse)(nil), // 57: tabletmanagerdata.RefreshStateResponse + (*tabletmanagerdata.RunHealthCheckResponse)(nil), // 58: tabletmanagerdata.RunHealthCheckResponse + (*tabletmanagerdata.ReloadSchemaResponse)(nil), // 59: tabletmanagerdata.ReloadSchemaResponse + (*tabletmanagerdata.PreflightSchemaResponse)(nil), // 60: tabletmanagerdata.PreflightSchemaResponse + (*tabletmanagerdata.ApplySchemaResponse)(nil), // 61: tabletmanagerdata.ApplySchemaResponse + (*tabletmanagerdata.ResetSequencesResponse)(nil), // 62: tabletmanagerdata.ResetSequencesResponse + (*tabletmanagerdata.LockTablesResponse)(nil), // 63: tabletmanagerdata.LockTablesResponse + (*tabletmanagerdata.UnlockTablesResponse)(nil), // 64: tabletmanagerdata.UnlockTablesResponse + (*tabletmanagerdata.ExecuteQueryResponse)(nil), // 65: tabletmanagerdata.ExecuteQueryResponse + (*tabletmanagerdata.ExecuteFetchAsDbaResponse)(nil), // 66: tabletmanagerdata.ExecuteFetchAsDbaResponse + (*tabletmanagerdata.ExecuteFetchAsAllPrivsResponse)(nil), // 67: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse + (*tabletmanagerdata.ExecuteFetchAsAppResponse)(nil), // 68: tabletmanagerdata.ExecuteFetchAsAppResponse + (*tabletmanagerdata.ReplicationStatusResponse)(nil), // 69: tabletmanagerdata.ReplicationStatusResponse + (*tabletmanagerdata.PrimaryStatusResponse)(nil), // 70: tabletmanagerdata.PrimaryStatusResponse + (*tabletmanagerdata.PrimaryPositionResponse)(nil), // 71: tabletmanagerdata.PrimaryPositionResponse + (*tabletmanagerdata.WaitForPositionResponse)(nil), // 72: tabletmanagerdata.WaitForPositionResponse + (*tabletmanagerdata.StopReplicationResponse)(nil), // 73: tabletmanagerdata.StopReplicationResponse + (*tabletmanagerdata.StopReplicationMinimumResponse)(nil), // 74: tabletmanagerdata.StopReplicationMinimumResponse + (*tabletmanagerdata.StartReplicationResponse)(nil), // 75: tabletmanagerdata.StartReplicationResponse + (*tabletmanagerdata.StartReplicationUntilAfterResponse)(nil), // 76: tabletmanagerdata.StartReplicationUntilAfterResponse + (*tabletmanagerdata.GetReplicasResponse)(nil), // 77: tabletmanagerdata.GetReplicasResponse + (*tabletmanagerdata.VReplicationExecResponse)(nil), // 78: tabletmanagerdata.VReplicationExecResponse + (*tabletmanagerdata.VReplicationWaitForPosResponse)(nil), // 79: tabletmanagerdata.VReplicationWaitForPosResponse + (*tabletmanagerdata.UpdateVRWorkflowResponse)(nil), // 80: tabletmanagerdata.UpdateVRWorkflowResponse + (*tabletmanagerdata.VDiffResponse)(nil), // 81: tabletmanagerdata.VDiffResponse + (*tabletmanagerdata.ResetReplicationResponse)(nil), // 82: tabletmanagerdata.ResetReplicationResponse + (*tabletmanagerdata.InitPrimaryResponse)(nil), // 83: tabletmanagerdata.InitPrimaryResponse + (*tabletmanagerdata.PopulateReparentJournalResponse)(nil), // 84: tabletmanagerdata.PopulateReparentJournalResponse + (*tabletmanagerdata.InitReplicaResponse)(nil), // 85: tabletmanagerdata.InitReplicaResponse + (*tabletmanagerdata.DemotePrimaryResponse)(nil), // 86: tabletmanagerdata.DemotePrimaryResponse + (*tabletmanagerdata.UndoDemotePrimaryResponse)(nil), // 87: tabletmanagerdata.UndoDemotePrimaryResponse + (*tabletmanagerdata.ReplicaWasPromotedResponse)(nil), // 88: tabletmanagerdata.ReplicaWasPromotedResponse + (*tabletmanagerdata.ResetReplicationParametersResponse)(nil), // 89: tabletmanagerdata.ResetReplicationParametersResponse + (*tabletmanagerdata.FullStatusResponse)(nil), // 90: tabletmanagerdata.FullStatusResponse + (*tabletmanagerdata.SetReplicationSourceResponse)(nil), // 91: tabletmanagerdata.SetReplicationSourceResponse + (*tabletmanagerdata.ReplicaWasRestartedResponse)(nil), // 92: tabletmanagerdata.ReplicaWasRestartedResponse + (*tabletmanagerdata.StopReplicationAndGetStatusResponse)(nil), // 93: tabletmanagerdata.StopReplicationAndGetStatusResponse + (*tabletmanagerdata.PromoteReplicaResponse)(nil), // 94: tabletmanagerdata.PromoteReplicaResponse + (*tabletmanagerdata.BackupResponse)(nil), // 95: tabletmanagerdata.BackupResponse + (*tabletmanagerdata.RestoreFromBackupResponse)(nil), // 96: tabletmanagerdata.RestoreFromBackupResponse + (*tabletmanagerdata.CheckThrottlerResponse)(nil), // 97: tabletmanagerdata.CheckThrottlerResponse } var file_tabletmanagerservice_proto_depIdxs = []int32{ 0, // 0: tabletmanagerservice.TabletManager.Ping:input_type -> tabletmanagerdata.PingRequest @@ -521,56 +530,58 @@ var file_tabletmanagerservice_proto_depIdxs = []int32{ 45, // 45: tabletmanagerservice.TabletManager.PromoteReplica:input_type -> tabletmanagerdata.PromoteReplicaRequest 46, // 46: tabletmanagerservice.TabletManager.Backup:input_type -> tabletmanagerdata.BackupRequest 47, // 47: tabletmanagerservice.TabletManager.RestoreFromBackup:input_type -> tabletmanagerdata.RestoreFromBackupRequest - 48, // 48: tabletmanagerservice.TabletManager.Ping:output_type -> tabletmanagerdata.PingResponse - 49, // 49: tabletmanagerservice.TabletManager.Sleep:output_type -> tabletmanagerdata.SleepResponse - 50, // 50: tabletmanagerservice.TabletManager.ExecuteHook:output_type -> tabletmanagerdata.ExecuteHookResponse - 51, // 51: tabletmanagerservice.TabletManager.GetSchema:output_type -> tabletmanagerdata.GetSchemaResponse - 52, // 52: tabletmanagerservice.TabletManager.GetPermissions:output_type -> tabletmanagerdata.GetPermissionsResponse - 53, // 53: tabletmanagerservice.TabletManager.SetReadOnly:output_type -> tabletmanagerdata.SetReadOnlyResponse - 54, // 54: tabletmanagerservice.TabletManager.SetReadWrite:output_type -> tabletmanagerdata.SetReadWriteResponse - 55, // 55: tabletmanagerservice.TabletManager.ChangeType:output_type -> tabletmanagerdata.ChangeTypeResponse - 56, // 56: tabletmanagerservice.TabletManager.RefreshState:output_type -> tabletmanagerdata.RefreshStateResponse - 57, // 57: tabletmanagerservice.TabletManager.RunHealthCheck:output_type -> tabletmanagerdata.RunHealthCheckResponse - 58, // 58: tabletmanagerservice.TabletManager.ReloadSchema:output_type -> tabletmanagerdata.ReloadSchemaResponse - 59, // 59: tabletmanagerservice.TabletManager.PreflightSchema:output_type -> tabletmanagerdata.PreflightSchemaResponse - 60, // 60: tabletmanagerservice.TabletManager.ApplySchema:output_type -> tabletmanagerdata.ApplySchemaResponse - 61, // 61: tabletmanagerservice.TabletManager.ResetSequences:output_type -> tabletmanagerdata.ResetSequencesResponse - 62, // 62: tabletmanagerservice.TabletManager.LockTables:output_type -> tabletmanagerdata.LockTablesResponse - 63, // 63: tabletmanagerservice.TabletManager.UnlockTables:output_type -> tabletmanagerdata.UnlockTablesResponse - 64, // 64: tabletmanagerservice.TabletManager.ExecuteQuery:output_type -> tabletmanagerdata.ExecuteQueryResponse - 65, // 65: tabletmanagerservice.TabletManager.ExecuteFetchAsDba:output_type -> tabletmanagerdata.ExecuteFetchAsDbaResponse - 66, // 66: tabletmanagerservice.TabletManager.ExecuteFetchAsAllPrivs:output_type -> tabletmanagerdata.ExecuteFetchAsAllPrivsResponse - 67, // 67: tabletmanagerservice.TabletManager.ExecuteFetchAsApp:output_type -> tabletmanagerdata.ExecuteFetchAsAppResponse - 68, // 68: tabletmanagerservice.TabletManager.ReplicationStatus:output_type -> tabletmanagerdata.ReplicationStatusResponse - 69, // 69: tabletmanagerservice.TabletManager.PrimaryStatus:output_type -> tabletmanagerdata.PrimaryStatusResponse - 70, // 70: tabletmanagerservice.TabletManager.PrimaryPosition:output_type -> tabletmanagerdata.PrimaryPositionResponse - 71, // 71: tabletmanagerservice.TabletManager.WaitForPosition:output_type -> tabletmanagerdata.WaitForPositionResponse - 72, // 72: tabletmanagerservice.TabletManager.StopReplication:output_type -> tabletmanagerdata.StopReplicationResponse - 73, // 73: tabletmanagerservice.TabletManager.StopReplicationMinimum:output_type -> tabletmanagerdata.StopReplicationMinimumResponse - 74, // 74: tabletmanagerservice.TabletManager.StartReplication:output_type -> tabletmanagerdata.StartReplicationResponse - 75, // 75: tabletmanagerservice.TabletManager.StartReplicationUntilAfter:output_type -> tabletmanagerdata.StartReplicationUntilAfterResponse - 76, // 76: tabletmanagerservice.TabletManager.GetReplicas:output_type -> tabletmanagerdata.GetReplicasResponse - 77, // 77: tabletmanagerservice.TabletManager.VReplicationExec:output_type -> tabletmanagerdata.VReplicationExecResponse - 78, // 78: tabletmanagerservice.TabletManager.VReplicationWaitForPos:output_type -> tabletmanagerdata.VReplicationWaitForPosResponse - 79, // 79: tabletmanagerservice.TabletManager.UpdateVRWorkflow:output_type -> tabletmanagerdata.UpdateVRWorkflowResponse - 80, // 80: tabletmanagerservice.TabletManager.VDiff:output_type -> tabletmanagerdata.VDiffResponse - 81, // 81: tabletmanagerservice.TabletManager.ResetReplication:output_type -> tabletmanagerdata.ResetReplicationResponse - 82, // 82: tabletmanagerservice.TabletManager.InitPrimary:output_type -> tabletmanagerdata.InitPrimaryResponse - 83, // 83: tabletmanagerservice.TabletManager.PopulateReparentJournal:output_type -> tabletmanagerdata.PopulateReparentJournalResponse - 84, // 84: tabletmanagerservice.TabletManager.InitReplica:output_type -> tabletmanagerdata.InitReplicaResponse - 85, // 85: tabletmanagerservice.TabletManager.DemotePrimary:output_type -> tabletmanagerdata.DemotePrimaryResponse - 86, // 86: tabletmanagerservice.TabletManager.UndoDemotePrimary:output_type -> tabletmanagerdata.UndoDemotePrimaryResponse - 87, // 87: tabletmanagerservice.TabletManager.ReplicaWasPromoted:output_type -> tabletmanagerdata.ReplicaWasPromotedResponse - 88, // 88: tabletmanagerservice.TabletManager.ResetReplicationParameters:output_type -> tabletmanagerdata.ResetReplicationParametersResponse - 89, // 89: tabletmanagerservice.TabletManager.FullStatus:output_type -> tabletmanagerdata.FullStatusResponse - 90, // 90: tabletmanagerservice.TabletManager.SetReplicationSource:output_type -> tabletmanagerdata.SetReplicationSourceResponse - 91, // 91: tabletmanagerservice.TabletManager.ReplicaWasRestarted:output_type -> tabletmanagerdata.ReplicaWasRestartedResponse - 92, // 92: tabletmanagerservice.TabletManager.StopReplicationAndGetStatus:output_type -> tabletmanagerdata.StopReplicationAndGetStatusResponse - 93, // 93: tabletmanagerservice.TabletManager.PromoteReplica:output_type -> tabletmanagerdata.PromoteReplicaResponse - 94, // 94: tabletmanagerservice.TabletManager.Backup:output_type -> tabletmanagerdata.BackupResponse - 95, // 95: tabletmanagerservice.TabletManager.RestoreFromBackup:output_type -> tabletmanagerdata.RestoreFromBackupResponse - 48, // [48:96] is the sub-list for method output_type - 0, // [0:48] is the sub-list for method input_type + 48, // 48: tabletmanagerservice.TabletManager.CheckThrottler:input_type -> tabletmanagerdata.CheckThrottlerRequest + 49, // 49: tabletmanagerservice.TabletManager.Ping:output_type -> tabletmanagerdata.PingResponse + 50, // 50: tabletmanagerservice.TabletManager.Sleep:output_type -> tabletmanagerdata.SleepResponse + 51, // 51: tabletmanagerservice.TabletManager.ExecuteHook:output_type -> tabletmanagerdata.ExecuteHookResponse + 52, // 52: tabletmanagerservice.TabletManager.GetSchema:output_type -> tabletmanagerdata.GetSchemaResponse + 53, // 53: tabletmanagerservice.TabletManager.GetPermissions:output_type -> tabletmanagerdata.GetPermissionsResponse + 54, // 54: tabletmanagerservice.TabletManager.SetReadOnly:output_type -> tabletmanagerdata.SetReadOnlyResponse + 55, // 55: tabletmanagerservice.TabletManager.SetReadWrite:output_type -> tabletmanagerdata.SetReadWriteResponse + 56, // 56: tabletmanagerservice.TabletManager.ChangeType:output_type -> tabletmanagerdata.ChangeTypeResponse + 57, // 57: tabletmanagerservice.TabletManager.RefreshState:output_type -> tabletmanagerdata.RefreshStateResponse + 58, // 58: tabletmanagerservice.TabletManager.RunHealthCheck:output_type -> tabletmanagerdata.RunHealthCheckResponse + 59, // 59: tabletmanagerservice.TabletManager.ReloadSchema:output_type -> tabletmanagerdata.ReloadSchemaResponse + 60, // 60: tabletmanagerservice.TabletManager.PreflightSchema:output_type -> tabletmanagerdata.PreflightSchemaResponse + 61, // 61: tabletmanagerservice.TabletManager.ApplySchema:output_type -> tabletmanagerdata.ApplySchemaResponse + 62, // 62: tabletmanagerservice.TabletManager.ResetSequences:output_type -> tabletmanagerdata.ResetSequencesResponse + 63, // 63: tabletmanagerservice.TabletManager.LockTables:output_type -> tabletmanagerdata.LockTablesResponse + 64, // 64: tabletmanagerservice.TabletManager.UnlockTables:output_type -> tabletmanagerdata.UnlockTablesResponse + 65, // 65: tabletmanagerservice.TabletManager.ExecuteQuery:output_type -> tabletmanagerdata.ExecuteQueryResponse + 66, // 66: tabletmanagerservice.TabletManager.ExecuteFetchAsDba:output_type -> tabletmanagerdata.ExecuteFetchAsDbaResponse + 67, // 67: tabletmanagerservice.TabletManager.ExecuteFetchAsAllPrivs:output_type -> tabletmanagerdata.ExecuteFetchAsAllPrivsResponse + 68, // 68: tabletmanagerservice.TabletManager.ExecuteFetchAsApp:output_type -> tabletmanagerdata.ExecuteFetchAsAppResponse + 69, // 69: tabletmanagerservice.TabletManager.ReplicationStatus:output_type -> tabletmanagerdata.ReplicationStatusResponse + 70, // 70: tabletmanagerservice.TabletManager.PrimaryStatus:output_type -> tabletmanagerdata.PrimaryStatusResponse + 71, // 71: tabletmanagerservice.TabletManager.PrimaryPosition:output_type -> tabletmanagerdata.PrimaryPositionResponse + 72, // 72: tabletmanagerservice.TabletManager.WaitForPosition:output_type -> tabletmanagerdata.WaitForPositionResponse + 73, // 73: tabletmanagerservice.TabletManager.StopReplication:output_type -> tabletmanagerdata.StopReplicationResponse + 74, // 74: tabletmanagerservice.TabletManager.StopReplicationMinimum:output_type -> tabletmanagerdata.StopReplicationMinimumResponse + 75, // 75: tabletmanagerservice.TabletManager.StartReplication:output_type -> tabletmanagerdata.StartReplicationResponse + 76, // 76: tabletmanagerservice.TabletManager.StartReplicationUntilAfter:output_type -> tabletmanagerdata.StartReplicationUntilAfterResponse + 77, // 77: tabletmanagerservice.TabletManager.GetReplicas:output_type -> tabletmanagerdata.GetReplicasResponse + 78, // 78: tabletmanagerservice.TabletManager.VReplicationExec:output_type -> tabletmanagerdata.VReplicationExecResponse + 79, // 79: tabletmanagerservice.TabletManager.VReplicationWaitForPos:output_type -> tabletmanagerdata.VReplicationWaitForPosResponse + 80, // 80: tabletmanagerservice.TabletManager.UpdateVRWorkflow:output_type -> tabletmanagerdata.UpdateVRWorkflowResponse + 81, // 81: tabletmanagerservice.TabletManager.VDiff:output_type -> tabletmanagerdata.VDiffResponse + 82, // 82: tabletmanagerservice.TabletManager.ResetReplication:output_type -> tabletmanagerdata.ResetReplicationResponse + 83, // 83: tabletmanagerservice.TabletManager.InitPrimary:output_type -> tabletmanagerdata.InitPrimaryResponse + 84, // 84: tabletmanagerservice.TabletManager.PopulateReparentJournal:output_type -> tabletmanagerdata.PopulateReparentJournalResponse + 85, // 85: tabletmanagerservice.TabletManager.InitReplica:output_type -> tabletmanagerdata.InitReplicaResponse + 86, // 86: tabletmanagerservice.TabletManager.DemotePrimary:output_type -> tabletmanagerdata.DemotePrimaryResponse + 87, // 87: tabletmanagerservice.TabletManager.UndoDemotePrimary:output_type -> tabletmanagerdata.UndoDemotePrimaryResponse + 88, // 88: tabletmanagerservice.TabletManager.ReplicaWasPromoted:output_type -> tabletmanagerdata.ReplicaWasPromotedResponse + 89, // 89: tabletmanagerservice.TabletManager.ResetReplicationParameters:output_type -> tabletmanagerdata.ResetReplicationParametersResponse + 90, // 90: tabletmanagerservice.TabletManager.FullStatus:output_type -> tabletmanagerdata.FullStatusResponse + 91, // 91: tabletmanagerservice.TabletManager.SetReplicationSource:output_type -> tabletmanagerdata.SetReplicationSourceResponse + 92, // 92: tabletmanagerservice.TabletManager.ReplicaWasRestarted:output_type -> tabletmanagerdata.ReplicaWasRestartedResponse + 93, // 93: tabletmanagerservice.TabletManager.StopReplicationAndGetStatus:output_type -> tabletmanagerdata.StopReplicationAndGetStatusResponse + 94, // 94: tabletmanagerservice.TabletManager.PromoteReplica:output_type -> tabletmanagerdata.PromoteReplicaResponse + 95, // 95: tabletmanagerservice.TabletManager.Backup:output_type -> tabletmanagerdata.BackupResponse + 96, // 96: tabletmanagerservice.TabletManager.RestoreFromBackup:output_type -> tabletmanagerdata.RestoreFromBackupResponse + 97, // 97: tabletmanagerservice.TabletManager.CheckThrottler:output_type -> tabletmanagerdata.CheckThrottlerResponse + 49, // [49:98] is the sub-list for method output_type + 0, // [0:49] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name diff --git a/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go b/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go index bc2e912c606..43aa655fa00 100644 --- a/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go +++ b/go/vt/proto/tabletmanagerservice/tabletmanagerservice_grpc.pb.go @@ -106,6 +106,8 @@ type TabletManagerClient interface { Backup(ctx context.Context, in *tabletmanagerdata.BackupRequest, opts ...grpc.CallOption) (TabletManager_BackupClient, error) // RestoreFromBackup deletes all local data and restores it from the latest backup. RestoreFromBackup(ctx context.Context, in *tabletmanagerdata.RestoreFromBackupRequest, opts ...grpc.CallOption) (TabletManager_RestoreFromBackupClient, error) + // CheckThrottler issues a 'check' on a tablet's throttler + CheckThrottler(ctx context.Context, in *tabletmanagerdata.CheckThrottlerRequest, opts ...grpc.CallOption) (*tabletmanagerdata.CheckThrottlerResponse, error) } type tabletManagerClient struct { @@ -594,6 +596,15 @@ func (x *tabletManagerRestoreFromBackupClient) Recv() (*tabletmanagerdata.Restor return m, nil } +func (c *tabletManagerClient) CheckThrottler(ctx context.Context, in *tabletmanagerdata.CheckThrottlerRequest, opts ...grpc.CallOption) (*tabletmanagerdata.CheckThrottlerResponse, error) { + out := new(tabletmanagerdata.CheckThrottlerResponse) + err := c.cc.Invoke(ctx, "/tabletmanagerservice.TabletManager/CheckThrottler", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // TabletManagerServer is the server API for TabletManager service. // All implementations must embed UnimplementedTabletManagerServer // for forward compatibility @@ -681,6 +692,8 @@ type TabletManagerServer interface { Backup(*tabletmanagerdata.BackupRequest, TabletManager_BackupServer) error // RestoreFromBackup deletes all local data and restores it from the latest backup. RestoreFromBackup(*tabletmanagerdata.RestoreFromBackupRequest, TabletManager_RestoreFromBackupServer) error + // CheckThrottler issues a 'check' on a tablet's throttler + CheckThrottler(context.Context, *tabletmanagerdata.CheckThrottlerRequest) (*tabletmanagerdata.CheckThrottlerResponse, error) mustEmbedUnimplementedTabletManagerServer() } @@ -832,6 +845,9 @@ func (UnimplementedTabletManagerServer) Backup(*tabletmanagerdata.BackupRequest, func (UnimplementedTabletManagerServer) RestoreFromBackup(*tabletmanagerdata.RestoreFromBackupRequest, TabletManager_RestoreFromBackupServer) error { return status.Errorf(codes.Unimplemented, "method RestoreFromBackup not implemented") } +func (UnimplementedTabletManagerServer) CheckThrottler(context.Context, *tabletmanagerdata.CheckThrottlerRequest) (*tabletmanagerdata.CheckThrottlerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CheckThrottler not implemented") +} func (UnimplementedTabletManagerServer) mustEmbedUnimplementedTabletManagerServer() {} // UnsafeTabletManagerServer may be embedded to opt out of forward compatibility for this service. @@ -1715,6 +1731,24 @@ func (x *tabletManagerRestoreFromBackupServer) Send(m *tabletmanagerdata.Restore return x.ServerStream.SendMsg(m) } +func _TabletManager_CheckThrottler_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(tabletmanagerdata.CheckThrottlerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(TabletManagerServer).CheckThrottler(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/tabletmanagerservice.TabletManager/CheckThrottler", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(TabletManagerServer).CheckThrottler(ctx, req.(*tabletmanagerdata.CheckThrottlerRequest)) + } + return interceptor(ctx, in, info, handler) +} + // TabletManager_ServiceDesc is the grpc.ServiceDesc for TabletManager service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -1906,6 +1940,10 @@ var TabletManager_ServiceDesc = grpc.ServiceDesc{ MethodName: "PromoteReplica", Handler: _TabletManager_PromoteReplica_Handler, }, + { + MethodName: "CheckThrottler", + Handler: _TabletManager_CheckThrottler_Handler, + }, }, Streams: []grpc.StreamDesc{ { diff --git a/proto/tabletmanagerdata.proto b/proto/tabletmanagerdata.proto index c3b2f4131e6..00c6767c00a 100644 --- a/proto/tabletmanagerdata.proto +++ b/proto/tabletmanagerdata.proto @@ -564,3 +564,23 @@ message ResetSequencesRequest { message ResetSequencesResponse { } + +message CheckThrottlerRequest { + string app_name = 1; +} + +message CheckThrottlerResponse { + // StatusCode is HTTP compliant response code (e.g. 200 for OK) + int32 status_code = 1; + // Value is the metric value collected by the tablet + double value = 2; + // Threshold is the throttling threshold the table was comparing the value with + double threshold = 3; + // Error indicates an error retrieving the value + string error = 4; + // Message + string message = 5; + // RecentlyChecked indicates that the tablet has been hit with a user-facing check, which can then imply + // that heartbeats lease should be renwed. + bool recently_checked = 6; +} diff --git a/proto/tabletmanagerservice.proto b/proto/tabletmanagerservice.proto index 15d717fe933..a2955c33614 100644 --- a/proto/tabletmanagerservice.proto +++ b/proto/tabletmanagerservice.proto @@ -175,4 +175,6 @@ service TabletManager { // RestoreFromBackup deletes all local data and restores it from the latest backup. rpc RestoreFromBackup(tabletmanagerdata.RestoreFromBackupRequest) returns (stream tabletmanagerdata.RestoreFromBackupResponse) {}; + // CheckThrottler issues a 'check' on a tablet's throttler + rpc CheckThrottler(tabletmanagerdata.CheckThrottlerRequest) returns (tabletmanagerdata.CheckThrottlerResponse) {}; } diff --git a/web/vtadmin/src/proto/vtadmin.d.ts b/web/vtadmin/src/proto/vtadmin.d.ts index 6d1c9ab8f22..89730e14f83 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -27209,6 +27209,230 @@ export namespace tabletmanagerdata { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a CheckThrottlerRequest. */ + interface ICheckThrottlerRequest { + + /** CheckThrottlerRequest app_name */ + app_name?: (string|null); + } + + /** Represents a CheckThrottlerRequest. */ + class CheckThrottlerRequest implements ICheckThrottlerRequest { + + /** + * Constructs a new CheckThrottlerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: tabletmanagerdata.ICheckThrottlerRequest); + + /** CheckThrottlerRequest app_name. */ + public app_name: string; + + /** + * Creates a new CheckThrottlerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckThrottlerRequest instance + */ + public static create(properties?: tabletmanagerdata.ICheckThrottlerRequest): tabletmanagerdata.CheckThrottlerRequest; + + /** + * Encodes the specified CheckThrottlerRequest message. Does not implicitly {@link tabletmanagerdata.CheckThrottlerRequest.verify|verify} messages. + * @param message CheckThrottlerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: tabletmanagerdata.ICheckThrottlerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckThrottlerRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.CheckThrottlerRequest.verify|verify} messages. + * @param message CheckThrottlerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: tabletmanagerdata.ICheckThrottlerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckThrottlerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckThrottlerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tabletmanagerdata.CheckThrottlerRequest; + + /** + * Decodes a CheckThrottlerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckThrottlerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tabletmanagerdata.CheckThrottlerRequest; + + /** + * Verifies a CheckThrottlerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckThrottlerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckThrottlerRequest + */ + public static fromObject(object: { [k: string]: any }): tabletmanagerdata.CheckThrottlerRequest; + + /** + * Creates a plain object from a CheckThrottlerRequest message. Also converts values to other types if specified. + * @param message CheckThrottlerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: tabletmanagerdata.CheckThrottlerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckThrottlerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckThrottlerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CheckThrottlerResponse. */ + interface ICheckThrottlerResponse { + + /** CheckThrottlerResponse status_code */ + status_code?: (number|null); + + /** CheckThrottlerResponse value */ + value?: (number|null); + + /** CheckThrottlerResponse threshold */ + threshold?: (number|null); + + /** CheckThrottlerResponse error */ + error?: (string|null); + + /** CheckThrottlerResponse message */ + message?: (string|null); + + /** CheckThrottlerResponse recently_checked */ + recently_checked?: (boolean|null); + } + + /** Represents a CheckThrottlerResponse. */ + class CheckThrottlerResponse implements ICheckThrottlerResponse { + + /** + * Constructs a new CheckThrottlerResponse. + * @param [properties] Properties to set + */ + constructor(properties?: tabletmanagerdata.ICheckThrottlerResponse); + + /** CheckThrottlerResponse status_code. */ + public status_code: number; + + /** CheckThrottlerResponse value. */ + public value: number; + + /** CheckThrottlerResponse threshold. */ + public threshold: number; + + /** CheckThrottlerResponse error. */ + public error: string; + + /** CheckThrottlerResponse message. */ + public message: string; + + /** CheckThrottlerResponse recently_checked. */ + public recently_checked: boolean; + + /** + * Creates a new CheckThrottlerResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CheckThrottlerResponse instance + */ + public static create(properties?: tabletmanagerdata.ICheckThrottlerResponse): tabletmanagerdata.CheckThrottlerResponse; + + /** + * Encodes the specified CheckThrottlerResponse message. Does not implicitly {@link tabletmanagerdata.CheckThrottlerResponse.verify|verify} messages. + * @param message CheckThrottlerResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: tabletmanagerdata.ICheckThrottlerResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CheckThrottlerResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.CheckThrottlerResponse.verify|verify} messages. + * @param message CheckThrottlerResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: tabletmanagerdata.ICheckThrottlerResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CheckThrottlerResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CheckThrottlerResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tabletmanagerdata.CheckThrottlerResponse; + + /** + * Decodes a CheckThrottlerResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CheckThrottlerResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tabletmanagerdata.CheckThrottlerResponse; + + /** + * Verifies a CheckThrottlerResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CheckThrottlerResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CheckThrottlerResponse + */ + public static fromObject(object: { [k: string]: any }): tabletmanagerdata.CheckThrottlerResponse; + + /** + * Creates a plain object from a CheckThrottlerResponse message. Also converts values to other types if specified. + * @param message CheckThrottlerResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: tabletmanagerdata.CheckThrottlerResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CheckThrottlerResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CheckThrottlerResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Namespace binlogdata. */ diff --git a/web/vtadmin/src/proto/vtadmin.js b/web/vtadmin/src/proto/vtadmin.js index becbedaee74..2795f1b77fd 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -62336,6 +62336,528 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { return ResetSequencesResponse; })(); + tabletmanagerdata.CheckThrottlerRequest = (function() { + + /** + * Properties of a CheckThrottlerRequest. + * @memberof tabletmanagerdata + * @interface ICheckThrottlerRequest + * @property {string|null} [app_name] CheckThrottlerRequest app_name + */ + + /** + * Constructs a new CheckThrottlerRequest. + * @memberof tabletmanagerdata + * @classdesc Represents a CheckThrottlerRequest. + * @implements ICheckThrottlerRequest + * @constructor + * @param {tabletmanagerdata.ICheckThrottlerRequest=} [properties] Properties to set + */ + function CheckThrottlerRequest(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckThrottlerRequest app_name. + * @member {string} app_name + * @memberof tabletmanagerdata.CheckThrottlerRequest + * @instance + */ + CheckThrottlerRequest.prototype.app_name = ""; + + /** + * Creates a new CheckThrottlerRequest instance using the specified properties. + * @function create + * @memberof tabletmanagerdata.CheckThrottlerRequest + * @static + * @param {tabletmanagerdata.ICheckThrottlerRequest=} [properties] Properties to set + * @returns {tabletmanagerdata.CheckThrottlerRequest} CheckThrottlerRequest instance + */ + CheckThrottlerRequest.create = function create(properties) { + return new CheckThrottlerRequest(properties); + }; + + /** + * Encodes the specified CheckThrottlerRequest message. Does not implicitly {@link tabletmanagerdata.CheckThrottlerRequest.verify|verify} messages. + * @function encode + * @memberof tabletmanagerdata.CheckThrottlerRequest + * @static + * @param {tabletmanagerdata.ICheckThrottlerRequest} message CheckThrottlerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckThrottlerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.app_name != null && Object.hasOwnProperty.call(message, "app_name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.app_name); + return writer; + }; + + /** + * Encodes the specified CheckThrottlerRequest message, length delimited. Does not implicitly {@link tabletmanagerdata.CheckThrottlerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof tabletmanagerdata.CheckThrottlerRequest + * @static + * @param {tabletmanagerdata.ICheckThrottlerRequest} message CheckThrottlerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckThrottlerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckThrottlerRequest message from the specified reader or buffer. + * @function decode + * @memberof tabletmanagerdata.CheckThrottlerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tabletmanagerdata.CheckThrottlerRequest} CheckThrottlerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckThrottlerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tabletmanagerdata.CheckThrottlerRequest(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.app_name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckThrottlerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.CheckThrottlerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tabletmanagerdata.CheckThrottlerRequest} CheckThrottlerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckThrottlerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckThrottlerRequest message. + * @function verify + * @memberof tabletmanagerdata.CheckThrottlerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckThrottlerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.app_name != null && message.hasOwnProperty("app_name")) + if (!$util.isString(message.app_name)) + return "app_name: string expected"; + return null; + }; + + /** + * Creates a CheckThrottlerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.CheckThrottlerRequest + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.CheckThrottlerRequest} CheckThrottlerRequest + */ + CheckThrottlerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.CheckThrottlerRequest) + return object; + let message = new $root.tabletmanagerdata.CheckThrottlerRequest(); + if (object.app_name != null) + message.app_name = String(object.app_name); + return message; + }; + + /** + * Creates a plain object from a CheckThrottlerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof tabletmanagerdata.CheckThrottlerRequest + * @static + * @param {tabletmanagerdata.CheckThrottlerRequest} message CheckThrottlerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckThrottlerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) + object.app_name = ""; + if (message.app_name != null && message.hasOwnProperty("app_name")) + object.app_name = message.app_name; + return object; + }; + + /** + * Converts this CheckThrottlerRequest to JSON. + * @function toJSON + * @memberof tabletmanagerdata.CheckThrottlerRequest + * @instance + * @returns {Object.} JSON object + */ + CheckThrottlerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckThrottlerRequest + * @function getTypeUrl + * @memberof tabletmanagerdata.CheckThrottlerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckThrottlerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.CheckThrottlerRequest"; + }; + + return CheckThrottlerRequest; + })(); + + tabletmanagerdata.CheckThrottlerResponse = (function() { + + /** + * Properties of a CheckThrottlerResponse. + * @memberof tabletmanagerdata + * @interface ICheckThrottlerResponse + * @property {number|null} [status_code] CheckThrottlerResponse status_code + * @property {number|null} [value] CheckThrottlerResponse value + * @property {number|null} [threshold] CheckThrottlerResponse threshold + * @property {string|null} [error] CheckThrottlerResponse error + * @property {string|null} [message] CheckThrottlerResponse message + * @property {boolean|null} [recently_checked] CheckThrottlerResponse recently_checked + */ + + /** + * Constructs a new CheckThrottlerResponse. + * @memberof tabletmanagerdata + * @classdesc Represents a CheckThrottlerResponse. + * @implements ICheckThrottlerResponse + * @constructor + * @param {tabletmanagerdata.ICheckThrottlerResponse=} [properties] Properties to set + */ + function CheckThrottlerResponse(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CheckThrottlerResponse status_code. + * @member {number} status_code + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @instance + */ + CheckThrottlerResponse.prototype.status_code = 0; + + /** + * CheckThrottlerResponse value. + * @member {number} value + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @instance + */ + CheckThrottlerResponse.prototype.value = 0; + + /** + * CheckThrottlerResponse threshold. + * @member {number} threshold + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @instance + */ + CheckThrottlerResponse.prototype.threshold = 0; + + /** + * CheckThrottlerResponse error. + * @member {string} error + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @instance + */ + CheckThrottlerResponse.prototype.error = ""; + + /** + * CheckThrottlerResponse message. + * @member {string} message + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @instance + */ + CheckThrottlerResponse.prototype.message = ""; + + /** + * CheckThrottlerResponse recently_checked. + * @member {boolean} recently_checked + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @instance + */ + CheckThrottlerResponse.prototype.recently_checked = false; + + /** + * Creates a new CheckThrottlerResponse instance using the specified properties. + * @function create + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @static + * @param {tabletmanagerdata.ICheckThrottlerResponse=} [properties] Properties to set + * @returns {tabletmanagerdata.CheckThrottlerResponse} CheckThrottlerResponse instance + */ + CheckThrottlerResponse.create = function create(properties) { + return new CheckThrottlerResponse(properties); + }; + + /** + * Encodes the specified CheckThrottlerResponse message. Does not implicitly {@link tabletmanagerdata.CheckThrottlerResponse.verify|verify} messages. + * @function encode + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @static + * @param {tabletmanagerdata.ICheckThrottlerResponse} message CheckThrottlerResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckThrottlerResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.status_code != null && Object.hasOwnProperty.call(message, "status_code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.status_code); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.value); + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.threshold); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.error); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.message); + if (message.recently_checked != null && Object.hasOwnProperty.call(message, "recently_checked")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.recently_checked); + return writer; + }; + + /** + * Encodes the specified CheckThrottlerResponse message, length delimited. Does not implicitly {@link tabletmanagerdata.CheckThrottlerResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @static + * @param {tabletmanagerdata.ICheckThrottlerResponse} message CheckThrottlerResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CheckThrottlerResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CheckThrottlerResponse message from the specified reader or buffer. + * @function decode + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tabletmanagerdata.CheckThrottlerResponse} CheckThrottlerResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckThrottlerResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tabletmanagerdata.CheckThrottlerResponse(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.status_code = reader.int32(); + break; + } + case 2: { + message.value = reader.double(); + break; + } + case 3: { + message.threshold = reader.double(); + break; + } + case 4: { + message.error = reader.string(); + break; + } + case 5: { + message.message = reader.string(); + break; + } + case 6: { + message.recently_checked = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CheckThrottlerResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tabletmanagerdata.CheckThrottlerResponse} CheckThrottlerResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CheckThrottlerResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CheckThrottlerResponse message. + * @function verify + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CheckThrottlerResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.status_code != null && message.hasOwnProperty("status_code")) + if (!$util.isInteger(message.status_code)) + return "status_code: integer expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + if (message.threshold != null && message.hasOwnProperty("threshold")) + if (typeof message.threshold !== "number") + return "threshold: number expected"; + if (message.error != null && message.hasOwnProperty("error")) + if (!$util.isString(message.error)) + return "error: string expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.recently_checked != null && message.hasOwnProperty("recently_checked")) + if (typeof message.recently_checked !== "boolean") + return "recently_checked: boolean expected"; + return null; + }; + + /** + * Creates a CheckThrottlerResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.CheckThrottlerResponse} CheckThrottlerResponse + */ + CheckThrottlerResponse.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.CheckThrottlerResponse) + return object; + let message = new $root.tabletmanagerdata.CheckThrottlerResponse(); + if (object.status_code != null) + message.status_code = object.status_code | 0; + if (object.value != null) + message.value = Number(object.value); + if (object.threshold != null) + message.threshold = Number(object.threshold); + if (object.error != null) + message.error = String(object.error); + if (object.message != null) + message.message = String(object.message); + if (object.recently_checked != null) + message.recently_checked = Boolean(object.recently_checked); + return message; + }; + + /** + * Creates a plain object from a CheckThrottlerResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @static + * @param {tabletmanagerdata.CheckThrottlerResponse} message CheckThrottlerResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CheckThrottlerResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.status_code = 0; + object.value = 0; + object.threshold = 0; + object.error = ""; + object.message = ""; + object.recently_checked = false; + } + if (message.status_code != null && message.hasOwnProperty("status_code")) + object.status_code = message.status_code; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + if (message.threshold != null && message.hasOwnProperty("threshold")) + object.threshold = options.json && !isFinite(message.threshold) ? String(message.threshold) : message.threshold; + if (message.error != null && message.hasOwnProperty("error")) + object.error = message.error; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.recently_checked != null && message.hasOwnProperty("recently_checked")) + object.recently_checked = message.recently_checked; + return object; + }; + + /** + * Converts this CheckThrottlerResponse to JSON. + * @function toJSON + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @instance + * @returns {Object.} JSON object + */ + CheckThrottlerResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CheckThrottlerResponse + * @function getTypeUrl + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CheckThrottlerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.CheckThrottlerResponse"; + }; + + return CheckThrottlerResponse; + })(); + return tabletmanagerdata; })(); From ac2f2a380ede002d83a57a382ef2510cda16f193 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Sun, 16 Jul 2023 16:39:05 +0300 Subject: [PATCH 02/15] Implement CheckThrottler client-side Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vtcombo/tablet_map.go | 4 +++ .../testutil/test_tmclient.go | 34 +++++++++++++++++++ go/vt/vttablet/grpctmclient/client.go | 14 ++++++++ go/vt/vttablet/tmclient/rpc_client_api.go | 3 ++ 4 files changed, 55 insertions(+) diff --git a/go/vt/vtcombo/tablet_map.go b/go/vt/vtcombo/tablet_map.go index e2e4946d219..55b904c0bd0 100644 --- a/go/vt/vtcombo/tablet_map.go +++ b/go/vt/vtcombo/tablet_map.go @@ -913,6 +913,10 @@ func (itmc *internalTabletManagerClient) RestoreFromBackup(context.Context, *top return nil, fmt.Errorf("not implemented in vtcombo") } +func (itmc *internalTabletManagerClient) CheckThrottler(context.Context, *topodatapb.Tablet, *tabletmanagerdatapb.CheckThrottlerRequest) (*tabletmanagerdatapb.CheckThrottlerResponse, error) { + return nil, fmt.Errorf("not implemented in vtcombo") +} + func (itmc *internalTabletManagerClient) Close() { } diff --git a/go/vt/vtctl/grpcvtctldserver/testutil/test_tmclient.go b/go/vt/vtctl/grpcvtctldserver/testutil/test_tmclient.go index b824833a7dc..90d7c8af14d 100644 --- a/go/vt/vtctl/grpcvtctldserver/testutil/test_tmclient.go +++ b/go/vt/vtctl/grpcvtctldserver/testutil/test_tmclient.go @@ -343,6 +343,10 @@ type TabletManagerClient struct { // WaitForPosition(tablet *topodatapb.Tablet, position string) error, so we // key by tablet alias and then by position. WaitForPositionResults map[string]map[string]error + // tablet alias => duration + CheckThrottlerDelays map[string]time.Duration + // keyed by tablet alias + CheckThrottlerResults map[string]*tabletmanagerdatapb.CheckThrottlerResponse } type backupStreamAdapter struct { @@ -1326,3 +1330,33 @@ func (fake *TabletManagerClient) VReplicationExec(ctx context.Context, tablet *t return nil, assert.AnError } + +// CheckThrottler is part of the tmclient.TabletManagerCLient interface. +func (fake *TabletManagerClient) CheckThrottler(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.CheckThrottlerRequest) (*tabletmanagerdatapb.CheckThrottlerResponse, error) { + if fake.CheckThrottlerResults == nil { + return nil, assert.AnError + } + + if tablet.Alias == nil { + return nil, assert.AnError + } + + key := topoproto.TabletAliasString(tablet.Alias) + + if fake.CheckThrottlerDelays != nil { + if delay, ok := fake.CheckThrottlerDelays[key]; ok { + select { + case <-ctx.Done(): + return nil, ctx.Err() + case <-time.After(delay): + // proceed to results + } + } + } + + if resultsForTablet, ok := fake.CheckThrottlerResults[key]; ok { + return resultsForTablet, nil + } + + return nil, assert.AnError +} diff --git a/go/vt/vttablet/grpctmclient/client.go b/go/vt/vttablet/grpctmclient/client.go index cee531d4b8f..18049ec440e 100644 --- a/go/vt/vttablet/grpctmclient/client.go +++ b/go/vt/vttablet/grpctmclient/client.go @@ -958,6 +958,20 @@ func (client *Client) Backup(ctx context.Context, tablet *topodatapb.Tablet, req }, nil } +// CheckThrottler is part of the tmclient.TabletManagerClient interface. +func (client *Client) CheckThrottler(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.CheckThrottlerRequest) (*tabletmanagerdatapb.CheckThrottlerResponse, error) { + c, closer, err := client.dialer.dial(ctx, tablet) + if err != nil { + return nil, err + } + defer closer.Close() + response, err := c.CheckThrottler(ctx, req) + if err != nil { + return nil, err + } + return response, nil +} + type restoreFromBackupStreamAdapter struct { stream tabletmanagerservicepb.TabletManager_RestoreFromBackupClient closer io.Closer diff --git a/go/vt/vttablet/tmclient/rpc_client_api.go b/go/vt/vttablet/tmclient/rpc_client_api.go index d77bcd74f24..404c801ea88 100644 --- a/go/vt/vttablet/tmclient/rpc_client_api.go +++ b/go/vt/vttablet/tmclient/rpc_client_api.go @@ -240,6 +240,9 @@ type TabletManagerClient interface { // RestoreFromBackup deletes local data and restores database from backup RestoreFromBackup(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.RestoreFromBackupRequest) (logutil.EventStream, error) + // Throttler + CheckThrottler(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.CheckThrottlerRequest) (*tabletmanagerdatapb.CheckThrottlerResponse, error) + // // Management methods // From d3590bb59536a850a745cfbc69b8a7d86f103b0e Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Sun, 16 Jul 2023 17:02:46 +0300 Subject: [PATCH 03/15] implementing CheckThrottler server side Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tabletmanager/rpc_agent.go | 3 ++ go/vt/vttablet/tabletmanager/rpc_throttler.go | 53 +++++++++++++++++++ go/vt/vttablet/tabletserver/controller.go | 4 ++ go/vt/vttablet/tabletserver/tabletserver.go | 5 ++ go/vt/vttablet/tabletservermock/controller.go | 6 +++ 5 files changed, 71 insertions(+) create mode 100644 go/vt/vttablet/tabletmanager/rpc_throttler.go diff --git a/go/vt/vttablet/tabletmanager/rpc_agent.go b/go/vt/vttablet/tabletmanager/rpc_agent.go index 2482b84a256..cb446b0be58 100644 --- a/go/vt/vttablet/tabletmanager/rpc_agent.go +++ b/go/vt/vttablet/tabletmanager/rpc_agent.go @@ -141,4 +141,7 @@ type RPCTM interface { // HandleRPCPanic is to be called in a defer statement in each // RPC input point. HandleRPCPanic(ctx context.Context, name string, args, reply any, verbose bool, err *error) + + // Throttler + CheckThrottler(ctx context.Context, request *tabletmanagerdatapb.CheckThrottlerRequest) (*tabletmanagerdatapb.CheckThrottlerResponse, error) } diff --git a/go/vt/vttablet/tabletmanager/rpc_throttler.go b/go/vt/vttablet/tabletmanager/rpc_throttler.go new file mode 100644 index 00000000000..47d4faa366e --- /dev/null +++ b/go/vt/vttablet/tabletmanager/rpc_throttler.go @@ -0,0 +1,53 @@ +/* +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" + + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + "vitess.io/vitess/go/vt/proto/vtrpc" + "vitess.io/vitess/go/vt/vterrors" + "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle" + "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/throttlerapp" +) + +// CheckThrottler executes a throttler check +func (tm *TabletManager) CheckThrottler(ctx context.Context, req *tabletmanagerdatapb.CheckThrottlerRequest) (*tabletmanagerdatapb.CheckThrottlerResponse, error) { + if req.AppName == "" { + req.AppName = throttlerapp.VitessName.String() + } + flags := &throttle.CheckFlags{ + LowPriority: false, + SkipRequestHeartbeats: true, + } + checkResult := tm.QueryServiceControl.CheckThrottler(ctx, req.AppName, flags) + if checkResult == nil { + return nil, vterrors.Errorf(vtrpc.Code_INTERNAL, "nil checkResult") + } + resp := &tabletmanagerdatapb.CheckThrottlerResponse{ + StatusCode: int32(checkResult.StatusCode), + Value: checkResult.Value, + Threshold: checkResult.Threshold, + Message: checkResult.Message, + RecentlyChecked: checkResult.RecentlyChecked, + } + if checkResult.Error != nil { + resp.Error = checkResult.Error.Error() + } + return resp, nil +} diff --git a/go/vt/vttablet/tabletserver/controller.go b/go/vt/vttablet/tabletserver/controller.go index 28804fb1696..360de75d123 100644 --- a/go/vt/vttablet/tabletserver/controller.go +++ b/go/vt/vttablet/tabletserver/controller.go @@ -26,6 +26,7 @@ import ( "vitess.io/vitess/go/vt/vttablet/tabletserver/rules" "vitess.io/vitess/go/vt/vttablet/tabletserver/schema" "vitess.io/vitess/go/vt/vttablet/tabletserver/tabletenv" + "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle" "time" @@ -89,6 +90,9 @@ type Controller interface { // TopoServer returns the topo server. TopoServer() *topo.Server + + // CheckThrottler + CheckThrottler(ctx context.Context, appName string, flags *throttle.CheckFlags) *throttle.CheckResult } // Ensure TabletServer satisfies Controller interface. diff --git a/go/vt/vttablet/tabletserver/tabletserver.go b/go/vt/vttablet/tabletserver/tabletserver.go index 795546aac5f..bfaed3c4a56 100644 --- a/go/vt/vttablet/tabletserver/tabletserver.go +++ b/go/vt/vttablet/tabletserver/tabletserver.go @@ -1702,6 +1702,11 @@ func (tsv *TabletServer) TopoServer() *topo.Server { return tsv.topoServer } +// CheckThrottler issues a self check +func (tsv *TabletServer) CheckThrottler(ctx context.Context, appName string, flags *throttle.CheckFlags) *throttle.CheckResult { + return tsv.lagThrottler.CheckByType(ctx, appName, "", flags, throttle.ThrottleCheckSelf) +} + // HandlePanic is part of the queryservice.QueryService interface func (tsv *TabletServer) HandlePanic(err *error) { if x := recover(); x != nil { diff --git a/go/vt/vttablet/tabletservermock/controller.go b/go/vt/vttablet/tabletservermock/controller.go index 1ae5772587a..80c301e2f8d 100644 --- a/go/vt/vttablet/tabletservermock/controller.go +++ b/go/vt/vttablet/tabletservermock/controller.go @@ -32,6 +32,7 @@ import ( "vitess.io/vitess/go/vt/vttablet/tabletserver/rules" "vitess.io/vitess/go/vt/vttablet/tabletserver/schema" "vitess.io/vitess/go/vt/vttablet/tabletserver/tabletenv" + "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle" querypb "vitess.io/vitess/go/vt/proto/query" topodatapb "vitess.io/vitess/go/vt/proto/topodata" @@ -218,6 +219,11 @@ func (tqsc *Controller) TopoServer() *topo.Server { return tqsc.TS } +// CheckThrottler is part of the tabletserver.Controller interface +func (tqsc *Controller) CheckThrottler(ctx context.Context, appName string, flags *throttle.CheckFlags) *throttle.CheckResult { + return nil +} + // EnterLameduck implements tabletserver.Controller. func (tqsc *Controller) EnterLameduck() { tqsc.mu.Lock() From 82f967b2845a1a147effde45d0fcd0a8ff9f1687 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Sun, 16 Jul 2023 17:07:50 +0300 Subject: [PATCH 04/15] implement CheckThrottler in FakeTabletManagerClient Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/faketmclient/fake_client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/go/vt/vttablet/faketmclient/fake_client.go b/go/vt/vttablet/faketmclient/fake_client.go index ce4aa55acbb..3e6b27259f7 100644 --- a/go/vt/vttablet/faketmclient/fake_client.go +++ b/go/vt/vttablet/faketmclient/fake_client.go @@ -331,6 +331,12 @@ func (client *FakeTabletManagerClient) RestoreFromBackup(ctx context.Context, ta return &eofEventStream{}, nil } +// Throttler related methods + +func (client *FakeTabletManagerClient) CheckThrottler(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.CheckThrottlerRequest) (*tabletmanagerdatapb.CheckThrottlerResponse, error) { + return &tabletmanagerdatapb.CheckThrottlerResponse{}, nil +} + // // Management related methods // From e6d094f57ae2f233546c4981e54470bc84133aec Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Sun, 16 Jul 2023 18:44:40 +0300 Subject: [PATCH 05/15] Implement CheckThrottler in grpctmserver Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/grpctmserver/server.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/go/vt/vttablet/grpctmserver/server.go b/go/vt/vttablet/grpctmserver/server.go index 3be6c17291b..515bd7ef1b4 100644 --- a/go/vt/vttablet/grpctmserver/server.go +++ b/go/vt/vttablet/grpctmserver/server.go @@ -520,6 +520,13 @@ func (s *server) RestoreFromBackup(request *tabletmanagerdatapb.RestoreFromBacku return s.tm.RestoreFromBackup(ctx, logger, request) } +func (s *server) CheckThrottler(ctx context.Context, request *tabletmanagerdatapb.CheckThrottlerRequest) (response *tabletmanagerdatapb.CheckThrottlerResponse, err error) { + defer s.tm.HandleRPCPanic(ctx, "CheckThrottler", request, response, true /*verbose*/, &err) + ctx = callinfo.GRPCCallInfo(ctx) + response, err = s.tm.CheckThrottler(ctx, request) + return response, err +} + // registration glue func init() { From abeb357677c5c43a408aa6b7cf523cc77177620e Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Sun, 16 Jul 2023 18:45:07 +0300 Subject: [PATCH 06/15] unimplemented fake Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tmrpctest/test_tm_rpc.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/go/vt/vttablet/tmrpctest/test_tm_rpc.go b/go/vt/vttablet/tmrpctest/test_tm_rpc.go index c008b11e612..c79c81aae82 100644 --- a/go/vt/vttablet/tmrpctest/test_tm_rpc.go +++ b/go/vt/vttablet/tmrpctest/test_tm_rpc.go @@ -1271,6 +1271,11 @@ func (fra *fakeRPCTM) RestoreFromBackup(ctx context.Context, logger logutil.Logg return nil } +func (fra *fakeRPCTM) CheckThrottler(ctx context.Context, req *tabletmanagerdatapb.CheckThrottlerRequest) (*tabletmanagerdatapb.CheckThrottlerResponse, error) { + //TODO implement me + panic("implement me") +} + func tmRPCTestRestoreFromBackup(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.RestoreFromBackupRequest) { stream, err := client.RestoreFromBackup(ctx, tablet, req) if err != nil { From 0d343f48583514829ed214a555d44e0734784fd0 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Sun, 16 Jul 2023 18:45:21 +0300 Subject: [PATCH 07/15] invoke gRPC in throttler Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- .../tabletserver/throttle/mysql/probe.go | 3 ++ .../tabletserver/throttle/throttler.go | 29 +++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/go/vt/vttablet/tabletserver/throttle/mysql/probe.go b/go/vt/vttablet/tabletserver/throttle/mysql/probe.go index 5e0dd7fa1fa..53b835497b4 100644 --- a/go/vt/vttablet/tabletserver/throttle/mysql/probe.go +++ b/go/vt/vttablet/tabletserver/throttle/mysql/probe.go @@ -8,12 +8,15 @@ package mysql import ( "fmt" + + topodatapb "vitess.io/vitess/go/vt/proto/topodata" ) // Probe is the minimal configuration required to connect to a MySQL server type Probe struct { Key InstanceKey MetricQuery string + Tablet *topodatapb.Tablet TabletHost string TabletPort int CacheMillis int diff --git a/go/vt/vttablet/tabletserver/throttle/throttler.go b/go/vt/vttablet/tabletserver/throttle/throttler.go index ce4c265fa78..9473a6530ad 100644 --- a/go/vt/vttablet/tabletserver/throttle/throttler.go +++ b/go/vt/vttablet/tabletserver/throttle/throttler.go @@ -28,6 +28,7 @@ import ( "vitess.io/vitess/go/timer" "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/logutil" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" topodatapb "vitess.io/vitess/go/vt/proto/topodata" "vitess.io/vitess/go/vt/servenv" "vitess.io/vitess/go/vt/sidecardb" @@ -41,6 +42,7 @@ import ( "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/config" "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/mysql" "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/throttlerapp" + "vitess.io/vitess/go/vt/vttablet/tmclient" ) const ( @@ -123,6 +125,7 @@ type Throttler struct { ts *topo.Server srvTopoServer srvtopo.Server heartbeatWriter heartbeat.HeartbeatWriter + tmClient tmclient.TabletManagerClient // recentCheckTickerValue is an ever increasing number, incrementing once per second. recentCheckTickerValue int64 @@ -434,6 +437,7 @@ func (throttler *Throttler) Open() error { // Throttler. throttler.metricsQuery.Store(sqlparser.BuildParsedQuery(defaultReplicationLagQuery, sidecardb.GetIdentifier()).Query) // default throttler.initConfig() + throttler.tmClient = tmclient.NewTabletManagerClient() throttler.pool.Open(throttler.env.Config().DB.AppWithDB(), throttler.env.Config().DB.DbaWithDB(), throttler.env.Config().DB.AppDebugWithDB()) atomic.StoreInt64(&throttler.isOpen, 1) @@ -499,6 +503,10 @@ func (throttler *Throttler) Close() { throttler.pool.Close() atomic.StoreInt64(&throttler.isOpen, 0) log.Infof("Throttler: finished execution of Close") + + if throttler.tmClient != nil { + throttler.tmClient.Close() + } } func (throttler *Throttler) generateSelfMySQLThrottleMetricFunc(ctx context.Context, probe *mysql.Probe) func() *mysql.MySQLThrottleMetric { @@ -696,6 +704,20 @@ func (throttler *Throttler) generateTabletHTTPProbeFunction(ctx context.Context, mySQLThrottleMetric.ClusterName = clusterName mySQLThrottleMetric.Key = probe.Key + { + req := &tabletmanagerdatapb.CheckThrottlerRequest{AppName: throttlerapp.VitessName.String()} + resp, gRPCErr := throttler.tmClient.CheckThrottler(ctx, probe.Tablet, req) + if gRPCErr == nil { + mySQLThrottleMetric.Value = resp.Value + if resp.Error != "" { + mySQLThrottleMetric.Err = errors.New(resp.Error) + } + return mySQLThrottleMetric + } else { + log.Errorf("error in GRPC call to tablet %v: %v", probe.Tablet.GetAlias(), gRPCErr) + } + } + // Backwards compatibility to v18: if the underlying tablets do not support CheckThrottler gRPC, attempt a HTTP cehck: tabletCheckSelfURL := fmt.Sprintf("http://%s:%d/throttler/check-self?app=%s", probe.TabletHost, probe.TabletPort, throttlerapp.VitessName) resp, err := throttler.httpClient.Get(tabletCheckSelfURL) if err != nil { @@ -766,7 +788,7 @@ func (throttler *Throttler) refreshMySQLInventory(ctx context.Context) error { // distribute the query/threshold from the throttler down to the cluster settings and from there to the probes metricsQuery := throttler.GetMetricsQuery() metricsThreshold := throttler.MetricsThreshold.Load() - addInstanceKey := func(tabletHost string, tabletPort int, key *mysql.InstanceKey, clusterName string, clusterSettings *config.MySQLClusterConfigurationSettings, probes *mysql.Probes) { + addInstanceKey := func(tablet *topodatapb.Tablet, tabletHost string, tabletPort int, key *mysql.InstanceKey, clusterName string, clusterSettings *config.MySQLClusterConfigurationSettings, probes *mysql.Probes) { for _, ignore := range clusterSettings.IgnoreHosts { if strings.Contains(key.StringCode(), ignore) { log.Infof("Throttler: instance key ignored: %+v", key) @@ -780,6 +802,7 @@ func (throttler *Throttler) refreshMySQLInventory(ctx context.Context) error { probe := &mysql.Probe{ Key: *key, + Tablet: tablet, TabletHost: tabletHost, TabletPort: tabletPort, MetricQuery: clusterSettings.MetricQuery, @@ -806,7 +829,7 @@ func (throttler *Throttler) refreshMySQLInventory(ctx context.Context) error { if clusterName == selfStoreName { // special case: just looking at this tablet's MySQL server // We will probe this "cluster" (of one server) is a special way. - addInstanceKey("", 0, mysql.SelfInstanceKey, clusterName, clusterSettings, clusterProbes.InstanceProbes) + addInstanceKey(nil, "", 0, mysql.SelfInstanceKey, clusterName, clusterSettings, clusterProbes.InstanceProbes) throttler.mysqlClusterProbesChan <- clusterProbes return } @@ -827,7 +850,7 @@ func (throttler *Throttler) refreshMySQLInventory(ctx context.Context) error { } if throttler.throttleTabletTypesMap[tablet.Type] { key := mysql.InstanceKey{Hostname: tablet.MysqlHostname, Port: int(tablet.MysqlPort)} - addInstanceKey(tablet.Hostname, int(tablet.PortMap["vt"]), &key, clusterName, clusterSettings, clusterProbes.InstanceProbes) + addInstanceKey(tablet.Tablet, tablet.Hostname, int(tablet.PortMap["vt"]), &key, clusterName, clusterSettings, clusterProbes.InstanceProbes) } } throttler.mysqlClusterProbesChan <- clusterProbes From 58b675d1ae96a5fa0f1d09c8142cb28d67aa40d3 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Sun, 16 Jul 2023 20:15:35 +0300 Subject: [PATCH 08/15] fix error handling; lease heartbeats Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tabletserver/tabletserver.go | 3 ++- go/vt/vttablet/tabletserver/throttle/throttler.go | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/go/vt/vttablet/tabletserver/tabletserver.go b/go/vt/vttablet/tabletserver/tabletserver.go index bfaed3c4a56..11599cafef3 100644 --- a/go/vt/vttablet/tabletserver/tabletserver.go +++ b/go/vt/vttablet/tabletserver/tabletserver.go @@ -1704,7 +1704,8 @@ func (tsv *TabletServer) TopoServer() *topo.Server { // CheckThrottler issues a self check func (tsv *TabletServer) CheckThrottler(ctx context.Context, appName string, flags *throttle.CheckFlags) *throttle.CheckResult { - return tsv.lagThrottler.CheckByType(ctx, appName, "", flags, throttle.ThrottleCheckSelf) + r := tsv.lagThrottler.CheckByType(ctx, appName, "", flags, throttle.ThrottleCheckSelf) + return r } // HandlePanic is part of the queryservice.QueryService interface diff --git a/go/vt/vttablet/tabletserver/throttle/throttler.go b/go/vt/vttablet/tabletserver/throttle/throttler.go index 9473a6530ad..7e58bf6f1b3 100644 --- a/go/vt/vttablet/tabletserver/throttle/throttler.go +++ b/go/vt/vttablet/tabletserver/throttle/throttler.go @@ -709,8 +709,13 @@ func (throttler *Throttler) generateTabletHTTPProbeFunction(ctx context.Context, resp, gRPCErr := throttler.tmClient.CheckThrottler(ctx, probe.Tablet, req) if gRPCErr == nil { mySQLThrottleMetric.Value = resp.Value - if resp.Error != "" { - mySQLThrottleMetric.Err = errors.New(resp.Error) + if resp.StatusCode == http.StatusInternalServerError { + mySQLThrottleMetric.Err = fmt.Errorf("Status code: %d", resp.StatusCode) + } + if resp.RecentlyChecked { + // We have just probed a tablet, and it reported back that someone just recently "check"ed it. + // We therefore renew the heartbeats lease. + go throttler.heartbeatWriter.RequestHeartbeats() } return mySQLThrottleMetric } else { From 4c45a94f354044bfa5ddda047c7a0d8229bd7572 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Mon, 17 Jul 2023 08:38:06 +0300 Subject: [PATCH 09/15] do not log gRPC error as this can bloat the logs Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tabletserver/throttle/throttler.go | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/go/vt/vttablet/tabletserver/throttle/throttler.go b/go/vt/vttablet/tabletserver/throttle/throttler.go index 7e58bf6f1b3..af85c0eb0dc 100644 --- a/go/vt/vttablet/tabletserver/throttle/throttler.go +++ b/go/vt/vttablet/tabletserver/throttle/throttler.go @@ -705,9 +705,8 @@ func (throttler *Throttler) generateTabletHTTPProbeFunction(ctx context.Context, mySQLThrottleMetric.Key = probe.Key { - req := &tabletmanagerdatapb.CheckThrottlerRequest{AppName: throttlerapp.VitessName.String()} - resp, gRPCErr := throttler.tmClient.CheckThrottler(ctx, probe.Tablet, req) - if gRPCErr == nil { + req := &tabletmanagerdatapb.CheckThrottlerRequest{} // We leave AppName empty; it will default to VitessName anyway, and we can save some proto space + if resp, gRPCErr := throttler.tmClient.CheckThrottler(ctx, probe.Tablet, req); gRPCErr == nil { mySQLThrottleMetric.Value = resp.Value if resp.StatusCode == http.StatusInternalServerError { mySQLThrottleMetric.Err = fmt.Errorf("Status code: %d", resp.StatusCode) @@ -718,8 +717,14 @@ func (throttler *Throttler) generateTabletHTTPProbeFunction(ctx context.Context, go throttler.heartbeatWriter.RequestHeartbeats() } return mySQLThrottleMetric - } else { - log.Errorf("error in GRPC call to tablet %v: %v", probe.Tablet.GetAlias(), gRPCErr) + + // } else { + // In v18 we need to be backwards compatible. If we have a gRPC error it might be because the replica is v17 and + // does not support CheckThrottler() RPC. This is why: + // 1. We fall back to HTTP + // 2. We don't log an error (it would just spam the logs) + // In v19 we will remove all HTTP code, and will *potentially* log an error. + // log.Errorf("error in GRPC call to tablet %v: %v", probe.Tablet.GetAlias(), gRPCErr) } } // Backwards compatibility to v18: if the underlying tablets do not support CheckThrottler gRPC, attempt a HTTP cehck: From 469f9625af58f0dd957c18d7cdc5aa82f395666d Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Mon, 17 Jul 2023 08:50:01 +0300 Subject: [PATCH 10/15] tmrpctest unit test for CheckThrottler Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tmrpctest/test_tm_rpc.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/go/vt/vttablet/tmrpctest/test_tm_rpc.go b/go/vt/vttablet/tmrpctest/test_tm_rpc.go index c79c81aae82..00d34293c35 100644 --- a/go/vt/vttablet/tmrpctest/test_tm_rpc.go +++ b/go/vt/vttablet/tmrpctest/test_tm_rpc.go @@ -1272,6 +1272,10 @@ func (fra *fakeRPCTM) RestoreFromBackup(ctx context.Context, logger logutil.Logg } func (fra *fakeRPCTM) CheckThrottler(ctx context.Context, req *tabletmanagerdatapb.CheckThrottlerRequest) (*tabletmanagerdatapb.CheckThrottlerResponse, error) { + if fra.panics { + panic(fmt.Errorf("test-triggered panic")) + } + //TODO implement me panic("implement me") } @@ -1297,6 +1301,11 @@ func tmRPCTestRestoreFromBackupPanic(ctx context.Context, t *testing.T, client t expectHandleRPCPanic(t, "RestoreFromBackup", true /*verbose*/, err) } +func tmRPCTestCheckThrottler(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.CheckThrottlerRequest) { + _, err := client.CheckThrottler(ctx, tablet, req) + expectHandleRPCPanic(t, "CheckThrottler", true /*verbose*/, err) +} + // // RPC helpers // @@ -1321,6 +1330,9 @@ func Run(t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.T restoreFromBackupRequest := &tabletmanagerdatapb.RestoreFromBackupRequest{ BackupTime: protoutil.TimeToProto(time.Time{}), } + checkThrottlerRequest := &tabletmanagerdatapb.CheckThrottlerRequest{ + AppName: "test", + } // Test RPC specific methods of the interface. tmRPCTestDialExpiredContext(ctx, t, client, tablet) @@ -1378,6 +1390,9 @@ func Run(t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.T tmRPCTestBackup(ctx, t, client, tablet) tmRPCTestRestoreFromBackup(ctx, t, client, tablet, restoreFromBackupRequest) + // Throttler related methods + tmRPCTestCheckThrottler(ctx, t, client, tablet, checkThrottlerRequest) + // // Tests panic handling everywhere now // From abef2c889ab0351255425871a6ceef99e9a468ef Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Tue, 18 Jul 2023 08:43:57 +0300 Subject: [PATCH 11/15] create tmClient on the fly Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tabletserver/throttle/throttler.go | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/go/vt/vttablet/tabletserver/throttle/throttler.go b/go/vt/vttablet/tabletserver/throttle/throttler.go index af85c0eb0dc..b3430930dd6 100644 --- a/go/vt/vttablet/tabletserver/throttle/throttler.go +++ b/go/vt/vttablet/tabletserver/throttle/throttler.go @@ -125,7 +125,6 @@ type Throttler struct { ts *topo.Server srvTopoServer srvtopo.Server heartbeatWriter heartbeat.HeartbeatWriter - tmClient tmclient.TabletManagerClient // recentCheckTickerValue is an ever increasing number, incrementing once per second. recentCheckTickerValue int64 @@ -437,7 +436,6 @@ func (throttler *Throttler) Open() error { // Throttler. throttler.metricsQuery.Store(sqlparser.BuildParsedQuery(defaultReplicationLagQuery, sidecardb.GetIdentifier()).Query) // default throttler.initConfig() - throttler.tmClient = tmclient.NewTabletManagerClient() throttler.pool.Open(throttler.env.Config().DB.AppWithDB(), throttler.env.Config().DB.DbaWithDB(), throttler.env.Config().DB.AppDebugWithDB()) atomic.StoreInt64(&throttler.isOpen, 1) @@ -503,10 +501,6 @@ func (throttler *Throttler) Close() { throttler.pool.Close() atomic.StoreInt64(&throttler.isOpen, 0) log.Infof("Throttler: finished execution of Close") - - if throttler.tmClient != nil { - throttler.tmClient.Close() - } } func (throttler *Throttler) generateSelfMySQLThrottleMetricFunc(ctx context.Context, probe *mysql.Probe) func() *mysql.MySQLThrottleMetric { @@ -697,7 +691,7 @@ func (throttler *Throttler) Operate(ctx context.Context) { }() } -func (throttler *Throttler) generateTabletHTTPProbeFunction(ctx context.Context, clusterName string, probe *mysql.Probe) (probeFunc func() *mysql.MySQLThrottleMetric) { +func (throttler *Throttler) generateTabletHTTPProbeFunction(ctx context.Context, tmClient tmclient.TabletManagerClient, clusterName string, probe *mysql.Probe) (probeFunc func() *mysql.MySQLThrottleMetric) { return func() *mysql.MySQLThrottleMetric { // Hit a tablet's `check-self` via HTTP, and convert its CheckResult JSON output into a MySQLThrottleMetric mySQLThrottleMetric := mysql.NewMySQLThrottleMetric() @@ -706,7 +700,7 @@ func (throttler *Throttler) generateTabletHTTPProbeFunction(ctx context.Context, { req := &tabletmanagerdatapb.CheckThrottlerRequest{} // We leave AppName empty; it will default to VitessName anyway, and we can save some proto space - if resp, gRPCErr := throttler.tmClient.CheckThrottler(ctx, probe.Tablet, req); gRPCErr == nil { + if resp, gRPCErr := tmClient.CheckThrottler(ctx, probe.Tablet, req); gRPCErr == nil { mySQLThrottleMetric.Value = resp.Value if resp.StatusCode == http.StatusInternalServerError { mySQLThrottleMetric.Err = fmt.Errorf("Status code: %d", resp.StatusCode) @@ -760,6 +754,9 @@ func (throttler *Throttler) generateTabletHTTPProbeFunction(ctx context.Context, } func (throttler *Throttler) collectMySQLMetrics(ctx context.Context) error { + tmClient := tmclient.NewTabletManagerClient() + defer tmClient.Close() + // synchronously, get lists of probes for clusterName, probes := range throttler.mysqlInventory.ClustersProbes { clusterName := clusterName @@ -781,7 +778,7 @@ func (throttler *Throttler) collectMySQLMetrics(ctx context.Context) error { if clusterName == selfStoreName { throttleMetricFunc = throttler.generateSelfMySQLThrottleMetricFunc(ctx, probe) } else { - throttleMetricFunc = throttler.generateTabletHTTPProbeFunction(ctx, clusterName, probe) + throttleMetricFunc = throttler.generateTabletHTTPProbeFunction(ctx, tmClient, clusterName, probe) } throttleMetrics := mysql.ReadThrottleMetric(probe, clusterName, throttleMetricFunc) throttler.mysqlThrottleMetricChan <- throttleMetrics From 59d845b3762a206e7da58d909b1837050e5bbcf0 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Tue, 18 Jul 2023 08:44:12 +0300 Subject: [PATCH 12/15] implement CheckThrottler Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tabletmanager/vdiff/framework_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/go/vt/vttablet/tabletmanager/vdiff/framework_test.go b/go/vt/vttablet/tabletmanager/vdiff/framework_test.go index bbda63340de..3e6236fa244 100644 --- a/go/vt/vttablet/tabletmanager/vdiff/framework_test.go +++ b/go/vt/vttablet/tabletmanager/vdiff/framework_test.go @@ -478,6 +478,10 @@ func (tmc *fakeTMClient) PrimaryPosition(ctx context.Context, tablet *topodatapb return pos, nil } +func (tmc *fakeTMClient) CheckThrottler(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.CheckThrottlerRequest) (*tabletmanagerdatapb.CheckThrottlerResponse, error) { + return &tabletmanagerdatapb.CheckThrottlerResponse{}, nil +} + // ---------------------------------------------- // testVDiffEnv From 04523f527b0be5b23fcb47ad16509897f9a9d2b7 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Tue, 18 Jul 2023 10:05:16 +0300 Subject: [PATCH 13/15] only create tmClient once, in Operate() Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tabletserver/throttle/throttler.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/go/vt/vttablet/tabletserver/throttle/throttler.go b/go/vt/vttablet/tabletserver/throttle/throttler.go index b3430930dd6..76157746ce1 100644 --- a/go/vt/vttablet/tabletserver/throttle/throttler.go +++ b/go/vt/vttablet/tabletserver/throttle/throttler.go @@ -590,6 +590,9 @@ func (throttler *Throttler) Operate(ctx context.Context) { throttledAppsTicker := addTicker(throttledAppsSnapshotInterval) recentCheckTicker := addTicker(time.Second) + tmClient := tmclient.NewTabletManagerClient() + defer tmClient.Close() + go func() { defer log.Infof("Throttler: Operate terminated, tickers stopped") for _, t := range tickers { @@ -639,7 +642,7 @@ func (throttler *Throttler) Operate(ctx context.Context) { if throttler.IsOpen() { // frequent if !throttler.isDormant() { - throttler.collectMySQLMetrics(ctx) + throttler.collectMySQLMetrics(ctx, tmClient) } } } @@ -648,7 +651,7 @@ func (throttler *Throttler) Operate(ctx context.Context) { if throttler.IsOpen() { // infrequent if throttler.isDormant() { - throttler.collectMySQLMetrics(ctx) + throttler.collectMySQLMetrics(ctx, tmClient) } } } @@ -753,10 +756,7 @@ func (throttler *Throttler) generateTabletHTTPProbeFunction(ctx context.Context, } } -func (throttler *Throttler) collectMySQLMetrics(ctx context.Context) error { - tmClient := tmclient.NewTabletManagerClient() - defer tmClient.Close() - +func (throttler *Throttler) collectMySQLMetrics(ctx context.Context, tmClient tmclient.TabletManagerClient) error { // synchronously, get lists of probes for clusterName, probes := range throttler.mysqlInventory.ClustersProbes { clusterName := clusterName From 01183bb016b66a516409335a61293dce2985c08e Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Mon, 31 Jul 2023 09:10:46 +0300 Subject: [PATCH 14/15] license year Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tabletmanager/rpc_throttler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/vt/vttablet/tabletmanager/rpc_throttler.go b/go/vt/vttablet/tabletmanager/rpc_throttler.go index 47d4faa366e..dfdc0d230fb 100644 --- a/go/vt/vttablet/tabletmanager/rpc_throttler.go +++ b/go/vt/vttablet/tabletmanager/rpc_throttler.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Vitess Authors. +Copyright 2023 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. From 3f1f6dee738b12f43b9057299e2536bd7b9322b1 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Tue, 1 Aug 2023 05:48:22 +0300 Subject: [PATCH 15/15] fix comment Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tabletserver/throttle/throttler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/vt/vttablet/tabletserver/throttle/throttler.go b/go/vt/vttablet/tabletserver/throttle/throttler.go index 3d3f0b39d35..125f361e7cc 100644 --- a/go/vt/vttablet/tabletserver/throttle/throttler.go +++ b/go/vt/vttablet/tabletserver/throttle/throttler.go @@ -730,7 +730,7 @@ func (throttler *Throttler) generateTabletHTTPProbeFunction(ctx context.Context, // log.Errorf("error in GRPC call to tablet %v: %v", probe.Tablet.GetAlias(), gRPCErr) } } - // Backwards compatibility to v18: if the underlying tablets do not support CheckThrottler gRPC, attempt a HTTP cehck: + // Backwards compatibility to v17: if the underlying tablets do not support CheckThrottler gRPC, attempt a HTTP cehck: tabletCheckSelfURL := fmt.Sprintf("http://%s:%d/throttler/check-self?app=%s", probe.TabletHost, probe.TabletPort, throttlerapp.VitessName) resp, err := throttler.httpClient.Get(tabletCheckSelfURL) if err != nil {