diff --git a/go/cmd/vtctldclient/command/framework_test.go b/go/cmd/vtctldclient/command/framework_test.go index b4c06cdd014..6abbb805a35 100644 --- a/go/cmd/vtctldclient/command/framework_test.go +++ b/go/cmd/vtctldclient/command/framework_test.go @@ -218,7 +218,7 @@ func (ft *FakeTablet) StartActionLoop(t *testing.T, ts *topo.Server) { ft.Tablet = ft.TM.Tablet() // Register the gRPC server, and starts listening. - grpctmserver.RegisterForTest(ft.RPCServer, ft.TM) + grpctmserver.RegisterForTest(ft.RPCServer, ft.TM, nil) go ft.RPCServer.Serve(ft.Listener) // And wait for it to serve, so we don't start using it before it's diff --git a/go/test/endtoend/cluster/cluster_util.go b/go/test/endtoend/cluster/cluster_util.go index c514aaf2e2c..11724903964 100644 --- a/go/test/endtoend/cluster/cluster_util.go +++ b/go/test/endtoend/cluster/cluster_util.go @@ -27,21 +27,19 @@ import ( "testing" "time" + "github.com/buger/jsonparser" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "google.golang.org/grpc" + "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/vt/grpcclient" "vitess.io/vitess/go/vt/log" replicationdatapb "vitess.io/vitess/go/vt/proto/replicationdata" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" "vitess.io/vitess/go/vt/vtgate/grpcvtgateconn" - - "github.com/buger/jsonparser" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/vt/vtgate/vtgateconn" - - topodatapb "vitess.io/vitess/go/vt/proto/topodata" tmc "vitess.io/vitess/go/vt/vttablet/grpctmclient" ) @@ -104,10 +102,10 @@ func GetPrimaryPosition(t *testing.T, vttablet Vttablet, hostname string) (strin } // FullStatus gets the full status from the given tablet. -func FullStatus(t *testing.T, vttablet *Vttablet, hostname string) *replicationdatapb.FullStatus { +func FullStatus(t *testing.T, vttablet *Vttablet, hostname string, req *tabletmanagerdatapb.FullStatusRequest) *replicationdatapb.FullStatus { ctx := t.Context() vtablet := getTablet(vttablet.GrpcPort, hostname) - status, err := tmClient.FullStatus(ctx, vtablet) + status, err := tmClient.FullStatus(ctx, vtablet, req) require.NoError(t, err) return status } diff --git a/go/test/endtoend/reparent/plannedreparent/reparent_test.go b/go/test/endtoend/reparent/plannedreparent/reparent_test.go index be17e1ed440..a7c4239a1c2 100644 --- a/go/test/endtoend/reparent/plannedreparent/reparent_test.go +++ b/go/test/endtoend/reparent/plannedreparent/reparent_test.go @@ -34,7 +34,11 @@ import ( "vitess.io/vitess/go/test/endtoend/reparent/utils" "vitess.io/vitess/go/vt/log" replicationdatapb "vitess.io/vitess/go/vt/proto/replicationdata" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" + "vitess.io/vitess/go/vt/topo" "vitess.io/vitess/go/vt/vtctl/reparentutil/policy" + "vitess.io/vitess/go/vt/vttablet/grpctmclient" ) func TestPrimaryToSpareStateChangeImpossible(t *testing.T) { @@ -567,6 +571,53 @@ func TestFullStatus(t *testing.T) { assert.True(t, replicaStatus.LogBinEnabled) assert.Regexp(t, `[58]\.[074].*`, replicaStatus.Version) assert.NotEmpty(t, replicaStatus.VersionComment) + + vttabletVersion, err := cluster.GetMajorVersion("vttablet") + require.NoError(t, err) + + // Support for proxying FullStatus RPCs was added in v24 + if vttabletVersion >= 24 { + primary, err := clusterInstance.VtctldClientProcess.GetTablet(primaryTablet.Alias) + assert.NoError(t, err) + replica, err := clusterInstance.VtctldClientProcess.GetTablet(replicaTablet.Alias) + assert.NoError(t, err) + + c := grpctmclient.NewClient() + + // test a proxied request success from primary -> replica + proxiedResp, err := c.FullStatus(t.Context(), primary, &tabletmanagerdatapb.FullStatusRequest{ + ProxyTarget: replica, + }) + assert.NoError(t, err) + assert.NotNil(t, proxiedResp) + assert.Equal(t, topodatapb.TabletType_REPLICA, proxiedResp.TabletType) + assert.True(t, proxiedResp.ReadOnly) + assert.NotEqual(t, primaryStatus.ServerId, proxiedResp.ServerId) + assert.NotEqual(t, primaryStatus.ServerUuid, proxiedResp.ServerUuid) + + // test a proxied request failure to primary -> replica #1 + proxiedResp, err = c.FullStatus(t.Context(), primary, &tabletmanagerdatapb.FullStatusRequest{ + ProxyTarget: primary, + }) + assert.ErrorContains(t, err, "cannot use proxying tablet as a proxy target") + assert.Nil(t, proxiedResp) + + // test a proxied request failure to primary -> replica #2 + proxiedResp, err = c.FullStatus(t.Context(), primary, &tabletmanagerdatapb.FullStatusRequest{ + ProxiedBy: primary.Alias, + ProxyTarget: replica, + }) + assert.ErrorContains(t, err, "cannot proxy a request that is already proxied") + assert.Nil(t, proxiedResp) + + // test a proxied request failure to primary -> replica #3 + proxiedResp, err = c.FullStatus(t.Context(), primary, &tabletmanagerdatapb.FullStatusRequest{ + ProxyTarget: replica, + ProxyTimeoutMs: uint64(topo.RemoteOperationTimeout.Milliseconds()) + 100, + }) + assert.ErrorContains(t, err, "cannot set a proxy timeout ms greater than") + assert.Nil(t, proxiedResp) + } } func getFullStatus(t *testing.T, clusterInstance *cluster.LocalProcessCluster, tablet *cluster.Vttablet) *replicationdatapb.FullStatus { diff --git a/go/test/endtoend/tabletmanager/main_test.go b/go/test/endtoend/tabletmanager/main_test.go index ef0a9df49d3..581c458ea1f 100644 --- a/go/test/endtoend/tabletmanager/main_test.go +++ b/go/test/endtoend/tabletmanager/main_test.go @@ -28,6 +28,7 @@ import ( "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/test/endtoend/cluster" replicationdatapb "vitess.io/vitess/go/vt/proto/replicationdata" + "vitess.io/vitess/go/vt/proto/tabletmanagerdata" tabletpb "vitess.io/vitess/go/vt/proto/topodata" "vitess.io/vitess/go/vt/utils" tmc "vitess.io/vitess/go/vt/vttablet/grpctmclient" @@ -197,9 +198,9 @@ func tmcStartReplicationUntilAfter(ctx context.Context, tabletGrpcPort int, posi return tmClient.StartReplicationUntilAfter(ctx, vtablet, positon, waittime) } -func tmcFullStatus(ctx context.Context, tabletGrpcPort int) (*replicationdatapb.FullStatus, error) { +func tmcFullStatus(ctx context.Context, tabletGrpcPort int, req *tabletmanagerdata.FullStatusRequest) (*replicationdatapb.FullStatus, error) { vtablet := getTablet(tabletGrpcPort) - return tmClient.FullStatus(ctx, vtablet) + return tmClient.FullStatus(ctx, vtablet, req) } func tmcStopReplicationAndGetStatus(ctx context.Context, tabletGrpcPort int, mode replicationdatapb.StopReplicationMode) (*replicationdatapb.StopReplicationStatus, error) { diff --git a/go/test/endtoend/tabletmanager/tablet_test.go b/go/test/endtoend/tabletmanager/tablet_test.go index 0254876a6da..a89e9a81ab4 100644 --- a/go/test/endtoend/tabletmanager/tablet_test.go +++ b/go/test/endtoend/tabletmanager/tablet_test.go @@ -94,7 +94,7 @@ func TestGRPCErrorCode_UNAVAILABLE(t *testing.T) { // because this will try and fail to connect to mysql ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) defer cancel() - _, err = tmcFullStatus(ctx, tablet.GrpcPort) + _, err = tmcFullStatus(ctx, tablet.GrpcPort, nil) assert.Equal(t, vtrpcpb.Code_UNAVAILABLE, vterrors.Code(err)) } @@ -182,7 +182,7 @@ func TestStopReplicationAndGetStatus(t *testing.T) { require.EventuallyWithT(t, func(c *assert.CollectT) { ctx, cancel := context.WithTimeout(t.Context(), time.Second*10) defer cancel() - resp, err := tmcFullStatus(ctx, tablet.GrpcPort) + resp, err := tmcFullStatus(ctx, tablet.GrpcPort, nil) require.NoError(c, err) require.True(c, resp.SemiSyncReplicaEnabled) require.True(c, resp.SemiSyncReplicaStatus) diff --git a/go/test/endtoend/vtorc/general/vtorc_test.go b/go/test/endtoend/vtorc/general/vtorc_test.go index cccae8209cf..4d3d5548965 100644 --- a/go/test/endtoend/vtorc/general/vtorc_test.go +++ b/go/test/endtoend/vtorc/general/vtorc_test.go @@ -360,7 +360,7 @@ func TestVTOrcRepairs(t *testing.T) { // Wait for VTOrc to detect the mismatch and promote the tablet. require.Eventuallyf(t, func() bool { - fs := cluster.FullStatus(t, replica, clusterInfo.ClusterInstance.Hostname) + fs := cluster.FullStatus(t, replica, clusterInfo.ClusterInstance.Hostname, nil) return fs.TabletType == topodatapb.TabletType_PRIMARY }, 10*time.Second, 1*time.Second, "Primary tablet's display type didn't match the topo record") // Also check that the replica gets promoted and can accept writes. diff --git a/go/test/fuzzing/vttablet_fuzzer.go b/go/test/fuzzing/vttablet_fuzzer.go index ffb34c7d8a3..f1ea5dbaf62 100644 --- a/go/test/fuzzing/vttablet_fuzzer.go +++ b/go/test/fuzzing/vttablet_fuzzer.go @@ -709,7 +709,7 @@ func FuzzGRPCTMServer(data []byte) int { } s := grpc.NewServer() fakeTM := tmrpctest.NewFakeRPCTM(t) - grpctmserver.RegisterForTest(s, fakeTM) + grpctmserver.RegisterForTest(s, fakeTM, nil) go s.Serve(listener) defer s.Stop() diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go index aa698707dfb..18f01aa5373 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go @@ -4772,7 +4772,15 @@ func (*ResetReplicationParametersResponse) Descriptor() ([]byte, []int) { } type FullStatusRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` + state protoimpl.MessageState `protogen:"open.v1"` + // proxy_target specifies a tablet to proxy the FullStatusResponse from. + ProxyTarget *topodata.Tablet `protobuf:"bytes,1,opt,name=proxy_target,json=proxyTarget,proto3" json:"proxy_target,omitempty"` + // proxy_timeout_ms specifies the maximum number of milliseconds to wait for a + // proxied request to complete. Must be less than topo.RemoteOperationTimeout + // on the tablet proxying the request. + ProxyTimeoutMs uint64 `protobuf:"varint,2,opt,name=proxy_timeout_ms,json=proxyTimeoutMs,proto3" json:"proxy_timeout_ms,omitempty"` + // proxied_by is set to the tablet alias that proxied a FullStatusRequest. + ProxiedBy *topodata.TabletAlias `protobuf:"bytes,3,opt,name=proxied_by,json=proxiedBy,proto3" json:"proxied_by,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -4807,6 +4815,27 @@ func (*FullStatusRequest) Descriptor() ([]byte, []int) { return file_tabletmanagerdata_proto_rawDescGZIP(), []int{100} } +func (x *FullStatusRequest) GetProxyTarget() *topodata.Tablet { + if x != nil { + return x.ProxyTarget + } + return nil +} + +func (x *FullStatusRequest) GetProxyTimeoutMs() uint64 { + if x != nil { + return x.ProxyTimeoutMs + } + return 0 +} + +func (x *FullStatusRequest) GetProxiedBy() *topodata.TabletAlias { + if x != nil { + return x.ProxiedBy + } + return nil +} + type FullStatusResponse struct { state protoimpl.MessageState `protogen:"open.v1"` Status *replicationdata.FullStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` @@ -8783,8 +8812,12 @@ const file_tabletmanagerdata_proto_rawDesc = "" + "\x19ReplicaWasPromotedRequest\"\x1c\n" + "\x1aReplicaWasPromotedResponse\"#\n" + "!ResetReplicationParametersRequest\"$\n" + - "\"ResetReplicationParametersResponse\"\x13\n" + - "\x11FullStatusRequest\"I\n" + + "\"ResetReplicationParametersResponse\"\xa8\x01\n" + + "\x11FullStatusRequest\x123\n" + + "\fproxy_target\x18\x01 \x01(\v2\x10.topodata.TabletR\vproxyTarget\x12(\n" + + "\x10proxy_timeout_ms\x18\x02 \x01(\x04R\x0eproxyTimeoutMs\x124\n" + + "\n" + + "proxied_by\x18\x03 \x01(\v2\x15.topodata.TabletAliasR\tproxiedBy\"I\n" + "\x12FullStatusResponse\x123\n" + "\x06status\x18\x01 \x01(\v2\x1b.replicationdata.FullStatusR\x06status\"\x9c\x02\n" + "\x1bSetReplicationSourceRequest\x12-\n" + @@ -9327,19 +9360,20 @@ var file_tabletmanagerdata_proto_goTypes = []any{ (*replicationdata.Status)(nil), // 184: replicationdata.Status (*replicationdata.PrimaryStatus)(nil), // 185: replicationdata.PrimaryStatus (*topodata.TabletAlias)(nil), // 186: topodata.TabletAlias - (*replicationdata.FullStatus)(nil), // 187: replicationdata.FullStatus - (replicationdata.StopReplicationMode)(0), // 188: replicationdata.StopReplicationMode - (*replicationdata.StopReplicationStatus)(nil), // 189: replicationdata.StopReplicationStatus - (*vttime.Duration)(nil), // 190: vttime.Duration - (*logutil.Event)(nil), // 191: logutil.Event - (*vttime.Time)(nil), // 192: vttime.Time - (*binlogdata.BinlogSource)(nil), // 193: binlogdata.BinlogSource - (binlogdata.VReplicationWorkflowType)(0), // 194: binlogdata.VReplicationWorkflowType - (binlogdata.VReplicationWorkflowSubType)(0), // 195: binlogdata.VReplicationWorkflowSubType - (binlogdata.VReplicationWorkflowState)(0), // 196: binlogdata.VReplicationWorkflowState - (binlogdata.OnDDLAction)(0), // 197: binlogdata.OnDDLAction - (*binlogdata.Rule)(nil), // 198: binlogdata.Rule - (*topodata.ThrottledAppRule)(nil), // 199: topodata.ThrottledAppRule + (*topodata.Tablet)(nil), // 187: topodata.Tablet + (*replicationdata.FullStatus)(nil), // 188: replicationdata.FullStatus + (replicationdata.StopReplicationMode)(0), // 189: replicationdata.StopReplicationMode + (*replicationdata.StopReplicationStatus)(nil), // 190: replicationdata.StopReplicationStatus + (*vttime.Duration)(nil), // 191: vttime.Duration + (*logutil.Event)(nil), // 192: logutil.Event + (*vttime.Time)(nil), // 193: vttime.Time + (*binlogdata.BinlogSource)(nil), // 194: binlogdata.BinlogSource + (binlogdata.VReplicationWorkflowType)(0), // 195: binlogdata.VReplicationWorkflowType + (binlogdata.VReplicationWorkflowSubType)(0), // 196: binlogdata.VReplicationWorkflowSubType + (binlogdata.VReplicationWorkflowState)(0), // 197: binlogdata.VReplicationWorkflowState + (binlogdata.OnDDLAction)(0), // 198: binlogdata.OnDDLAction + (*binlogdata.Rule)(nil), // 199: binlogdata.Rule + (*topodata.ThrottledAppRule)(nil), // 200: topodata.ThrottledAppRule } var file_tabletmanagerdata_proto_depIdxs = []int32{ 178, // 0: tabletmanagerdata.TableDefinition.fields:type_name -> query.Field @@ -9375,85 +9409,87 @@ var file_tabletmanagerdata_proto_depIdxs = []int32{ 186, // 30: tabletmanagerdata.PopulateReparentJournalRequest.primary_alias:type_name -> topodata.TabletAlias 186, // 31: tabletmanagerdata.InitReplicaRequest.parent:type_name -> topodata.TabletAlias 185, // 32: tabletmanagerdata.DemotePrimaryResponse.primary_status:type_name -> replicationdata.PrimaryStatus - 187, // 33: tabletmanagerdata.FullStatusResponse.status:type_name -> replicationdata.FullStatus - 186, // 34: tabletmanagerdata.SetReplicationSourceRequest.parent:type_name -> topodata.TabletAlias - 186, // 35: tabletmanagerdata.ReplicaWasRestartedRequest.parent:type_name -> topodata.TabletAlias - 188, // 36: tabletmanagerdata.StopReplicationAndGetStatusRequest.stop_replication_mode:type_name -> replicationdata.StopReplicationMode - 189, // 37: tabletmanagerdata.StopReplicationAndGetStatusResponse.status:type_name -> replicationdata.StopReplicationStatus - 190, // 38: tabletmanagerdata.BackupRequest.mysql_shutdown_timeout:type_name -> vttime.Duration - 157, // 39: tabletmanagerdata.BackupRequest.init_sql:type_name -> tabletmanagerdata.BackupRequest.InitSQL - 191, // 40: tabletmanagerdata.BackupResponse.event:type_name -> logutil.Event - 192, // 41: tabletmanagerdata.RestoreFromBackupRequest.backup_time:type_name -> vttime.Time - 192, // 42: tabletmanagerdata.RestoreFromBackupRequest.restore_to_timestamp:type_name -> vttime.Time - 191, // 43: tabletmanagerdata.RestoreFromBackupResponse.event:type_name -> logutil.Event - 193, // 44: tabletmanagerdata.CreateVReplicationWorkflowRequest.binlog_source:type_name -> binlogdata.BinlogSource - 179, // 45: tabletmanagerdata.CreateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType - 0, // 46: tabletmanagerdata.CreateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 194, // 47: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_type:type_name -> binlogdata.VReplicationWorkflowType - 195, // 48: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType - 181, // 49: tabletmanagerdata.CreateVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 158, // 50: tabletmanagerdata.DeleteTableDataRequest.table_filters:type_name -> tabletmanagerdata.DeleteTableDataRequest.TableFiltersEntry - 181, // 51: tabletmanagerdata.DeleteVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 196, // 52: tabletmanagerdata.ReadVReplicationWorkflowsRequest.include_states:type_name -> binlogdata.VReplicationWorkflowState - 196, // 53: tabletmanagerdata.ReadVReplicationWorkflowsRequest.exclude_states:type_name -> binlogdata.VReplicationWorkflowState - 127, // 54: tabletmanagerdata.ReadVReplicationWorkflowsResponse.workflows:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse - 179, // 55: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types:type_name -> topodata.TabletType - 0, // 56: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 194, // 57: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_type:type_name -> binlogdata.VReplicationWorkflowType - 195, // 58: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType - 159, // 59: tabletmanagerdata.ReadVReplicationWorkflowResponse.streams:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - 160, // 60: tabletmanagerdata.ReadVReplicationWorkflowResponse.config_overrides:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse.ConfigOverridesEntry - 135, // 61: tabletmanagerdata.VDiffRequest.options:type_name -> tabletmanagerdata.VDiffOptions - 181, // 62: tabletmanagerdata.VDiffResponse.output:type_name -> query.QueryResult - 132, // 63: tabletmanagerdata.VDiffOptions.picker_options:type_name -> tabletmanagerdata.VDiffPickerOptions - 134, // 64: tabletmanagerdata.VDiffOptions.core_options:type_name -> tabletmanagerdata.VDiffCoreOptions - 133, // 65: tabletmanagerdata.VDiffOptions.report_options:type_name -> tabletmanagerdata.VDiffReportOptions - 181, // 66: tabletmanagerdata.VDiffTableLastPK.target:type_name -> query.QueryResult - 181, // 67: tabletmanagerdata.VDiffTableLastPK.source:type_name -> query.QueryResult - 179, // 68: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType - 0, // 69: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 197, // 70: tabletmanagerdata.UpdateVReplicationWorkflowRequest.on_ddl:type_name -> binlogdata.OnDDLAction - 196, // 71: tabletmanagerdata.UpdateVReplicationWorkflowRequest.state:type_name -> binlogdata.VReplicationWorkflowState - 161, // 72: tabletmanagerdata.UpdateVReplicationWorkflowRequest.config_overrides:type_name -> tabletmanagerdata.UpdateVReplicationWorkflowRequest.ConfigOverridesEntry - 198, // 73: tabletmanagerdata.UpdateVReplicationWorkflowRequest.filter_rules:type_name -> binlogdata.Rule - 181, // 74: tabletmanagerdata.UpdateVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 196, // 75: tabletmanagerdata.UpdateVReplicationWorkflowsRequest.state:type_name -> binlogdata.VReplicationWorkflowState - 181, // 76: tabletmanagerdata.UpdateVReplicationWorkflowsResponse.result:type_name -> query.QueryResult - 163, // 77: tabletmanagerdata.CheckThrottlerResponse.metrics:type_name -> tabletmanagerdata.CheckThrottlerResponse.MetricsEntry - 1, // 78: tabletmanagerdata.CheckThrottlerResponse.response_code:type_name -> tabletmanagerdata.CheckThrottlerResponseCode - 165, // 79: tabletmanagerdata.GetThrottlerStatusResponse.aggregated_metrics:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.AggregatedMetricsEntry - 166, // 80: tabletmanagerdata.GetThrottlerStatusResponse.metric_thresholds:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricThresholdsEntry - 168, // 81: tabletmanagerdata.GetThrottlerStatusResponse.metrics_health:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricsHealthEntry - 169, // 82: tabletmanagerdata.GetThrottlerStatusResponse.throttled_apps:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.ThrottledAppsEntry - 170, // 83: tabletmanagerdata.GetThrottlerStatusResponse.app_checked_metrics:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.AppCheckedMetricsEntry - 172, // 84: tabletmanagerdata.GetThrottlerStatusResponse.recent_apps:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.RecentAppsEntry - 173, // 85: tabletmanagerdata.ChangeTagsRequest.tags:type_name -> tabletmanagerdata.ChangeTagsRequest.TagsEntry - 174, // 86: tabletmanagerdata.ChangeTagsResponse.tags:type_name -> tabletmanagerdata.ChangeTagsResponse.TagsEntry - 175, // 87: tabletmanagerdata.UpdateSequenceTablesRequest.sequences:type_name -> tabletmanagerdata.UpdateSequenceTablesRequest.SequenceMetadata - 176, // 88: tabletmanagerdata.GetMaxValueForSequencesRequest.sequences:type_name -> tabletmanagerdata.GetMaxValueForSequencesRequest.SequenceMetadata - 177, // 89: tabletmanagerdata.GetMaxValueForSequencesResponse.max_values_by_sequence_table:type_name -> tabletmanagerdata.GetMaxValueForSequencesResponse.MaxValuesBySequenceTableEntry - 179, // 90: tabletmanagerdata.BackupRequest.InitSQL.tablet_types:type_name -> topodata.TabletType - 190, // 91: tabletmanagerdata.BackupRequest.InitSQL.timeout:type_name -> vttime.Duration - 193, // 92: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.bls:type_name -> binlogdata.BinlogSource - 192, // 93: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_updated:type_name -> vttime.Time - 192, // 94: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.transaction_timestamp:type_name -> vttime.Time - 196, // 95: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.state:type_name -> binlogdata.VReplicationWorkflowState - 192, // 96: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_heartbeat:type_name -> vttime.Time - 192, // 97: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_throttled:type_name -> vttime.Time - 1, // 98: tabletmanagerdata.CheckThrottlerResponse.Metric.response_code:type_name -> tabletmanagerdata.CheckThrottlerResponseCode - 162, // 99: tabletmanagerdata.CheckThrottlerResponse.MetricsEntry.value:type_name -> tabletmanagerdata.CheckThrottlerResponse.Metric - 164, // 100: tabletmanagerdata.GetThrottlerStatusResponse.AggregatedMetricsEntry.value:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricResult - 192, // 101: tabletmanagerdata.GetThrottlerStatusResponse.MetricHealth.last_healthy_at:type_name -> vttime.Time - 167, // 102: tabletmanagerdata.GetThrottlerStatusResponse.MetricsHealthEntry.value:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricHealth - 199, // 103: tabletmanagerdata.GetThrottlerStatusResponse.ThrottledAppsEntry.value:type_name -> topodata.ThrottledAppRule - 192, // 104: tabletmanagerdata.GetThrottlerStatusResponse.RecentApp.checked_at:type_name -> vttime.Time - 1, // 105: tabletmanagerdata.GetThrottlerStatusResponse.RecentApp.response_code:type_name -> tabletmanagerdata.CheckThrottlerResponseCode - 171, // 106: tabletmanagerdata.GetThrottlerStatusResponse.RecentAppsEntry.value:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.RecentApp - 107, // [107:107] is the sub-list for method output_type - 107, // [107:107] is the sub-list for method input_type - 107, // [107:107] is the sub-list for extension type_name - 107, // [107:107] is the sub-list for extension extendee - 0, // [0:107] is the sub-list for field type_name + 187, // 33: tabletmanagerdata.FullStatusRequest.proxy_target:type_name -> topodata.Tablet + 186, // 34: tabletmanagerdata.FullStatusRequest.proxied_by:type_name -> topodata.TabletAlias + 188, // 35: tabletmanagerdata.FullStatusResponse.status:type_name -> replicationdata.FullStatus + 186, // 36: tabletmanagerdata.SetReplicationSourceRequest.parent:type_name -> topodata.TabletAlias + 186, // 37: tabletmanagerdata.ReplicaWasRestartedRequest.parent:type_name -> topodata.TabletAlias + 189, // 38: tabletmanagerdata.StopReplicationAndGetStatusRequest.stop_replication_mode:type_name -> replicationdata.StopReplicationMode + 190, // 39: tabletmanagerdata.StopReplicationAndGetStatusResponse.status:type_name -> replicationdata.StopReplicationStatus + 191, // 40: tabletmanagerdata.BackupRequest.mysql_shutdown_timeout:type_name -> vttime.Duration + 157, // 41: tabletmanagerdata.BackupRequest.init_sql:type_name -> tabletmanagerdata.BackupRequest.InitSQL + 192, // 42: tabletmanagerdata.BackupResponse.event:type_name -> logutil.Event + 193, // 43: tabletmanagerdata.RestoreFromBackupRequest.backup_time:type_name -> vttime.Time + 193, // 44: tabletmanagerdata.RestoreFromBackupRequest.restore_to_timestamp:type_name -> vttime.Time + 192, // 45: tabletmanagerdata.RestoreFromBackupResponse.event:type_name -> logutil.Event + 194, // 46: tabletmanagerdata.CreateVReplicationWorkflowRequest.binlog_source:type_name -> binlogdata.BinlogSource + 179, // 47: tabletmanagerdata.CreateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType + 0, // 48: tabletmanagerdata.CreateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 195, // 49: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_type:type_name -> binlogdata.VReplicationWorkflowType + 196, // 50: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType + 181, // 51: tabletmanagerdata.CreateVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 158, // 52: tabletmanagerdata.DeleteTableDataRequest.table_filters:type_name -> tabletmanagerdata.DeleteTableDataRequest.TableFiltersEntry + 181, // 53: tabletmanagerdata.DeleteVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 197, // 54: tabletmanagerdata.ReadVReplicationWorkflowsRequest.include_states:type_name -> binlogdata.VReplicationWorkflowState + 197, // 55: tabletmanagerdata.ReadVReplicationWorkflowsRequest.exclude_states:type_name -> binlogdata.VReplicationWorkflowState + 127, // 56: tabletmanagerdata.ReadVReplicationWorkflowsResponse.workflows:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse + 179, // 57: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types:type_name -> topodata.TabletType + 0, // 58: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 195, // 59: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_type:type_name -> binlogdata.VReplicationWorkflowType + 196, // 60: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType + 159, // 61: tabletmanagerdata.ReadVReplicationWorkflowResponse.streams:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + 160, // 62: tabletmanagerdata.ReadVReplicationWorkflowResponse.config_overrides:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse.ConfigOverridesEntry + 135, // 63: tabletmanagerdata.VDiffRequest.options:type_name -> tabletmanagerdata.VDiffOptions + 181, // 64: tabletmanagerdata.VDiffResponse.output:type_name -> query.QueryResult + 132, // 65: tabletmanagerdata.VDiffOptions.picker_options:type_name -> tabletmanagerdata.VDiffPickerOptions + 134, // 66: tabletmanagerdata.VDiffOptions.core_options:type_name -> tabletmanagerdata.VDiffCoreOptions + 133, // 67: tabletmanagerdata.VDiffOptions.report_options:type_name -> tabletmanagerdata.VDiffReportOptions + 181, // 68: tabletmanagerdata.VDiffTableLastPK.target:type_name -> query.QueryResult + 181, // 69: tabletmanagerdata.VDiffTableLastPK.source:type_name -> query.QueryResult + 179, // 70: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType + 0, // 71: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 198, // 72: tabletmanagerdata.UpdateVReplicationWorkflowRequest.on_ddl:type_name -> binlogdata.OnDDLAction + 197, // 73: tabletmanagerdata.UpdateVReplicationWorkflowRequest.state:type_name -> binlogdata.VReplicationWorkflowState + 161, // 74: tabletmanagerdata.UpdateVReplicationWorkflowRequest.config_overrides:type_name -> tabletmanagerdata.UpdateVReplicationWorkflowRequest.ConfigOverridesEntry + 199, // 75: tabletmanagerdata.UpdateVReplicationWorkflowRequest.filter_rules:type_name -> binlogdata.Rule + 181, // 76: tabletmanagerdata.UpdateVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 197, // 77: tabletmanagerdata.UpdateVReplicationWorkflowsRequest.state:type_name -> binlogdata.VReplicationWorkflowState + 181, // 78: tabletmanagerdata.UpdateVReplicationWorkflowsResponse.result:type_name -> query.QueryResult + 163, // 79: tabletmanagerdata.CheckThrottlerResponse.metrics:type_name -> tabletmanagerdata.CheckThrottlerResponse.MetricsEntry + 1, // 80: tabletmanagerdata.CheckThrottlerResponse.response_code:type_name -> tabletmanagerdata.CheckThrottlerResponseCode + 165, // 81: tabletmanagerdata.GetThrottlerStatusResponse.aggregated_metrics:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.AggregatedMetricsEntry + 166, // 82: tabletmanagerdata.GetThrottlerStatusResponse.metric_thresholds:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricThresholdsEntry + 168, // 83: tabletmanagerdata.GetThrottlerStatusResponse.metrics_health:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricsHealthEntry + 169, // 84: tabletmanagerdata.GetThrottlerStatusResponse.throttled_apps:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.ThrottledAppsEntry + 170, // 85: tabletmanagerdata.GetThrottlerStatusResponse.app_checked_metrics:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.AppCheckedMetricsEntry + 172, // 86: tabletmanagerdata.GetThrottlerStatusResponse.recent_apps:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.RecentAppsEntry + 173, // 87: tabletmanagerdata.ChangeTagsRequest.tags:type_name -> tabletmanagerdata.ChangeTagsRequest.TagsEntry + 174, // 88: tabletmanagerdata.ChangeTagsResponse.tags:type_name -> tabletmanagerdata.ChangeTagsResponse.TagsEntry + 175, // 89: tabletmanagerdata.UpdateSequenceTablesRequest.sequences:type_name -> tabletmanagerdata.UpdateSequenceTablesRequest.SequenceMetadata + 176, // 90: tabletmanagerdata.GetMaxValueForSequencesRequest.sequences:type_name -> tabletmanagerdata.GetMaxValueForSequencesRequest.SequenceMetadata + 177, // 91: tabletmanagerdata.GetMaxValueForSequencesResponse.max_values_by_sequence_table:type_name -> tabletmanagerdata.GetMaxValueForSequencesResponse.MaxValuesBySequenceTableEntry + 179, // 92: tabletmanagerdata.BackupRequest.InitSQL.tablet_types:type_name -> topodata.TabletType + 191, // 93: tabletmanagerdata.BackupRequest.InitSQL.timeout:type_name -> vttime.Duration + 194, // 94: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.bls:type_name -> binlogdata.BinlogSource + 193, // 95: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_updated:type_name -> vttime.Time + 193, // 96: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.transaction_timestamp:type_name -> vttime.Time + 197, // 97: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.state:type_name -> binlogdata.VReplicationWorkflowState + 193, // 98: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_heartbeat:type_name -> vttime.Time + 193, // 99: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_throttled:type_name -> vttime.Time + 1, // 100: tabletmanagerdata.CheckThrottlerResponse.Metric.response_code:type_name -> tabletmanagerdata.CheckThrottlerResponseCode + 162, // 101: tabletmanagerdata.CheckThrottlerResponse.MetricsEntry.value:type_name -> tabletmanagerdata.CheckThrottlerResponse.Metric + 164, // 102: tabletmanagerdata.GetThrottlerStatusResponse.AggregatedMetricsEntry.value:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricResult + 193, // 103: tabletmanagerdata.GetThrottlerStatusResponse.MetricHealth.last_healthy_at:type_name -> vttime.Time + 167, // 104: tabletmanagerdata.GetThrottlerStatusResponse.MetricsHealthEntry.value:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricHealth + 200, // 105: tabletmanagerdata.GetThrottlerStatusResponse.ThrottledAppsEntry.value:type_name -> topodata.ThrottledAppRule + 193, // 106: tabletmanagerdata.GetThrottlerStatusResponse.RecentApp.checked_at:type_name -> vttime.Time + 1, // 107: tabletmanagerdata.GetThrottlerStatusResponse.RecentApp.response_code:type_name -> tabletmanagerdata.CheckThrottlerResponseCode + 171, // 108: tabletmanagerdata.GetThrottlerStatusResponse.RecentAppsEntry.value:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.RecentApp + 109, // [109:109] is the sub-list for method output_type + 109, // [109:109] is the sub-list for method input_type + 109, // [109:109] is the sub-list for extension type_name + 109, // [109:109] is the sub-list for extension extendee + 0, // [0:109] is the sub-list for field type_name } func init() { file_tabletmanagerdata_proto_init() } diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go index dbb680eff3c..db6dfe87d49 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go @@ -1879,6 +1879,9 @@ func (m *FullStatusRequest) CloneVT() *FullStatusRequest { return (*FullStatusRequest)(nil) } r := new(FullStatusRequest) + r.ProxyTarget = m.ProxyTarget.CloneVT() + r.ProxyTimeoutMs = m.ProxyTimeoutMs + r.ProxiedBy = m.ProxiedBy.CloneVT() if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -7594,6 +7597,31 @@ func (m *FullStatusRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.ProxiedBy != nil { + size, err := m.ProxiedBy.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1a + } + if m.ProxyTimeoutMs != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ProxyTimeoutMs)) + i-- + dAtA[i] = 0x10 + } + if m.ProxyTarget != nil { + size, err := m.ProxyTarget.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -12789,6 +12817,17 @@ func (m *FullStatusRequest) SizeVT() (n int) { } var l int _ = l + if m.ProxyTarget != nil { + l = m.ProxyTarget.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ProxyTimeoutMs != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ProxyTimeoutMs)) + } + if m.ProxiedBy != nil { + l = m.ProxiedBy.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } n += len(m.unknownFields) return n } @@ -23255,6 +23294,97 @@ func (m *FullStatusRequest) UnmarshalVT(dAtA []byte) error { return fmt.Errorf("proto: FullStatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProxyTarget", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ProxyTarget == nil { + m.ProxyTarget = &topodata.Tablet{} + } + if err := m.ProxyTarget.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProxyTimeoutMs", wireType) + } + m.ProxyTimeoutMs = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProxyTimeoutMs |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProxiedBy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ProxiedBy == nil { + m.ProxiedBy = &topodata.TabletAlias{} + } + if err := m.ProxiedBy.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := protohelpers.Skip(dAtA[iNdEx:]) diff --git a/go/vt/vtcombo/tablet_map.go b/go/vt/vtcombo/tablet_map.go index 0185ab00d42..27509078b45 100644 --- a/go/vt/vtcombo/tablet_map.go +++ b/go/vt/vtcombo/tablet_map.go @@ -1069,7 +1069,7 @@ func (itmc *internalTabletManagerClient) ReplicationStatus(context.Context, *top return nil, errors.New("not implemented in vtcombo") } -func (itmc *internalTabletManagerClient) FullStatus(context.Context, *topodatapb.Tablet) (*replicationdatapb.FullStatus, error) { +func (itmc *internalTabletManagerClient) FullStatus(context.Context, *topodatapb.Tablet, *tabletmanagerdatapb.FullStatusRequest) (*replicationdatapb.FullStatus, error) { return nil, errors.New("not implemented in vtcombo") } diff --git a/go/vt/vtctl/grpcvtctldserver/server.go b/go/vt/vtctl/grpcvtctldserver/server.go index e0a788e1344..5b59cf2f084 100644 --- a/go/vt/vtctl/grpcvtctldserver/server.go +++ b/go/vt/vtctl/grpcvtctldserver/server.go @@ -1642,7 +1642,7 @@ func (s *VtctldServer) GetFullStatus(ctx context.Context, req *vtctldatapb.GetFu return nil, err } - res, err := s.tmc.FullStatus(ctx, ti.Tablet) + res, err := s.tmc.FullStatus(ctx, ti.Tablet, nil /* tabletmanagerpb.FullStatusRequest */) if err != nil { return nil, err } diff --git a/go/vt/vtctl/grpcvtctldserver/testutil/test_tmclient.go b/go/vt/vtctl/grpcvtctldserver/testutil/test_tmclient.go index 055cc466382..21324751e4f 100644 --- a/go/vt/vtctl/grpcvtctldserver/testutil/test_tmclient.go +++ b/go/vt/vtctl/grpcvtctldserver/testutil/test_tmclient.go @@ -745,7 +745,7 @@ func (fake *TabletManagerClient) ConcludeTransaction(ctx context.Context, tablet } // FullStatus is part of the tmclient.TabletManagerClient interface. -func (fake *TabletManagerClient) FullStatus(ctx context.Context, tablet *topodatapb.Tablet) (*replicationdatapb.FullStatus, error) { +func (fake *TabletManagerClient) FullStatus(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.FullStatusRequest) (*replicationdatapb.FullStatus, error) { if fake.FullStatusResult != nil { return fake.FullStatusResult, nil } diff --git a/go/vt/vtorc/inst/instance_dao.go b/go/vt/vtorc/inst/instance_dao.go index 4fc9064ea2a..20365cd4c7c 100644 --- a/go/vt/vtorc/inst/instance_dao.go +++ b/go/vt/vtorc/inst/instance_dao.go @@ -196,7 +196,7 @@ func ReadTopologyInstanceBufferable(tabletAlias string, latency *stopwatch.Named goto Cleanup } - fs, err = fullStatus(tablet) + fs, err = fullStatus(tablet, nil /* proxyTarget */) if err != nil { goto Cleanup } diff --git a/go/vt/vtorc/inst/tablet_dao.go b/go/vt/vtorc/inst/tablet_dao.go index ef4863287d3..c9938be5c9a 100644 --- a/go/vt/vtorc/inst/tablet_dao.go +++ b/go/vt/vtorc/inst/tablet_dao.go @@ -24,8 +24,8 @@ import ( "vitess.io/vitess/go/protoutil" "vitess.io/vitess/go/vt/external/golib/sqlutils" - replicationdatapb "vitess.io/vitess/go/vt/proto/replicationdata" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" topodatapb "vitess.io/vitess/go/vt/proto/topodata" "vitess.io/vitess/go/vt/topo" "vitess.io/vitess/go/vt/topo/topoproto" @@ -36,6 +36,7 @@ import ( // ErrTabletAliasNil is a fixed error message. var ErrTabletAliasNil = errors.New("tablet alias is nil") var tmc tmclient.TabletManagerClient +var tmcProxyTimeout = topo.RemoteOperationTimeout / 2 // InitializeTMC initializes the tablet manager client to use for all VTOrc RPC calls. func InitializeTMC() tmclient.TabletManagerClient { @@ -44,10 +45,15 @@ func InitializeTMC() tmclient.TabletManagerClient { } // fullStatus gets the full status of the MySQL running in vttablet. -func fullStatus(tablet *topodatapb.Tablet) (*replicationdatapb.FullStatus, error) { +func fullStatus(tablet, proxyTarget *topodatapb.Tablet) (*replicationdatapb.FullStatus, error) { tmcCtx, tmcCancel := context.WithTimeout(context.Background(), topo.RemoteOperationTimeout) defer tmcCancel() - return tmc.FullStatus(tmcCtx, tablet) + request := &tabletmanagerdatapb.FullStatusRequest{} + if proxyTarget != nil { + request.ProxyTarget = proxyTarget + request.ProxyTimeoutMs = uint64(tmcProxyTimeout.Milliseconds()) + } + return tmc.FullStatus(tmcCtx, tablet, request) } // ReadTablet reads the vitess tablet record. diff --git a/go/vt/vttablet/faketmclient/fake_client.go b/go/vt/vttablet/faketmclient/fake_client.go index 2378c4acb54..a0130137f3e 100644 --- a/go/vt/vttablet/faketmclient/fake_client.go +++ b/go/vt/vttablet/faketmclient/fake_client.go @@ -259,7 +259,7 @@ func (client *FakeTabletManagerClient) ReplicationStatus(ctx context.Context, ta } // FullStatus is part of the tmclient.TabletManagerClient interface. -func (client *FakeTabletManagerClient) FullStatus(ctx context.Context, tablet *topodatapb.Tablet) (*replicationdatapb.FullStatus, error) { +func (client *FakeTabletManagerClient) FullStatus(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.FullStatusRequest) (*replicationdatapb.FullStatus, error) { return &replicationdatapb.FullStatus{}, nil } diff --git a/go/vt/vttablet/grpctmclient/cached_client_flaky_test.go b/go/vt/vttablet/grpctmclient/cached_client_flaky_test.go index cf002cb7d18..d9916e757ba 100644 --- a/go/vt/vttablet/grpctmclient/cached_client_flaky_test.go +++ b/go/vt/vttablet/grpctmclient/cached_client_flaky_test.go @@ -49,7 +49,7 @@ func grpcTestServer(t testing.TB, tm tabletmanager.RPCTM) (*net.TCPAddr, func()) } s := grpc.NewServer() - grpctmserver.RegisterForTest(s, tm) + grpctmserver.RegisterForTest(s, tm, nil) go s.Serve(lis) var shutdownOnce sync.Once diff --git a/go/vt/vttablet/grpctmclient/client.go b/go/vt/vttablet/grpctmclient/client.go index 8fe25bf20f5..11659e206cb 100644 --- a/go/vt/vttablet/grpctmclient/client.go +++ b/go/vt/vttablet/grpctmclient/client.go @@ -867,7 +867,7 @@ func (client *Client) ReplicationStatus(ctx context.Context, tablet *topodatapb. // It always tries to use a cached client via the dialer pool as this is // called very frequently from VTOrc, and the overhead of creating a new gRPC connection/channel // and dialing the other tablet every time is not practical. -func (client *Client) FullStatus(ctx context.Context, tablet *topodatapb.Tablet) (*replicationdatapb.FullStatus, error) { +func (client *Client) FullStatus(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.FullStatusRequest) (*replicationdatapb.FullStatus, error) { var c tabletmanagerservicepb.TabletManagerClient var invalidator invalidatorFunc var err error @@ -887,7 +887,7 @@ func (client *Client) FullStatus(ctx context.Context, tablet *topodatapb.Tablet) defer closer.Close() } - response, err := c.FullStatus(ctx, &tabletmanagerdatapb.FullStatusRequest{}) + response, err := c.FullStatus(ctx, request) if err != nil { if invalidator != nil { invalidator() diff --git a/go/vt/vttablet/grpctmserver/server.go b/go/vt/vttablet/grpctmserver/server.go index 3f81062dc60..25efa844cac 100644 --- a/go/vt/vttablet/grpctmserver/server.go +++ b/go/vt/vttablet/grpctmserver/server.go @@ -28,13 +28,18 @@ import ( "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/mysqlctl/tmutils" "vitess.io/vitess/go/vt/servenv" + "vitess.io/vitess/go/vt/topo" + "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vttablet/tabletmanager" + "vitess.io/vitess/go/vt/vttablet/tmclient" logutilpb "vitess.io/vitess/go/vt/proto/logutil" querypb "vitess.io/vitess/go/vt/proto/query" + replicationdatapb "vitess.io/vitess/go/vt/proto/replicationdata" tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" tabletmanagerservicepb "vitess.io/vitess/go/vt/proto/tabletmanagerservice" + vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" ) // server is the gRPC implementation of the RPC server @@ -42,6 +47,8 @@ type server struct { tabletmanagerservicepb.UnimplementedTabletManagerServer // implementation of the tm to call tm tabletmanager.RPCTM + // tmc is a tabletmanger client for proxy requests + tmc tmclient.TabletManagerClient } func (s *server) Ping(ctx context.Context, request *tabletmanagerdatapb.PingRequest) (response *tabletmanagerdatapb.PingResponse, err error) { @@ -362,11 +369,46 @@ func (s *server) ReplicationStatus(ctx context.Context, request *tabletmanagerda return response, err } +func (s *server) proxyFullStatus(ctx context.Context, request *tabletmanagerdatapb.FullStatusRequest) (*replicationdatapb.FullStatus, error) { + if s.tmc == nil { + return nil, vterrors.New(vtrpcpb.Code_FAILED_PRECONDITION, "no proxy tabletmanger client") + } + + // disallow infinite proxy loop + if topoproto.TabletAliasEqual(s.tm.GetTabletAlias(), request.ProxyTarget.Alias) { + return nil, vterrors.New(vtrpcpb.Code_FAILED_PRECONDITION, "cannot use proxying tablet as a proxy target") + } + // disallow proxying more than once + if request.ProxiedBy != nil { + return nil, vterrors.New(vtrpcpb.Code_FAILED_PRECONDITION, "cannot proxy a request that is already proxied") + } + // disallow timeouts larger than the local remote operation timeout + if request.ProxyTimeoutMs > uint64(topo.RemoteOperationTimeout.Milliseconds()) { + return nil, vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "cannot set a proxy timeout ms greater than %d", topo.RemoteOperationTimeout.Milliseconds()) + } + + timeout := topo.RemoteOperationTimeout + if request.ProxyTimeoutMs > 0 { + timeout = time.Duration(request.ProxyTimeoutMs) * time.Millisecond + } + proxyCtx, proxyCancel := context.WithTimeout(ctx, timeout) + defer proxyCancel() + + return s.tmc.FullStatus(proxyCtx, request.ProxyTarget, &tabletmanagerdatapb.FullStatusRequest{ + ProxiedBy: s.tm.GetTabletAlias(), + }) +} + func (s *server) FullStatus(ctx context.Context, request *tabletmanagerdatapb.FullStatusRequest) (response *tabletmanagerdatapb.FullStatusResponse, err error) { defer s.tm.HandleRPCPanic(ctx, "FullStatus", request, response, false /*verbose*/, &err) ctx = callinfo.GRPCCallInfo(ctx) + var status *replicationdatapb.FullStatus response = &tabletmanagerdatapb.FullStatusResponse{} - status, err := s.tm.FullStatus(ctx) + if request.ProxyTarget != nil { + status, err = s.proxyFullStatus(ctx, request) + } else { + status, err = s.tm.FullStatus(ctx) + } if err == nil { response.Status = status } @@ -728,12 +770,18 @@ func (s *server) GetThrottlerStatus(ctx context.Context, request *tabletmanagerd func init() { tabletmanager.RegisterTabletManagers = append(tabletmanager.RegisterTabletManagers, func(tm *tabletmanager.TabletManager) { if servenv.GRPCCheckServiceMap("tabletmanager") { - tabletmanagerservicepb.RegisterTabletManagerServer(servenv.GRPCServer, &server{tm: tm}) + tabletmanagerservicepb.RegisterTabletManagerServer(servenv.GRPCServer, &server{ + tm: tm, + tmc: tmclient.NewTabletManagerClient(), + }) } }) } // RegisterForTest will register the RPC, to be used by test instances only -func RegisterForTest(s *grpc.Server, tm tabletmanager.RPCTM) { - tabletmanagerservicepb.RegisterTabletManagerServer(s, &server{tm: tm}) +func RegisterForTest(s *grpc.Server, tm tabletmanager.RPCTM, tmc tmclient.TabletManagerClient) { + tabletmanagerservicepb.RegisterTabletManagerServer(s, &server{ + tm: tm, + tmc: tmc, + }) } diff --git a/go/vt/vttablet/grpctmserver/server_test.go b/go/vt/vttablet/grpctmserver/server_test.go index ed0f5a1597f..90fd961889b 100644 --- a/go/vt/vttablet/grpctmserver/server_test.go +++ b/go/vt/vttablet/grpctmserver/server_test.go @@ -43,7 +43,7 @@ func TestGRPCTMServer(t *testing.T) { // Create a gRPC server and listen on the port. s := grpc.NewServer() fakeTM := tmrpctest.NewFakeRPCTM(t) - grpctmserver.RegisterForTest(s, fakeTM) + grpctmserver.RegisterForTest(s, fakeTM, nil) go s.Serve(listener) // Create a gRPC client to talk to the fake tablet. diff --git a/go/vt/vttablet/tabletmanager/rpc_agent.go b/go/vt/vttablet/tabletmanager/rpc_agent.go index 9e341662ae4..d4b8cf5f2be 100644 --- a/go/vt/vttablet/tabletmanager/rpc_agent.go +++ b/go/vt/vttablet/tabletmanager/rpc_agent.go @@ -43,6 +43,8 @@ type RPCTM interface { GetPermissions(ctx context.Context) (*tabletmanagerdatapb.Permissions, error) + GetTabletAlias() *topodatapb.TabletAlias + // GetGlobalStatusVars returns the server's global status variables asked for. // An empty/nil variable name parameter slice means you want all of them. GetGlobalStatusVars(ctx context.Context, variables []string) (map[string]string, error) diff --git a/go/vt/vttablet/tabletmanager/tm_init.go b/go/vt/vttablet/tabletmanager/tm_init.go index 35986a4209a..5478dcf8a50 100644 --- a/go/vt/vttablet/tabletmanager/tm_init.go +++ b/go/vt/vttablet/tabletmanager/tm_init.go @@ -663,6 +663,11 @@ func (tm *TabletManager) stopRebuildKeyspace() { } } +// GetTabletAlias returns the tablet alias of the tabletmanager server. +func (tm *TabletManager) GetTabletAlias() *topodatapb.TabletAlias { + return tm.tabletAlias +} + func (tm *TabletManager) rebuildKeyspace(ctx context.Context, done chan<- struct{}, keyspace string, retryInterval time.Duration) { var srvKeyspace *topodatapb.SrvKeyspace diff --git a/go/vt/vttablet/tmclient/rpc_client_api.go b/go/vt/vttablet/tmclient/rpc_client_api.go index 5a61f5d3d1d..f1abc898bdd 100644 --- a/go/vt/vttablet/tmclient/rpc_client_api.go +++ b/go/vt/vttablet/tmclient/rpc_client_api.go @@ -179,7 +179,7 @@ type TabletManagerClient interface { ReplicationStatus(ctx context.Context, tablet *topodatapb.Tablet) (*replicationdatapb.Status, error) // FullStatus returns the tablet's mysql replication status. - FullStatus(ctx context.Context, tablet *topodatapb.Tablet) (*replicationdatapb.FullStatus, error) + FullStatus(ctx context.Context, tablet *topodatapb.Tablet, request *tabletmanagerdatapb.FullStatusRequest) (*replicationdatapb.FullStatus, error) // StopReplication stops the mysql replication StopReplication(ctx context.Context, tablet *topodatapb.Tablet) error diff --git a/go/vt/vttablet/tmrpctest/test_tm_rpc.go b/go/vt/vttablet/tmrpctest/test_tm_rpc.go index 46f42245607..005e2df89af 100644 --- a/go/vt/vttablet/tmrpctest/test_tm_rpc.go +++ b/go/vt/vttablet/tmrpctest/test_tm_rpc.go @@ -54,7 +54,8 @@ type fakeRPCTM struct { // slow if true will let Ping() sleep and effectively not respond to an RPC. slow bool // mu guards accesses of "slow". - mu sync.Mutex + mu sync.Mutex + tabletAlias *topodatapb.TabletAlias } func (fra *fakeRPCTM) CreateVReplicationWorkflow(ctx context.Context, req *tabletmanagerdatapb.CreateVReplicationWorkflowRequest) (*tabletmanagerdatapb.CreateVReplicationWorkflowResponse, error) { @@ -135,6 +136,10 @@ func (fra *fakeRPCTM) MysqlHostMetrics(ctx context.Context, req *tabletmanagerda panic("implement me") } +func (fra *fakeRPCTM) GetTabletAlias() *topodatapb.TabletAlias { + return fra.tabletAlias +} + func (fra *fakeRPCTM) setSlow(slow bool) { fra.mu.Lock() fra.slow = slow @@ -956,12 +961,12 @@ func (fra *fakeRPCTM) FullStatus(ctx context.Context) (*replicationdatapb.FullSt } func tmRPCTestFullStatus(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) { - rs, err := client.FullStatus(ctx, tablet) + rs, err := client.FullStatus(ctx, tablet, nil) compareError(t, "FullStatus", err, rs, testFullStatus) } func tmRPCTestFullStatusPanic(ctx context.Context, t *testing.T, client tmclient.TabletManagerClient, tablet *topodatapb.Tablet) { - _, err := client.FullStatus(ctx, tablet) + _, err := client.FullStatus(ctx, tablet, nil) expectHandleRPCPanic(t, "FullStatus", false /*verbose*/, err) } diff --git a/go/vt/wrangler/fake_tablet_test.go b/go/vt/wrangler/fake_tablet_test.go index 2eec782f301..ed4fba25b44 100644 --- a/go/vt/wrangler/fake_tablet_test.go +++ b/go/vt/wrangler/fake_tablet_test.go @@ -214,7 +214,7 @@ func (ft *fakeTablet) StartActionLoop(t *testing.T, wr *Wrangler) { ft.Tablet = ft.TM.Tablet() // Register the gRPC server, and starts listening. - grpctmserver.RegisterForTest(ft.RPCServer, ft.TM) + grpctmserver.RegisterForTest(ft.RPCServer, ft.TM, nil) go ft.RPCServer.Serve(ft.Listener) // And wait for it to serve, so we don't start using it before it's diff --git a/go/vt/wrangler/testlib/fake_tablet.go b/go/vt/wrangler/testlib/fake_tablet.go index 7881ebf6a2a..a6ff48af0b6 100644 --- a/go/vt/wrangler/testlib/fake_tablet.go +++ b/go/vt/wrangler/testlib/fake_tablet.go @@ -217,7 +217,7 @@ func (ft *FakeTablet) StartActionLoop(t *testing.T, wr *wrangler.Wrangler) { ft.Tablet = ft.TM.Tablet() // Register the gRPC server, and starts listening. - grpctmserver.RegisterForTest(ft.RPCServer, ft.TM) + grpctmserver.RegisterForTest(ft.RPCServer, ft.TM, nil) go ft.RPCServer.Serve(ft.Listener) // And wait for it to serve, so we don't start using it before it's diff --git a/proto/tabletmanagerdata.proto b/proto/tabletmanagerdata.proto index da0206653f7..59a90e7d4ae 100644 --- a/proto/tabletmanagerdata.proto +++ b/proto/tabletmanagerdata.proto @@ -517,6 +517,16 @@ message ResetReplicationParametersResponse { } message FullStatusRequest { + // proxy_target specifies a tablet to proxy the FullStatusResponse from. + topodata.Tablet proxy_target = 1; + + // proxy_timeout_ms specifies the maximum number of milliseconds to wait for a + // proxied request to complete. Must be less than topo.RemoteOperationTimeout + // on the tablet proxying the request. + uint64 proxy_timeout_ms = 2; + + // proxied_by is set to the tablet alias that proxied a FullStatusRequest. + topodata.TabletAlias proxied_by = 3; } message FullStatusResponse { diff --git a/web/vtadmin/src/proto/vtadmin.d.ts b/web/vtadmin/src/proto/vtadmin.d.ts index d6890ece9e2..1a3851e01c5 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -30947,6 +30947,15 @@ export namespace tabletmanagerdata { /** Properties of a FullStatusRequest. */ interface IFullStatusRequest { + + /** FullStatusRequest proxy_target */ + proxy_target?: (topodata.ITablet|null); + + /** FullStatusRequest proxy_timeout_ms */ + proxy_timeout_ms?: (number|Long|null); + + /** FullStatusRequest proxied_by */ + proxied_by?: (topodata.ITabletAlias|null); } /** Represents a FullStatusRequest. */ @@ -30958,6 +30967,15 @@ export namespace tabletmanagerdata { */ constructor(properties?: tabletmanagerdata.IFullStatusRequest); + /** FullStatusRequest proxy_target. */ + public proxy_target?: (topodata.ITablet|null); + + /** FullStatusRequest proxy_timeout_ms. */ + public proxy_timeout_ms: (number|Long); + + /** FullStatusRequest proxied_by. */ + public proxied_by?: (topodata.ITabletAlias|null); + /** * Creates a new FullStatusRequest instance using the specified properties. * @param [properties] Properties to set diff --git a/web/vtadmin/src/proto/vtadmin.js b/web/vtadmin/src/proto/vtadmin.js index 40b8c6ff4e0..43933cf4623 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -70484,6 +70484,9 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { * Properties of a FullStatusRequest. * @memberof tabletmanagerdata * @interface IFullStatusRequest + * @property {topodata.ITablet|null} [proxy_target] FullStatusRequest proxy_target + * @property {number|Long|null} [proxy_timeout_ms] FullStatusRequest proxy_timeout_ms + * @property {topodata.ITabletAlias|null} [proxied_by] FullStatusRequest proxied_by */ /** @@ -70501,6 +70504,30 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { this[keys[i]] = properties[keys[i]]; } + /** + * FullStatusRequest proxy_target. + * @member {topodata.ITablet|null|undefined} proxy_target + * @memberof tabletmanagerdata.FullStatusRequest + * @instance + */ + FullStatusRequest.prototype.proxy_target = null; + + /** + * FullStatusRequest proxy_timeout_ms. + * @member {number|Long} proxy_timeout_ms + * @memberof tabletmanagerdata.FullStatusRequest + * @instance + */ + FullStatusRequest.prototype.proxy_timeout_ms = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * FullStatusRequest proxied_by. + * @member {topodata.ITabletAlias|null|undefined} proxied_by + * @memberof tabletmanagerdata.FullStatusRequest + * @instance + */ + FullStatusRequest.prototype.proxied_by = null; + /** * Creates a new FullStatusRequest instance using the specified properties. * @function create @@ -70525,6 +70552,12 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { FullStatusRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.proxy_target != null && Object.hasOwnProperty.call(message, "proxy_target")) + $root.topodata.Tablet.encode(message.proxy_target, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proxy_timeout_ms != null && Object.hasOwnProperty.call(message, "proxy_timeout_ms")) + writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.proxy_timeout_ms); + if (message.proxied_by != null && Object.hasOwnProperty.call(message, "proxied_by")) + $root.topodata.TabletAlias.encode(message.proxied_by, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -70559,6 +70592,18 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.proxy_target = $root.topodata.Tablet.decode(reader, reader.uint32()); + break; + } + case 2: { + message.proxy_timeout_ms = reader.uint64(); + break; + } + case 3: { + message.proxied_by = $root.topodata.TabletAlias.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -70594,6 +70639,19 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { FullStatusRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.proxy_target != null && message.hasOwnProperty("proxy_target")) { + let error = $root.topodata.Tablet.verify(message.proxy_target); + if (error) + return "proxy_target." + error; + } + if (message.proxy_timeout_ms != null && message.hasOwnProperty("proxy_timeout_ms")) + if (!$util.isInteger(message.proxy_timeout_ms) && !(message.proxy_timeout_ms && $util.isInteger(message.proxy_timeout_ms.low) && $util.isInteger(message.proxy_timeout_ms.high))) + return "proxy_timeout_ms: integer|Long expected"; + if (message.proxied_by != null && message.hasOwnProperty("proxied_by")) { + let error = $root.topodata.TabletAlias.verify(message.proxied_by); + if (error) + return "proxied_by." + error; + } return null; }; @@ -70608,7 +70666,27 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { FullStatusRequest.fromObject = function fromObject(object) { if (object instanceof $root.tabletmanagerdata.FullStatusRequest) return object; - return new $root.tabletmanagerdata.FullStatusRequest(); + let message = new $root.tabletmanagerdata.FullStatusRequest(); + if (object.proxy_target != null) { + if (typeof object.proxy_target !== "object") + throw TypeError(".tabletmanagerdata.FullStatusRequest.proxy_target: object expected"); + message.proxy_target = $root.topodata.Tablet.fromObject(object.proxy_target); + } + if (object.proxy_timeout_ms != null) + if ($util.Long) + (message.proxy_timeout_ms = $util.Long.fromValue(object.proxy_timeout_ms)).unsigned = true; + else if (typeof object.proxy_timeout_ms === "string") + message.proxy_timeout_ms = parseInt(object.proxy_timeout_ms, 10); + else if (typeof object.proxy_timeout_ms === "number") + message.proxy_timeout_ms = object.proxy_timeout_ms; + else if (typeof object.proxy_timeout_ms === "object") + message.proxy_timeout_ms = new $util.LongBits(object.proxy_timeout_ms.low >>> 0, object.proxy_timeout_ms.high >>> 0).toNumber(true); + if (object.proxied_by != null) { + if (typeof object.proxied_by !== "object") + throw TypeError(".tabletmanagerdata.FullStatusRequest.proxied_by: object expected"); + message.proxied_by = $root.topodata.TabletAlias.fromObject(object.proxied_by); + } + return message; }; /** @@ -70620,8 +70698,29 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FullStatusRequest.toObject = function toObject() { - return {}; + FullStatusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.proxy_target = null; + if ($util.Long) { + let long = new $util.Long(0, 0, true); + object.proxy_timeout_ms = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.proxy_timeout_ms = options.longs === String ? "0" : 0; + object.proxied_by = null; + } + if (message.proxy_target != null && message.hasOwnProperty("proxy_target")) + object.proxy_target = $root.topodata.Tablet.toObject(message.proxy_target, options); + if (message.proxy_timeout_ms != null && message.hasOwnProperty("proxy_timeout_ms")) + if (typeof message.proxy_timeout_ms === "number") + object.proxy_timeout_ms = options.longs === String ? String(message.proxy_timeout_ms) : message.proxy_timeout_ms; + else + object.proxy_timeout_ms = options.longs === String ? $util.Long.prototype.toString.call(message.proxy_timeout_ms) : options.longs === Number ? new $util.LongBits(message.proxy_timeout_ms.low >>> 0, message.proxy_timeout_ms.high >>> 0).toNumber(true) : message.proxy_timeout_ms; + if (message.proxied_by != null && message.hasOwnProperty("proxied_by")) + object.proxied_by = $root.topodata.TabletAlias.toObject(message.proxied_by, options); + return object; }; /**