From 2af2884a59d7f65f97847c2aade713705320b091 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Wed, 31 Jul 2024 07:39:03 +0300 Subject: [PATCH] Throttler: `CheckThrottlerResponseCode` to replace HTTP status codes (#16491) Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- .../throttler_topo/throttler_test.go | 95 +- .../tabletmanagerdata/tabletmanagerdata.pb.go | 920 ++++++++++-------- .../tabletmanagerdata_vtproto.pb.go | 102 +- go/vt/vttablet/tabletmanager/rpc_throttler.go | 28 +- go/vt/vttablet/tabletserver/tabletserver.go | 4 +- .../tabletserver/throttle/base/recent_app.go | 18 +- go/vt/vttablet/tabletserver/throttle/check.go | 49 +- .../tabletserver/throttle/check_result.go | 107 +- .../throttle/check_result_test.go | 77 ++ .../vttablet/tabletserver/throttle/client.go | 5 +- .../tabletserver/throttle/throttler.go | 14 +- .../tabletserver/throttle/throttler_test.go | 71 +- proto/tabletmanagerdata.proto | 15 + web/vtadmin/src/proto/vtadmin.d.ts | 28 + web/vtadmin/src/proto/vtadmin.js | 208 ++++ 15 files changed, 1201 insertions(+), 540 deletions(-) diff --git a/go/test/endtoend/tabletmanager/throttler_topo/throttler_test.go b/go/test/endtoend/tabletmanager/throttler_topo/throttler_test.go index 89649f2ce4c..08cea643940 100644 --- a/go/test/endtoend/tabletmanager/throttler_topo/throttler_test.go +++ b/go/test/endtoend/tabletmanager/throttler_topo/throttler_test.go @@ -38,6 +38,7 @@ import ( "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/base" "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/throttlerapp" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" topodatapb "vitess.io/vitess/go/vt/proto/topodata" vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" ) @@ -203,18 +204,18 @@ func throttleStatus(t *testing.T, tablet *cluster.Vttablet) string { return string(b) } -func warmUpHeartbeat(t *testing.T) (respStatus int) { +func warmUpHeartbeat(t *testing.T) tabletmanagerdatapb.CheckThrottlerResponseCode { // because we run with -heartbeat_on_demand_duration=5s, the heartbeat is "cold" right now. // Let's warm it up. resp, err := throttleCheck(primaryTablet, false) require.NoError(t, err) time.Sleep(time.Second) - return int(resp.Check.StatusCode) + return throttle.ResponseCodeFromStatus(resp.Check.ResponseCode, int(resp.Check.StatusCode)) } // waitForThrottleCheckStatus waits for the tablet to return the provided HTTP code in a throttle check -func waitForThrottleCheckStatus(t *testing.T, tablet *cluster.Vttablet, wantCode int) bool { +func waitForThrottleCheckStatus(t *testing.T, tablet *cluster.Vttablet, wantCode tabletmanagerdatapb.CheckThrottlerResponseCode) bool { _ = warmUpHeartbeat(t) ctx, cancel := context.WithTimeout(context.Background(), onDemandHeartbeatDuration*4) defer cancel() @@ -225,7 +226,7 @@ func waitForThrottleCheckStatus(t *testing.T, tablet *cluster.Vttablet, wantCode resp, err := throttleCheck(tablet, true) require.NoError(t, err) - if wantCode == int(resp.Check.StatusCode) { + if wantCode == resp.Check.ResponseCode { // Wait for any cached check values to be cleared and the new // status value to be in effect everywhere before returning. return true @@ -260,7 +261,7 @@ func TestInitialThrottler(t *testing.T) { defer cluster.PanicHandler(t) t.Run("validating OK response from disabled throttler", func(t *testing.T) { - waitForThrottleCheckStatus(t, primaryTablet, http.StatusOK) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK) }) t.Run("enabling throttler with very low threshold", func(t *testing.T) { req := &vtctldatapb.UpdateThrottlerConfigRequest{Enable: true, Threshold: unreasonablyLowThreshold.Seconds()} @@ -273,7 +274,7 @@ func TestInitialThrottler(t *testing.T) { } }) t.Run("validating pushback response from throttler", func(t *testing.T) { - waitForThrottleCheckStatus(t, primaryTablet, http.StatusTooManyRequests) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED) }) t.Run("disabling throttler", func(t *testing.T) { req := &vtctldatapb.UpdateThrottlerConfigRequest{Disable: true, Threshold: unreasonablyLowThreshold.Seconds()} @@ -286,7 +287,7 @@ func TestInitialThrottler(t *testing.T) { } }) t.Run("validating OK response from disabled throttler, again", func(t *testing.T) { - waitForThrottleCheckStatus(t, primaryTablet, http.StatusOK) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK) }) t.Run("enabling throttler, again", func(t *testing.T) { // Enable the throttler again with the default query which also moves us back @@ -301,7 +302,7 @@ func TestInitialThrottler(t *testing.T) { } }) t.Run("validating pushback response from throttler, again", func(t *testing.T) { - waitForThrottleCheckStatus(t, primaryTablet, http.StatusTooManyRequests) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED) }) t.Run("setting high threshold", func(t *testing.T) { req := &vtctldatapb.UpdateThrottlerConfigRequest{Threshold: extremelyHighThreshold.Seconds()} @@ -314,7 +315,7 @@ func TestInitialThrottler(t *testing.T) { } }) t.Run("validating OK response from throttler with high threshold", func(t *testing.T) { - waitForThrottleCheckStatus(t, primaryTablet, http.StatusOK) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK) }) t.Run("setting low threshold", func(t *testing.T) { req := &vtctldatapb.UpdateThrottlerConfigRequest{Threshold: throttler.DefaultThreshold.Seconds()} @@ -327,11 +328,11 @@ func TestInitialThrottler(t *testing.T) { } }) t.Run("validating pushback response from throttler on low threshold", func(t *testing.T) { - waitForThrottleCheckStatus(t, primaryTablet, http.StatusTooManyRequests) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED) }) t.Run("requesting heartbeats", func(t *testing.T) { respStatus := warmUpHeartbeat(t) - assert.NotEqual(t, http.StatusOK, respStatus) + assert.NotEqual(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, respStatus) }) t.Run("validating OK response from throttler with low threshold, heartbeats running", func(t *testing.T) { time.Sleep(1 * time.Second) @@ -350,6 +351,13 @@ func TestInitialThrottler(t *testing.T) { t.Logf("throttler primary status: %+v", throttleStatus(t, primaryTablet)) t.Logf("throttler replica status: %+v", throttleStatus(t, replicaTablet)) } + if !assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, resp.Check.ResponseCode, "Unexpected response from throttler: %+v", resp) { + rs, err := replicaTablet.VttabletProcess.QueryTablet("show replica status", keyspaceName, false) + assert.NoError(t, err) + t.Logf("Seconds_Behind_Source: %s", rs.Named().Row()["Seconds_Behind_Source"].ToString()) + t.Logf("throttler primary status: %+v", throttleStatus(t, primaryTablet)) + t.Logf("throttler replica status: %+v", throttleStatus(t, replicaTablet)) + } }) t.Run("validating OK response from throttler with low threshold, heartbeats running still", func(t *testing.T) { @@ -368,10 +376,17 @@ func TestInitialThrottler(t *testing.T) { t.Logf("throttler primary status: %+v", throttleStatus(t, primaryTablet)) t.Logf("throttler replica status: %+v", throttleStatus(t, replicaTablet)) } + if !assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, resp.Check.ResponseCode, "Unexpected response from throttler: %+v", resp) { + rs, err := replicaTablet.VttabletProcess.QueryTablet("show replica status", keyspaceName, false) + assert.NoError(t, err) + t.Logf("Seconds_Behind_Source: %s", rs.Named().Row()["Seconds_Behind_Source"].ToString()) + t.Logf("throttler primary status: %+v", throttleStatus(t, primaryTablet)) + t.Logf("throttler replica status: %+v", throttleStatus(t, replicaTablet)) + } }) t.Run("validating pushback response from throttler on low threshold once heartbeats go stale", func(t *testing.T) { time.Sleep(2 * onDemandHeartbeatDuration) // just... really wait long enough, make sure on-demand stops - waitForThrottleCheckStatus(t, primaryTablet, http.StatusTooManyRequests) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED) }) } @@ -424,7 +439,7 @@ func TestThrottlerAfterMetricsCollected(t *testing.T) { // By this time metrics will have been collected. We expect no lag, and something like: // {"StatusCode":200,"Value":0.282278,"Threshold":1,"Message":""} t.Run("validating throttler OK", func(t *testing.T) { - waitForThrottleCheckStatus(t, primaryTablet, http.StatusOK) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK) }) t.Run("validating throttled apps", func(t *testing.T) { resp, body, err := throttledApps(primaryTablet) @@ -437,11 +452,13 @@ func TestThrottlerAfterMetricsCollected(t *testing.T) { resp, err := throttleCheckSelf(primaryTablet) require.NoError(t, err) assert.EqualValues(t, http.StatusOK, resp.Check.StatusCode, "Unexpected response from throttler: %+v", resp) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, resp.Check.ResponseCode, "Unexpected response from throttler: %+v", resp) }) t.Run("validating replica check self", func(t *testing.T) { resp, err := throttleCheckSelf(replicaTablet) require.NoError(t, err) assert.EqualValues(t, http.StatusOK, resp.Check.StatusCode, "Unexpected response from throttler: %+v", resp) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, resp.Check.ResponseCode, "Unexpected response from throttler: %+v", resp) }) } @@ -469,6 +486,7 @@ func TestLag(t *testing.T) { resp, err := throttleCheck(primaryTablet, false) require.NoError(t, err) assert.EqualValues(t, http.StatusTooManyRequests, resp.Check.StatusCode, "Unexpected response from throttler: %+v", resp) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED, resp.Check.ResponseCode, "Unexpected response from throttler: %+v", resp) }) t.Run("primary self-check should still be fine", func(t *testing.T) { resp, err := throttleCheckSelf(primaryTablet) @@ -482,6 +500,10 @@ func TestLag(t *testing.T) { t.Logf("throttler primary status: %+v", throttleStatus(t, primaryTablet)) t.Logf("throttler replica status: %+v", throttleStatus(t, replicaTablet)) } + if !assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, resp.Check.ResponseCode, "Unexpected response from throttler: %+v", resp) { + t.Logf("throttler primary status: %+v", throttleStatus(t, primaryTablet)) + t.Logf("throttler replica status: %+v", throttleStatus(t, replicaTablet)) + } }) t.Run("replica self-check should show error", func(t *testing.T) { resp, err := throttleCheckSelf(replicaTablet) @@ -491,6 +513,7 @@ func TestLag(t *testing.T) { assert.Equal(t, base.SelfScope.String(), metrics.Scope) } assert.EqualValues(t, http.StatusTooManyRequests, resp.Check.StatusCode, "Unexpected response from throttler: %+v", resp) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED, resp.Check.ResponseCode, "Unexpected response from throttler: %+v", resp) }) t.Run("exempting test app", func(t *testing.T) { appRule := &topodatapb.ThrottledAppRule{ @@ -501,7 +524,7 @@ func TestLag(t *testing.T) { req := &vtctldatapb.UpdateThrottlerConfigRequest{Threshold: throttler.DefaultThreshold.Seconds()} _, err := throttler.UpdateThrottlerTopoConfig(clusterInstance, req, appRule, nil) assert.NoError(t, err) - waitForThrottleCheckStatus(t, primaryTablet, http.StatusOK) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK) }) t.Run("unexempting test app", func(t *testing.T) { appRule := &topodatapb.ThrottledAppRule{ @@ -511,7 +534,7 @@ func TestLag(t *testing.T) { req := &vtctldatapb.UpdateThrottlerConfigRequest{Threshold: throttler.DefaultThreshold.Seconds()} _, err := throttler.UpdateThrottlerTopoConfig(clusterInstance, req, appRule, nil) assert.NoError(t, err) - waitForThrottleCheckStatus(t, primaryTablet, http.StatusTooManyRequests) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED) }) t.Run("exempting all apps", func(t *testing.T) { appRule := &topodatapb.ThrottledAppRule{ @@ -522,7 +545,7 @@ func TestLag(t *testing.T) { req := &vtctldatapb.UpdateThrottlerConfigRequest{Threshold: throttler.DefaultThreshold.Seconds()} _, err := throttler.UpdateThrottlerTopoConfig(clusterInstance, req, appRule, nil) assert.NoError(t, err) - waitForThrottleCheckStatus(t, primaryTablet, http.StatusOK) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK) }) t.Run("throttling test app", func(t *testing.T) { appRule := &topodatapb.ThrottledAppRule{ @@ -533,7 +556,7 @@ func TestLag(t *testing.T) { req := &vtctldatapb.UpdateThrottlerConfigRequest{Threshold: throttler.DefaultThreshold.Seconds()} _, err := throttler.UpdateThrottlerTopoConfig(clusterInstance, req, appRule, nil) assert.NoError(t, err) - waitForThrottleCheckStatus(t, primaryTablet, http.StatusExpectationFailed) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_APP_DENIED) }) t.Run("unthrottling test app", func(t *testing.T) { appRule := &topodatapb.ThrottledAppRule{ @@ -543,7 +566,7 @@ func TestLag(t *testing.T) { req := &vtctldatapb.UpdateThrottlerConfigRequest{Threshold: throttler.DefaultThreshold.Seconds()} _, err := throttler.UpdateThrottlerTopoConfig(clusterInstance, req, appRule, nil) assert.NoError(t, err) - waitForThrottleCheckStatus(t, primaryTablet, http.StatusOK) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK) }) t.Run("unexempting all apps", func(t *testing.T) { appRule := &topodatapb.ThrottledAppRule{ @@ -553,7 +576,7 @@ func TestLag(t *testing.T) { req := &vtctldatapb.UpdateThrottlerConfigRequest{Threshold: throttler.DefaultThreshold.Seconds()} _, err := throttler.UpdateThrottlerTopoConfig(clusterInstance, req, appRule, nil) assert.NoError(t, err) - waitForThrottleCheckStatus(t, primaryTablet, http.StatusTooManyRequests) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED) }) t.Run("starting replication", func(t *testing.T) { @@ -561,18 +584,20 @@ func TestLag(t *testing.T) { assert.NoError(t, err) }) t.Run("expecting replication to catch up and throttler check to return OK", func(t *testing.T) { - waitForThrottleCheckStatus(t, primaryTablet, http.StatusOK) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK) }) t.Run("primary self-check should be fine", func(t *testing.T) { resp, err := throttleCheckSelf(primaryTablet) require.NoError(t, err) // self (on primary) is unaffected by replication lag assert.EqualValues(t, http.StatusOK, resp.Check.StatusCode, "Unexpected response from throttler: %+v", resp) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, resp.Check.ResponseCode, "Unexpected response from throttler: %+v", resp) }) t.Run("replica self-check should be fine", func(t *testing.T) { resp, err := throttleCheckSelf(replicaTablet) require.NoError(t, err) assert.EqualValues(t, http.StatusOK, resp.Check.StatusCode, "Unexpected response from throttler: %+v", resp) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, resp.Check.ResponseCode, "Unexpected response from throttler: %+v", resp) }) } @@ -584,13 +609,13 @@ func TestNoReplicas(t *testing.T) { // This makes no REPLICA servers available. We expect something like: // {"StatusCode":200,"Value":0,"Threshold":1,"Message":""} - waitForThrottleCheckStatus(t, primaryTablet, http.StatusOK) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK) }) t.Run("restoring to REPLICA", func(t *testing.T) { err := clusterInstance.VtctldClientProcess.ExecuteCommand("ChangeTabletType", replicaTablet.Alias, "REPLICA") assert.NoError(t, err) - waitForThrottleCheckStatus(t, primaryTablet, http.StatusOK) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK) }) } @@ -617,6 +642,7 @@ func TestCustomQuery(t *testing.T) { resp, err := throttleCheck(primaryTablet, false) require.NoError(t, err) assert.EqualValues(t, http.StatusOK, resp.Check.StatusCode, "Unexpected response from throttler: %+v", resp) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, resp.Check.ResponseCode, "Unexpected response from throttler: %+v", resp) }) t.Run("test threads running", func(t *testing.T) { sleepDuration := 20 * time.Second @@ -638,22 +664,24 @@ func TestCustomQuery(t *testing.T) { // Now we should be reporting ~ customThreshold+1 threads_running, and we should // hit the threshold. For example: // {"StatusCode":429,"Value":6,"Threshold":5,"Message":"Threshold exceeded"} - waitForThrottleCheckStatus(t, primaryTablet, http.StatusTooManyRequests) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED) { resp, err := throttleCheckSelf(primaryTablet) require.NoError(t, err) assert.EqualValues(t, http.StatusTooManyRequests, resp.Check.StatusCode, "Unexpected response from throttler: %+v", resp) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED, resp.Check.ResponseCode, "Unexpected response from throttler: %+v", resp) } }) t.Run("wait for queries to terminate", func(t *testing.T) { wg.Wait() }) t.Run("restored below threshold", func(t *testing.T) { - waitForThrottleCheckStatus(t, primaryTablet, http.StatusOK) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK) { resp, err := throttleCheckSelf(primaryTablet) require.NoError(t, err) assert.EqualValues(t, http.StatusOK, resp.Check.StatusCode, "Unexpected response from throttler: %+v", resp) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, resp.Check.ResponseCode, "Unexpected response from throttler: %+v", resp) } }) }) @@ -677,10 +705,11 @@ func TestRestoreDefaultQuery(t *testing.T) { resp, err := throttleCheck(primaryTablet, false) require.NoError(t, err) assert.EqualValues(t, http.StatusOK, resp.Check.StatusCode, "Unexpected response from throttler: %+v", resp) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, resp.Check.ResponseCode, "Unexpected response from throttler: %+v", resp) }) t.Run("validating pushback response from throttler on default threshold once heartbeats go stale", func(t *testing.T) { time.Sleep(2 * onDemandHeartbeatDuration) // just... really wait long enough, make sure on-demand stops - waitForThrottleCheckStatus(t, primaryTablet, http.StatusTooManyRequests) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED) }) } @@ -693,7 +722,7 @@ func TestUpdateMetricThresholds(t *testing.T) { for _, tablet := range []cluster.Vttablet{*primaryTablet, *replicaTablet} { throttler.WaitForThrottlerStatusEnabled(t, &clusterInstance.VtctldClientProcess, &tablet, true, &throttler.Config{Query: throttler.DefaultQuery, Threshold: throttler.DefaultThreshold.Seconds()}, throttlerEnabledTimeout) } - waitForThrottleCheckStatus(t, primaryTablet, http.StatusTooManyRequests) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED) }) t.Run("setting low general threshold, and high threshold for 'lag' metric", func(t *testing.T) { { @@ -713,7 +742,7 @@ func TestUpdateMetricThresholds(t *testing.T) { }) t.Run("validating OK response from throttler thanks to high 'lag' threshold", func(t *testing.T) { // Note that the default threshold is extremely low, but gets overriden. - waitForThrottleCheckStatus(t, primaryTablet, http.StatusOK) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK) }) t.Run("removing explicit 'lag' threshold", func(t *testing.T) { req := &vtctldatapb.UpdateThrottlerConfigRequest{MetricName: "lag", Threshold: 0} @@ -721,7 +750,7 @@ func TestUpdateMetricThresholds(t *testing.T) { assert.NoError(t, err) }) t.Run("validating pushback from throttler again", func(t *testing.T) { - waitForThrottleCheckStatus(t, primaryTablet, http.StatusTooManyRequests) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED) }) t.Run("restoring standard threshold", func(t *testing.T) { req := &vtctldatapb.UpdateThrottlerConfigRequest{Threshold: throttler.DefaultThreshold.Seconds()} @@ -731,7 +760,7 @@ func TestUpdateMetricThresholds(t *testing.T) { for _, tablet := range []cluster.Vttablet{*primaryTablet, *replicaTablet} { throttler.WaitForThrottlerStatusEnabled(t, &clusterInstance.VtctldClientProcess, &tablet, true, &throttler.Config{Query: throttler.DefaultQuery, Threshold: throttler.DefaultThreshold.Seconds()}, throttlerEnabledTimeout) } - waitForThrottleCheckStatus(t, primaryTablet, http.StatusTooManyRequests) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED) }) } @@ -748,7 +777,7 @@ func TestUpdateAppCheckedMetrics(t *testing.T) { for _, tablet := range []cluster.Vttablet{*primaryTablet, *replicaTablet} { throttler.WaitForThrottlerStatusEnabled(t, &clusterInstance.VtctldClientProcess, &tablet, true, &throttler.Config{Query: throttler.DefaultQuery, Threshold: throttler.DefaultThreshold.Seconds()}, throttlerEnabledTimeout) } - waitForThrottleCheckStatus(t, primaryTablet, http.StatusTooManyRequests) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED) }) t.Run("assigning 'loadavg' metrics to 'test' app", func(t *testing.T) { { @@ -774,7 +803,7 @@ func TestUpdateAppCheckedMetrics(t *testing.T) { throttler.WaitForThrottlerStatusEnabled(t, &clusterInstance.VtctldClientProcess, &tablet, true, &throttler.Config{Query: throttler.DefaultQuery, Threshold: unreasonablyLowThreshold.Seconds()}, throttlerEnabledTimeout) } t.Run("validating OK response from throttler since it's checking loadavg", func(t *testing.T) { - if !waitForThrottleCheckStatus(t, primaryTablet, http.StatusOK) { + if !waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_OK) { t.Logf("throttler primary status: %+v", throttleStatus(t, primaryTablet)) t.Logf("throttler replica status: %+v", throttleStatus(t, replicaTablet)) } @@ -799,7 +828,7 @@ func TestUpdateAppCheckedMetrics(t *testing.T) { throttler.WaitForThrottlerStatusEnabled(t, &clusterInstance.VtctldClientProcess, &tablet, true, &throttler.Config{Query: throttler.DefaultQuery, Threshold: unreasonablyLowThreshold.Seconds()}, throttlerEnabledTimeout) } t.Run("validating pushback from throttler since lag is above threshold", func(t *testing.T) { - waitForThrottleCheckStatus(t, primaryTablet, http.StatusTooManyRequests) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED) }) }) t.Run("removing assignment from 'test' app and restoring defaults", func(t *testing.T) { @@ -826,7 +855,7 @@ func TestUpdateAppCheckedMetrics(t *testing.T) { throttler.WaitForThrottlerStatusEnabled(t, &clusterInstance.VtctldClientProcess, &tablet, true, &throttler.Config{Query: throttler.DefaultQuery, Threshold: throttler.DefaultThreshold.Seconds()}, throttlerEnabledTimeout) } t.Run("validating error response from throttler since lag is still high", func(t *testing.T) { - waitForThrottleCheckStatus(t, primaryTablet, http.StatusTooManyRequests) + waitForThrottleCheckStatus(t, primaryTablet, tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED) }) }) } diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go index 715e2a2ab36..b324845cec1 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go @@ -96,6 +96,64 @@ func (TabletSelectionPreference) EnumDescriptor() ([]byte, []int) { return file_tabletmanagerdata_proto_rawDescGZIP(), []int{0} } +type CheckThrottlerResponseCode int32 + +const ( + CheckThrottlerResponseCode_UNDEFINED CheckThrottlerResponseCode = 0 + CheckThrottlerResponseCode_OK CheckThrottlerResponseCode = 1 + CheckThrottlerResponseCode_THRESHOLD_EXCEEDED CheckThrottlerResponseCode = 2 + CheckThrottlerResponseCode_APP_DENIED CheckThrottlerResponseCode = 3 + CheckThrottlerResponseCode_UNKNOWN_METRIC CheckThrottlerResponseCode = 4 + CheckThrottlerResponseCode_INTERNAL_ERROR CheckThrottlerResponseCode = 5 +) + +// Enum value maps for CheckThrottlerResponseCode. +var ( + CheckThrottlerResponseCode_name = map[int32]string{ + 0: "UNDEFINED", + 1: "OK", + 2: "THRESHOLD_EXCEEDED", + 3: "APP_DENIED", + 4: "UNKNOWN_METRIC", + 5: "INTERNAL_ERROR", + } + CheckThrottlerResponseCode_value = map[string]int32{ + "UNDEFINED": 0, + "OK": 1, + "THRESHOLD_EXCEEDED": 2, + "APP_DENIED": 3, + "UNKNOWN_METRIC": 4, + "INTERNAL_ERROR": 5, + } +) + +func (x CheckThrottlerResponseCode) Enum() *CheckThrottlerResponseCode { + p := new(CheckThrottlerResponseCode) + *p = x + return p +} + +func (x CheckThrottlerResponseCode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (CheckThrottlerResponseCode) Descriptor() protoreflect.EnumDescriptor { + return file_tabletmanagerdata_proto_enumTypes[1].Descriptor() +} + +func (CheckThrottlerResponseCode) Type() protoreflect.EnumType { + return &file_tabletmanagerdata_proto_enumTypes[1] +} + +func (x CheckThrottlerResponseCode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use CheckThrottlerResponseCode.Descriptor instead. +func (CheckThrottlerResponseCode) EnumDescriptor() ([]byte, []int) { + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{1} +} + type TableDefinition struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -6640,6 +6698,8 @@ type CheckThrottlerResponse struct { AppName string `protobuf:"bytes,8,opt,name=app_name,json=appName,proto3" json:"app_name,omitempty"` // Summary is a human readable analysis of the result Summary string `protobuf:"bytes,9,opt,name=summary,proto3" json:"summary,omitempty"` + // ResponseCode is the enum representation of the response + ResponseCode CheckThrottlerResponseCode `protobuf:"varint,10,opt,name=response_code,json=responseCode,proto3,enum=tabletmanagerdata.CheckThrottlerResponseCode" json:"response_code,omitempty"` } func (x *CheckThrottlerResponse) Reset() { @@ -6737,6 +6797,13 @@ func (x *CheckThrottlerResponse) GetSummary() string { return "" } +func (x *CheckThrottlerResponse) GetResponseCode() CheckThrottlerResponseCode { + if x != nil { + return x.ResponseCode + } + return CheckThrottlerResponseCode_UNDEFINED +} + type GetThrottlerStatusRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -7146,6 +7213,8 @@ type CheckThrottlerResponse_Metric struct { Message string `protobuf:"bytes,6,opt,name=message,proto3" json:"message,omitempty"` // Scope used in this check Scope string `protobuf:"bytes,7,opt,name=scope,proto3" json:"scope,omitempty"` + // ResponseCode is the enum representation of the response + ResponseCode CheckThrottlerResponseCode `protobuf:"varint,8,opt,name=response_code,json=responseCode,proto3,enum=tabletmanagerdata.CheckThrottlerResponseCode" json:"response_code,omitempty"` } func (x *CheckThrottlerResponse_Metric) Reset() { @@ -7229,6 +7298,13 @@ func (x *CheckThrottlerResponse_Metric) GetScope() string { return "" } +func (x *CheckThrottlerResponse_Metric) GetResponseCode() CheckThrottlerResponseCode { + if x != nil { + return x.ResponseCode + } + return CheckThrottlerResponseCode_UNDEFINED +} + type GetThrottlerStatusResponse_MetricResult struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -7346,6 +7422,8 @@ type GetThrottlerStatusResponse_RecentApp struct { CheckedAt *vttime.Time `protobuf:"bytes,1,opt,name=checked_at,json=checkedAt,proto3" json:"checked_at,omitempty"` StatusCode int32 `protobuf:"varint,2,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` + // ResponseCode is the enum representation of the response + ResponseCode CheckThrottlerResponseCode `protobuf:"varint,3,opt,name=response_code,json=responseCode,proto3,enum=tabletmanagerdata.CheckThrottlerResponseCode" json:"response_code,omitempty"` } func (x *GetThrottlerStatusResponse_RecentApp) Reset() { @@ -7394,6 +7472,13 @@ func (x *GetThrottlerStatusResponse_RecentApp) GetStatusCode() int32 { return 0 } +func (x *GetThrottlerStatusResponse_RecentApp) GetResponseCode() CheckThrottlerResponseCode { + if x != nil { + return x.ResponseCode + } + return CheckThrottlerResponseCode_UNDEFINED +} + var File_tabletmanagerdata_proto protoreflect.FileDescriptor var file_tabletmanagerdata_proto_rawDesc = []byte{ @@ -8229,7 +8314,7 @@ var file_tabletmanagerdata_proto_rawDesc = []byte{ 0x74, 0x45, 0x78, 0x69, 0x73, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x4d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0xf7, 0x04, 0x0a, 0x16, + 0x72, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x9f, 0x06, 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, @@ -8250,161 +8335,186 @@ var file_tabletmanagerdata_proto_rawDesc = []byte{ 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x70, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x70, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x1a, 0xb7, 0x01, - 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 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, 0x03, 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, 0x04, 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, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x1a, 0x6c, 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x46, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 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, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x1b, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, - 0x74, 0x74, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0xe1, 0x0f, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, - 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, - 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, - 0x6c, 0x69, 0x61, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x6c, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x4c, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, - 0x69, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x09, 0x69, 0x73, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x69, - 0x73, 0x5f, 0x64, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x09, 0x69, 0x73, 0x44, 0x6f, 0x72, 0x6d, 0x61, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x6c, 0x61, - 0x67, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6c, 0x61, 0x67, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x2e, 0x0a, 0x13, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x12, 0x2b, 0x0a, 0x11, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, - 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x01, 0x52, - 0x10, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, - 0x64, 0x12, 0x3c, 0x0a, 0x1b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x5f, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x73, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4e, 0x61, - 0x6d, 0x65, 0x55, 0x73, 0x65, 0x64, 0x41, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, - 0x73, 0x0a, 0x12, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, - 0x67, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x11, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x73, 0x12, 0x70, 0x0a, 0x11, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x74, - 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x43, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x12, 0x67, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, - 0x73, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x40, - 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x73, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x0d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, - 0x67, 0x0a, 0x0e, 0x74, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x5f, 0x61, 0x70, 0x70, - 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x52, 0x0a, + 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 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, 0x43, + 0x6f, 0x64, 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, + 0x65, 0x1a, 0x8b, 0x02, 0x0a, 0x06, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x02, 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, 0x03, 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, 0x04, 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, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x52, 0x0a, 0x0d, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x2d, 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, 0x43, 0x6f, 0x64, + 0x65, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x1a, + 0x6c, 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x46, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x30, 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, 0x2e, 0x4d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x1b, 0x0a, + 0x19, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xb6, 0x10, 0x0a, 0x1a, 0x47, + 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x1a, 0x0a, 0x08, + 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x61, 0x72, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x68, 0x61, 0x72, 0x64, 0x12, 0x1b, + 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x6c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x08, 0x69, 0x73, 0x4c, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x69, + 0x73, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, + 0x4f, 0x70, 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x64, 0x6f, 0x72, 0x6d, 0x61, 0x6e, + 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x44, 0x6f, 0x72, 0x6d, 0x61, + 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x6c, 0x61, 0x67, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6c, 0x61, + 0x67, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2e, 0x0a, 0x13, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2b, 0x0a, 0x11, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, + 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x01, 0x52, 0x10, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x3c, 0x0a, 0x1b, 0x6d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x73, + 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x17, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4e, 0x61, 0x6d, 0x65, 0x55, 0x73, 0x65, 0x64, 0x41, 0x73, + 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x73, 0x0a, 0x12, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x0c, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, + 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, + 0x74, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x61, 0x67, 0x67, 0x72, 0x65, + 0x67, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x70, 0x0a, 0x11, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x43, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x64, - 0x41, 0x70, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x74, 0x68, 0x72, 0x6f, 0x74, - 0x74, 0x6c, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x12, 0x74, 0x0a, 0x13, 0x61, 0x70, 0x70, 0x5f, - 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, - 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x44, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, - 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x4d, - 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x61, 0x70, 0x70, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x29, - 0x0a, 0x10, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, - 0x65, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, - 0x6c, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x5e, 0x0a, 0x0b, 0x72, 0x65, 0x63, - 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x70, 0x70, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x68, 0x72, + 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x6d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x12, 0x67, + 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, + 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, + 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x48, 0x65, 0x61, + 0x6c, 0x74, 0x68, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x73, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x67, 0x0a, 0x0e, 0x74, 0x68, 0x72, 0x6f, 0x74, + 0x74, 0x6c, 0x65, 0x64, 0x5f, 0x61, 0x70, 0x70, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x40, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x54, + 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x0d, 0x74, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, + 0x12, 0x74, 0x0a, 0x13, 0x61, 0x70, 0x70, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x5f, + 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x44, 0x2e, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x70, 0x70, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x11, 0x61, 0x70, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x4d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, + 0x6c, 0x79, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0f, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, + 0x64, 0x12, 0x5e, 0x0a, 0x0b, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x70, 0x70, 0x73, + 0x18, 0x12, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, + 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, + 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x72, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, + 0x73, 0x1a, 0x3a, 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0x80, 0x01, + 0x0a, 0x16, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, + 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x50, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, + 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x43, 0x0a, 0x15, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x81, 0x01, 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x34, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x68, + 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0c, 0x2e, 0x76, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x0d, 0x6c, + 0x61, 0x73, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x41, 0x74, 0x12, 0x3b, 0x0a, 0x1a, + 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x6c, 0x61, + 0x73, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x17, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x4c, 0x61, + 0x73, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x1a, 0x7c, 0x0a, 0x12, 0x4d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x73, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x50, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x3a, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, + 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, + 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x5c, 0x0a, 0x12, 0x54, 0x68, 0x72, 0x6f, 0x74, + 0x74, 0x6c, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, + 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, + 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, + 0x6c, 0x65, 0x64, 0x41, 0x70, 0x70, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x44, 0x0a, 0x16, 0x41, 0x70, 0x70, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0xad, 0x01, 0x0a, 0x09, + 0x52, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, 0x12, 0x2b, 0x0a, 0x0a, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, + 0x76, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x09, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x52, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, - 0x63, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0a, 0x72, - 0x65, 0x63, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, 0x73, 0x1a, 0x3a, 0x0a, 0x0c, 0x4d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x1a, 0x80, 0x01, 0x0a, 0x16, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x50, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x3a, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, - 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, - 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x43, 0x0a, 0x15, 0x4d, 0x65, 0x74, 0x72, - 0x69, 0x63, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x81, 0x01, - 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x12, 0x34, - 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x5f, 0x61, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, 0x74, 0x74, 0x69, 0x6d, 0x65, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x79, 0x41, 0x74, 0x12, 0x3b, 0x0a, 0x1a, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x5f, - 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x68, 0x65, 0x61, 0x6c, 0x74, - 0x68, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x17, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, - 0x73, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x4c, 0x61, 0x73, 0x74, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x79, 0x1a, 0x7c, 0x0a, 0x12, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x48, 0x65, 0x61, 0x6c, - 0x74, 0x68, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x50, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x3a, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, - 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, - 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x48, 0x65, - 0x61, 0x6c, 0x74, 0x68, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x5c, 0x0a, 0x12, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x41, 0x70, 0x70, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x64, 0x41, 0x70, 0x70, 0x52, 0x75, - 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x44, 0x0a, - 0x16, 0x41, 0x70, 0x70, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69, - 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x1a, 0x59, 0x0a, 0x09, 0x52, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, - 0x12, 0x2b, 0x0a, 0x0a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x76, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x52, 0x09, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1f, 0x0a, - 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x1a, 0x76, - 0x0a, 0x0f, 0x52, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x4d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, - 0x6c, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x3e, 0x0a, 0x19, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, - 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, - 0x6e, 0x63, 0x65, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x59, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, - 0x49, 0x4e, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, - 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x03, 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, + 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, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x0c, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x1a, 0x76, 0x0a, 0x0f, 0x52, + 0x65, 0x63, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x4d, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x37, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, + 0x61, 0x74, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x68, 0x72, 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, + 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, + 0x65, 0x63, 0x65, 0x6e, 0x74, 0x41, 0x70, 0x70, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x2a, 0x3e, 0x0a, 0x19, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x53, 0x65, 0x6c, + 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, + 0x12, 0x07, 0x0a, 0x03, 0x41, 0x4e, 0x59, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x4f, + 0x52, 0x44, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x03, 0x2a, 0x83, 0x01, 0x0a, 0x1a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x68, 0x72, + 0x6f, 0x74, 0x74, 0x6c, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x43, 0x6f, + 0x64, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x06, 0x0a, 0x02, 0x4f, 0x4b, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x48, 0x52, + 0x45, 0x53, 0x48, 0x4f, 0x4c, 0x44, 0x5f, 0x45, 0x58, 0x43, 0x45, 0x45, 0x44, 0x45, 0x44, 0x10, + 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x41, 0x50, 0x50, 0x5f, 0x44, 0x45, 0x4e, 0x49, 0x45, 0x44, 0x10, + 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x5f, 0x4d, 0x45, 0x54, + 0x52, 0x49, 0x43, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, + 0x4c, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x05, 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 ( @@ -8419,263 +8529,267 @@ func file_tabletmanagerdata_proto_rawDescGZIP() []byte { return file_tabletmanagerdata_proto_rawDescData } -var file_tabletmanagerdata_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_tabletmanagerdata_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_tabletmanagerdata_proto_msgTypes = make([]protoimpl.MessageInfo, 142) var file_tabletmanagerdata_proto_goTypes = []any{ (TabletSelectionPreference)(0), // 0: tabletmanagerdata.TabletSelectionPreference - (*TableDefinition)(nil), // 1: tabletmanagerdata.TableDefinition - (*SchemaDefinition)(nil), // 2: tabletmanagerdata.SchemaDefinition - (*SchemaChangeResult)(nil), // 3: tabletmanagerdata.SchemaChangeResult - (*UserPermission)(nil), // 4: tabletmanagerdata.UserPermission - (*DbPermission)(nil), // 5: tabletmanagerdata.DbPermission - (*Permissions)(nil), // 6: tabletmanagerdata.Permissions - (*PingRequest)(nil), // 7: tabletmanagerdata.PingRequest - (*PingResponse)(nil), // 8: tabletmanagerdata.PingResponse - (*SleepRequest)(nil), // 9: tabletmanagerdata.SleepRequest - (*SleepResponse)(nil), // 10: tabletmanagerdata.SleepResponse - (*ExecuteHookRequest)(nil), // 11: tabletmanagerdata.ExecuteHookRequest - (*ExecuteHookResponse)(nil), // 12: tabletmanagerdata.ExecuteHookResponse - (*GetSchemaRequest)(nil), // 13: tabletmanagerdata.GetSchemaRequest - (*GetSchemaResponse)(nil), // 14: tabletmanagerdata.GetSchemaResponse - (*GetPermissionsRequest)(nil), // 15: tabletmanagerdata.GetPermissionsRequest - (*GetPermissionsResponse)(nil), // 16: tabletmanagerdata.GetPermissionsResponse - (*GetGlobalStatusVarsRequest)(nil), // 17: tabletmanagerdata.GetGlobalStatusVarsRequest - (*GetGlobalStatusVarsResponse)(nil), // 18: tabletmanagerdata.GetGlobalStatusVarsResponse - (*SetReadOnlyRequest)(nil), // 19: tabletmanagerdata.SetReadOnlyRequest - (*SetReadOnlyResponse)(nil), // 20: tabletmanagerdata.SetReadOnlyResponse - (*SetReadWriteRequest)(nil), // 21: tabletmanagerdata.SetReadWriteRequest - (*SetReadWriteResponse)(nil), // 22: tabletmanagerdata.SetReadWriteResponse - (*ChangeTypeRequest)(nil), // 23: tabletmanagerdata.ChangeTypeRequest - (*ChangeTypeResponse)(nil), // 24: tabletmanagerdata.ChangeTypeResponse - (*RefreshStateRequest)(nil), // 25: tabletmanagerdata.RefreshStateRequest - (*RefreshStateResponse)(nil), // 26: tabletmanagerdata.RefreshStateResponse - (*RunHealthCheckRequest)(nil), // 27: tabletmanagerdata.RunHealthCheckRequest - (*RunHealthCheckResponse)(nil), // 28: tabletmanagerdata.RunHealthCheckResponse - (*ReloadSchemaRequest)(nil), // 29: tabletmanagerdata.ReloadSchemaRequest - (*ReloadSchemaResponse)(nil), // 30: tabletmanagerdata.ReloadSchemaResponse - (*PreflightSchemaRequest)(nil), // 31: tabletmanagerdata.PreflightSchemaRequest - (*PreflightSchemaResponse)(nil), // 32: tabletmanagerdata.PreflightSchemaResponse - (*ApplySchemaRequest)(nil), // 33: tabletmanagerdata.ApplySchemaRequest - (*ApplySchemaResponse)(nil), // 34: tabletmanagerdata.ApplySchemaResponse - (*LockTablesRequest)(nil), // 35: tabletmanagerdata.LockTablesRequest - (*LockTablesResponse)(nil), // 36: tabletmanagerdata.LockTablesResponse - (*UnlockTablesRequest)(nil), // 37: tabletmanagerdata.UnlockTablesRequest - (*UnlockTablesResponse)(nil), // 38: tabletmanagerdata.UnlockTablesResponse - (*ExecuteQueryRequest)(nil), // 39: tabletmanagerdata.ExecuteQueryRequest - (*ExecuteQueryResponse)(nil), // 40: tabletmanagerdata.ExecuteQueryResponse - (*ExecuteFetchAsDbaRequest)(nil), // 41: tabletmanagerdata.ExecuteFetchAsDbaRequest - (*ExecuteFetchAsDbaResponse)(nil), // 42: tabletmanagerdata.ExecuteFetchAsDbaResponse - (*ExecuteMultiFetchAsDbaRequest)(nil), // 43: tabletmanagerdata.ExecuteMultiFetchAsDbaRequest - (*ExecuteMultiFetchAsDbaResponse)(nil), // 44: tabletmanagerdata.ExecuteMultiFetchAsDbaResponse - (*ExecuteFetchAsAllPrivsRequest)(nil), // 45: tabletmanagerdata.ExecuteFetchAsAllPrivsRequest - (*ExecuteFetchAsAllPrivsResponse)(nil), // 46: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse - (*ExecuteFetchAsAppRequest)(nil), // 47: tabletmanagerdata.ExecuteFetchAsAppRequest - (*ExecuteFetchAsAppResponse)(nil), // 48: tabletmanagerdata.ExecuteFetchAsAppResponse - (*ReplicationStatusRequest)(nil), // 49: tabletmanagerdata.ReplicationStatusRequest - (*ReplicationStatusResponse)(nil), // 50: tabletmanagerdata.ReplicationStatusResponse - (*PrimaryStatusRequest)(nil), // 51: tabletmanagerdata.PrimaryStatusRequest - (*PrimaryStatusResponse)(nil), // 52: tabletmanagerdata.PrimaryStatusResponse - (*PrimaryPositionRequest)(nil), // 53: tabletmanagerdata.PrimaryPositionRequest - (*PrimaryPositionResponse)(nil), // 54: tabletmanagerdata.PrimaryPositionResponse - (*WaitForPositionRequest)(nil), // 55: tabletmanagerdata.WaitForPositionRequest - (*WaitForPositionResponse)(nil), // 56: tabletmanagerdata.WaitForPositionResponse - (*StopReplicationRequest)(nil), // 57: tabletmanagerdata.StopReplicationRequest - (*StopReplicationResponse)(nil), // 58: tabletmanagerdata.StopReplicationResponse - (*StopReplicationMinimumRequest)(nil), // 59: tabletmanagerdata.StopReplicationMinimumRequest - (*StopReplicationMinimumResponse)(nil), // 60: tabletmanagerdata.StopReplicationMinimumResponse - (*StartReplicationRequest)(nil), // 61: tabletmanagerdata.StartReplicationRequest - (*StartReplicationResponse)(nil), // 62: tabletmanagerdata.StartReplicationResponse - (*StartReplicationUntilAfterRequest)(nil), // 63: tabletmanagerdata.StartReplicationUntilAfterRequest - (*StartReplicationUntilAfterResponse)(nil), // 64: tabletmanagerdata.StartReplicationUntilAfterResponse - (*GetReplicasRequest)(nil), // 65: tabletmanagerdata.GetReplicasRequest - (*GetReplicasResponse)(nil), // 66: tabletmanagerdata.GetReplicasResponse - (*ResetReplicationRequest)(nil), // 67: tabletmanagerdata.ResetReplicationRequest - (*ResetReplicationResponse)(nil), // 68: tabletmanagerdata.ResetReplicationResponse - (*VReplicationExecRequest)(nil), // 69: tabletmanagerdata.VReplicationExecRequest - (*VReplicationExecResponse)(nil), // 70: tabletmanagerdata.VReplicationExecResponse - (*VReplicationWaitForPosRequest)(nil), // 71: tabletmanagerdata.VReplicationWaitForPosRequest - (*VReplicationWaitForPosResponse)(nil), // 72: tabletmanagerdata.VReplicationWaitForPosResponse - (*InitPrimaryRequest)(nil), // 73: tabletmanagerdata.InitPrimaryRequest - (*InitPrimaryResponse)(nil), // 74: tabletmanagerdata.InitPrimaryResponse - (*PopulateReparentJournalRequest)(nil), // 75: tabletmanagerdata.PopulateReparentJournalRequest - (*PopulateReparentJournalResponse)(nil), // 76: tabletmanagerdata.PopulateReparentJournalResponse - (*InitReplicaRequest)(nil), // 77: tabletmanagerdata.InitReplicaRequest - (*InitReplicaResponse)(nil), // 78: tabletmanagerdata.InitReplicaResponse - (*DemotePrimaryRequest)(nil), // 79: tabletmanagerdata.DemotePrimaryRequest - (*DemotePrimaryResponse)(nil), // 80: tabletmanagerdata.DemotePrimaryResponse - (*UndoDemotePrimaryRequest)(nil), // 81: tabletmanagerdata.UndoDemotePrimaryRequest - (*UndoDemotePrimaryResponse)(nil), // 82: tabletmanagerdata.UndoDemotePrimaryResponse - (*ReplicaWasPromotedRequest)(nil), // 83: tabletmanagerdata.ReplicaWasPromotedRequest - (*ReplicaWasPromotedResponse)(nil), // 84: tabletmanagerdata.ReplicaWasPromotedResponse - (*ResetReplicationParametersRequest)(nil), // 85: tabletmanagerdata.ResetReplicationParametersRequest - (*ResetReplicationParametersResponse)(nil), // 86: tabletmanagerdata.ResetReplicationParametersResponse - (*FullStatusRequest)(nil), // 87: tabletmanagerdata.FullStatusRequest - (*FullStatusResponse)(nil), // 88: tabletmanagerdata.FullStatusResponse - (*SetReplicationSourceRequest)(nil), // 89: tabletmanagerdata.SetReplicationSourceRequest - (*SetReplicationSourceResponse)(nil), // 90: tabletmanagerdata.SetReplicationSourceResponse - (*ReplicaWasRestartedRequest)(nil), // 91: tabletmanagerdata.ReplicaWasRestartedRequest - (*ReplicaWasRestartedResponse)(nil), // 92: tabletmanagerdata.ReplicaWasRestartedResponse - (*StopReplicationAndGetStatusRequest)(nil), // 93: tabletmanagerdata.StopReplicationAndGetStatusRequest - (*StopReplicationAndGetStatusResponse)(nil), // 94: tabletmanagerdata.StopReplicationAndGetStatusResponse - (*PromoteReplicaRequest)(nil), // 95: tabletmanagerdata.PromoteReplicaRequest - (*PromoteReplicaResponse)(nil), // 96: tabletmanagerdata.PromoteReplicaResponse - (*BackupRequest)(nil), // 97: tabletmanagerdata.BackupRequest - (*BackupResponse)(nil), // 98: tabletmanagerdata.BackupResponse - (*RestoreFromBackupRequest)(nil), // 99: tabletmanagerdata.RestoreFromBackupRequest - (*RestoreFromBackupResponse)(nil), // 100: tabletmanagerdata.RestoreFromBackupResponse - (*CreateVReplicationWorkflowRequest)(nil), // 101: tabletmanagerdata.CreateVReplicationWorkflowRequest - (*CreateVReplicationWorkflowResponse)(nil), // 102: tabletmanagerdata.CreateVReplicationWorkflowResponse - (*DeleteVReplicationWorkflowRequest)(nil), // 103: tabletmanagerdata.DeleteVReplicationWorkflowRequest - (*DeleteVReplicationWorkflowResponse)(nil), // 104: tabletmanagerdata.DeleteVReplicationWorkflowResponse - (*HasVReplicationWorkflowsRequest)(nil), // 105: tabletmanagerdata.HasVReplicationWorkflowsRequest - (*HasVReplicationWorkflowsResponse)(nil), // 106: tabletmanagerdata.HasVReplicationWorkflowsResponse - (*ReadVReplicationWorkflowsRequest)(nil), // 107: tabletmanagerdata.ReadVReplicationWorkflowsRequest - (*ReadVReplicationWorkflowsResponse)(nil), // 108: tabletmanagerdata.ReadVReplicationWorkflowsResponse - (*ReadVReplicationWorkflowRequest)(nil), // 109: tabletmanagerdata.ReadVReplicationWorkflowRequest - (*ReadVReplicationWorkflowResponse)(nil), // 110: tabletmanagerdata.ReadVReplicationWorkflowResponse - (*VDiffRequest)(nil), // 111: tabletmanagerdata.VDiffRequest - (*VDiffResponse)(nil), // 112: tabletmanagerdata.VDiffResponse - (*VDiffPickerOptions)(nil), // 113: tabletmanagerdata.VDiffPickerOptions - (*VDiffReportOptions)(nil), // 114: tabletmanagerdata.VDiffReportOptions - (*VDiffCoreOptions)(nil), // 115: tabletmanagerdata.VDiffCoreOptions - (*VDiffOptions)(nil), // 116: tabletmanagerdata.VDiffOptions - (*UpdateVReplicationWorkflowRequest)(nil), // 117: tabletmanagerdata.UpdateVReplicationWorkflowRequest - (*UpdateVReplicationWorkflowResponse)(nil), // 118: tabletmanagerdata.UpdateVReplicationWorkflowResponse - (*UpdateVReplicationWorkflowsRequest)(nil), // 119: tabletmanagerdata.UpdateVReplicationWorkflowsRequest - (*UpdateVReplicationWorkflowsResponse)(nil), // 120: tabletmanagerdata.UpdateVReplicationWorkflowsResponse - (*ResetSequencesRequest)(nil), // 121: tabletmanagerdata.ResetSequencesRequest - (*ResetSequencesResponse)(nil), // 122: tabletmanagerdata.ResetSequencesResponse - (*CheckThrottlerRequest)(nil), // 123: tabletmanagerdata.CheckThrottlerRequest - (*CheckThrottlerResponse)(nil), // 124: tabletmanagerdata.CheckThrottlerResponse - (*GetThrottlerStatusRequest)(nil), // 125: tabletmanagerdata.GetThrottlerStatusRequest - (*GetThrottlerStatusResponse)(nil), // 126: tabletmanagerdata.GetThrottlerStatusResponse - nil, // 127: tabletmanagerdata.UserPermission.PrivilegesEntry - nil, // 128: tabletmanagerdata.DbPermission.PrivilegesEntry - nil, // 129: tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry - nil, // 130: tabletmanagerdata.GetGlobalStatusVarsResponse.StatusValuesEntry - (*ReadVReplicationWorkflowResponse_Stream)(nil), // 131: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - (*CheckThrottlerResponse_Metric)(nil), // 132: tabletmanagerdata.CheckThrottlerResponse.Metric - nil, // 133: tabletmanagerdata.CheckThrottlerResponse.MetricsEntry - (*GetThrottlerStatusResponse_MetricResult)(nil), // 134: tabletmanagerdata.GetThrottlerStatusResponse.MetricResult - nil, // 135: tabletmanagerdata.GetThrottlerStatusResponse.AggregatedMetricsEntry - nil, // 136: tabletmanagerdata.GetThrottlerStatusResponse.MetricThresholdsEntry - (*GetThrottlerStatusResponse_MetricHealth)(nil), // 137: tabletmanagerdata.GetThrottlerStatusResponse.MetricHealth - nil, // 138: tabletmanagerdata.GetThrottlerStatusResponse.MetricsHealthEntry - nil, // 139: tabletmanagerdata.GetThrottlerStatusResponse.ThrottledAppsEntry - nil, // 140: tabletmanagerdata.GetThrottlerStatusResponse.AppCheckedMetricsEntry - (*GetThrottlerStatusResponse_RecentApp)(nil), // 141: tabletmanagerdata.GetThrottlerStatusResponse.RecentApp - nil, // 142: tabletmanagerdata.GetThrottlerStatusResponse.RecentAppsEntry - (*query.Field)(nil), // 143: query.Field - (topodata.TabletType)(0), // 144: topodata.TabletType - (*vtrpc.CallerID)(nil), // 145: vtrpc.CallerID - (*query.QueryResult)(nil), // 146: query.QueryResult - (*replicationdata.Status)(nil), // 147: replicationdata.Status - (*replicationdata.PrimaryStatus)(nil), // 148: replicationdata.PrimaryStatus - (*topodata.TabletAlias)(nil), // 149: topodata.TabletAlias - (*replicationdata.FullStatus)(nil), // 150: replicationdata.FullStatus - (replicationdata.StopReplicationMode)(0), // 151: replicationdata.StopReplicationMode - (*replicationdata.StopReplicationStatus)(nil), // 152: replicationdata.StopReplicationStatus - (*logutil.Event)(nil), // 153: logutil.Event - (*vttime.Time)(nil), // 154: vttime.Time - (*binlogdata.BinlogSource)(nil), // 155: binlogdata.BinlogSource - (binlogdata.VReplicationWorkflowType)(0), // 156: binlogdata.VReplicationWorkflowType - (binlogdata.VReplicationWorkflowSubType)(0), // 157: binlogdata.VReplicationWorkflowSubType - (binlogdata.VReplicationWorkflowState)(0), // 158: binlogdata.VReplicationWorkflowState - (binlogdata.OnDDLAction)(0), // 159: binlogdata.OnDDLAction - (*topodata.ThrottledAppRule)(nil), // 160: topodata.ThrottledAppRule + (CheckThrottlerResponseCode)(0), // 1: tabletmanagerdata.CheckThrottlerResponseCode + (*TableDefinition)(nil), // 2: tabletmanagerdata.TableDefinition + (*SchemaDefinition)(nil), // 3: tabletmanagerdata.SchemaDefinition + (*SchemaChangeResult)(nil), // 4: tabletmanagerdata.SchemaChangeResult + (*UserPermission)(nil), // 5: tabletmanagerdata.UserPermission + (*DbPermission)(nil), // 6: tabletmanagerdata.DbPermission + (*Permissions)(nil), // 7: tabletmanagerdata.Permissions + (*PingRequest)(nil), // 8: tabletmanagerdata.PingRequest + (*PingResponse)(nil), // 9: tabletmanagerdata.PingResponse + (*SleepRequest)(nil), // 10: tabletmanagerdata.SleepRequest + (*SleepResponse)(nil), // 11: tabletmanagerdata.SleepResponse + (*ExecuteHookRequest)(nil), // 12: tabletmanagerdata.ExecuteHookRequest + (*ExecuteHookResponse)(nil), // 13: tabletmanagerdata.ExecuteHookResponse + (*GetSchemaRequest)(nil), // 14: tabletmanagerdata.GetSchemaRequest + (*GetSchemaResponse)(nil), // 15: tabletmanagerdata.GetSchemaResponse + (*GetPermissionsRequest)(nil), // 16: tabletmanagerdata.GetPermissionsRequest + (*GetPermissionsResponse)(nil), // 17: tabletmanagerdata.GetPermissionsResponse + (*GetGlobalStatusVarsRequest)(nil), // 18: tabletmanagerdata.GetGlobalStatusVarsRequest + (*GetGlobalStatusVarsResponse)(nil), // 19: tabletmanagerdata.GetGlobalStatusVarsResponse + (*SetReadOnlyRequest)(nil), // 20: tabletmanagerdata.SetReadOnlyRequest + (*SetReadOnlyResponse)(nil), // 21: tabletmanagerdata.SetReadOnlyResponse + (*SetReadWriteRequest)(nil), // 22: tabletmanagerdata.SetReadWriteRequest + (*SetReadWriteResponse)(nil), // 23: tabletmanagerdata.SetReadWriteResponse + (*ChangeTypeRequest)(nil), // 24: tabletmanagerdata.ChangeTypeRequest + (*ChangeTypeResponse)(nil), // 25: tabletmanagerdata.ChangeTypeResponse + (*RefreshStateRequest)(nil), // 26: tabletmanagerdata.RefreshStateRequest + (*RefreshStateResponse)(nil), // 27: tabletmanagerdata.RefreshStateResponse + (*RunHealthCheckRequest)(nil), // 28: tabletmanagerdata.RunHealthCheckRequest + (*RunHealthCheckResponse)(nil), // 29: tabletmanagerdata.RunHealthCheckResponse + (*ReloadSchemaRequest)(nil), // 30: tabletmanagerdata.ReloadSchemaRequest + (*ReloadSchemaResponse)(nil), // 31: tabletmanagerdata.ReloadSchemaResponse + (*PreflightSchemaRequest)(nil), // 32: tabletmanagerdata.PreflightSchemaRequest + (*PreflightSchemaResponse)(nil), // 33: tabletmanagerdata.PreflightSchemaResponse + (*ApplySchemaRequest)(nil), // 34: tabletmanagerdata.ApplySchemaRequest + (*ApplySchemaResponse)(nil), // 35: tabletmanagerdata.ApplySchemaResponse + (*LockTablesRequest)(nil), // 36: tabletmanagerdata.LockTablesRequest + (*LockTablesResponse)(nil), // 37: tabletmanagerdata.LockTablesResponse + (*UnlockTablesRequest)(nil), // 38: tabletmanagerdata.UnlockTablesRequest + (*UnlockTablesResponse)(nil), // 39: tabletmanagerdata.UnlockTablesResponse + (*ExecuteQueryRequest)(nil), // 40: tabletmanagerdata.ExecuteQueryRequest + (*ExecuteQueryResponse)(nil), // 41: tabletmanagerdata.ExecuteQueryResponse + (*ExecuteFetchAsDbaRequest)(nil), // 42: tabletmanagerdata.ExecuteFetchAsDbaRequest + (*ExecuteFetchAsDbaResponse)(nil), // 43: tabletmanagerdata.ExecuteFetchAsDbaResponse + (*ExecuteMultiFetchAsDbaRequest)(nil), // 44: tabletmanagerdata.ExecuteMultiFetchAsDbaRequest + (*ExecuteMultiFetchAsDbaResponse)(nil), // 45: tabletmanagerdata.ExecuteMultiFetchAsDbaResponse + (*ExecuteFetchAsAllPrivsRequest)(nil), // 46: tabletmanagerdata.ExecuteFetchAsAllPrivsRequest + (*ExecuteFetchAsAllPrivsResponse)(nil), // 47: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse + (*ExecuteFetchAsAppRequest)(nil), // 48: tabletmanagerdata.ExecuteFetchAsAppRequest + (*ExecuteFetchAsAppResponse)(nil), // 49: tabletmanagerdata.ExecuteFetchAsAppResponse + (*ReplicationStatusRequest)(nil), // 50: tabletmanagerdata.ReplicationStatusRequest + (*ReplicationStatusResponse)(nil), // 51: tabletmanagerdata.ReplicationStatusResponse + (*PrimaryStatusRequest)(nil), // 52: tabletmanagerdata.PrimaryStatusRequest + (*PrimaryStatusResponse)(nil), // 53: tabletmanagerdata.PrimaryStatusResponse + (*PrimaryPositionRequest)(nil), // 54: tabletmanagerdata.PrimaryPositionRequest + (*PrimaryPositionResponse)(nil), // 55: tabletmanagerdata.PrimaryPositionResponse + (*WaitForPositionRequest)(nil), // 56: tabletmanagerdata.WaitForPositionRequest + (*WaitForPositionResponse)(nil), // 57: tabletmanagerdata.WaitForPositionResponse + (*StopReplicationRequest)(nil), // 58: tabletmanagerdata.StopReplicationRequest + (*StopReplicationResponse)(nil), // 59: tabletmanagerdata.StopReplicationResponse + (*StopReplicationMinimumRequest)(nil), // 60: tabletmanagerdata.StopReplicationMinimumRequest + (*StopReplicationMinimumResponse)(nil), // 61: tabletmanagerdata.StopReplicationMinimumResponse + (*StartReplicationRequest)(nil), // 62: tabletmanagerdata.StartReplicationRequest + (*StartReplicationResponse)(nil), // 63: tabletmanagerdata.StartReplicationResponse + (*StartReplicationUntilAfterRequest)(nil), // 64: tabletmanagerdata.StartReplicationUntilAfterRequest + (*StartReplicationUntilAfterResponse)(nil), // 65: tabletmanagerdata.StartReplicationUntilAfterResponse + (*GetReplicasRequest)(nil), // 66: tabletmanagerdata.GetReplicasRequest + (*GetReplicasResponse)(nil), // 67: tabletmanagerdata.GetReplicasResponse + (*ResetReplicationRequest)(nil), // 68: tabletmanagerdata.ResetReplicationRequest + (*ResetReplicationResponse)(nil), // 69: tabletmanagerdata.ResetReplicationResponse + (*VReplicationExecRequest)(nil), // 70: tabletmanagerdata.VReplicationExecRequest + (*VReplicationExecResponse)(nil), // 71: tabletmanagerdata.VReplicationExecResponse + (*VReplicationWaitForPosRequest)(nil), // 72: tabletmanagerdata.VReplicationWaitForPosRequest + (*VReplicationWaitForPosResponse)(nil), // 73: tabletmanagerdata.VReplicationWaitForPosResponse + (*InitPrimaryRequest)(nil), // 74: tabletmanagerdata.InitPrimaryRequest + (*InitPrimaryResponse)(nil), // 75: tabletmanagerdata.InitPrimaryResponse + (*PopulateReparentJournalRequest)(nil), // 76: tabletmanagerdata.PopulateReparentJournalRequest + (*PopulateReparentJournalResponse)(nil), // 77: tabletmanagerdata.PopulateReparentJournalResponse + (*InitReplicaRequest)(nil), // 78: tabletmanagerdata.InitReplicaRequest + (*InitReplicaResponse)(nil), // 79: tabletmanagerdata.InitReplicaResponse + (*DemotePrimaryRequest)(nil), // 80: tabletmanagerdata.DemotePrimaryRequest + (*DemotePrimaryResponse)(nil), // 81: tabletmanagerdata.DemotePrimaryResponse + (*UndoDemotePrimaryRequest)(nil), // 82: tabletmanagerdata.UndoDemotePrimaryRequest + (*UndoDemotePrimaryResponse)(nil), // 83: tabletmanagerdata.UndoDemotePrimaryResponse + (*ReplicaWasPromotedRequest)(nil), // 84: tabletmanagerdata.ReplicaWasPromotedRequest + (*ReplicaWasPromotedResponse)(nil), // 85: tabletmanagerdata.ReplicaWasPromotedResponse + (*ResetReplicationParametersRequest)(nil), // 86: tabletmanagerdata.ResetReplicationParametersRequest + (*ResetReplicationParametersResponse)(nil), // 87: tabletmanagerdata.ResetReplicationParametersResponse + (*FullStatusRequest)(nil), // 88: tabletmanagerdata.FullStatusRequest + (*FullStatusResponse)(nil), // 89: tabletmanagerdata.FullStatusResponse + (*SetReplicationSourceRequest)(nil), // 90: tabletmanagerdata.SetReplicationSourceRequest + (*SetReplicationSourceResponse)(nil), // 91: tabletmanagerdata.SetReplicationSourceResponse + (*ReplicaWasRestartedRequest)(nil), // 92: tabletmanagerdata.ReplicaWasRestartedRequest + (*ReplicaWasRestartedResponse)(nil), // 93: tabletmanagerdata.ReplicaWasRestartedResponse + (*StopReplicationAndGetStatusRequest)(nil), // 94: tabletmanagerdata.StopReplicationAndGetStatusRequest + (*StopReplicationAndGetStatusResponse)(nil), // 95: tabletmanagerdata.StopReplicationAndGetStatusResponse + (*PromoteReplicaRequest)(nil), // 96: tabletmanagerdata.PromoteReplicaRequest + (*PromoteReplicaResponse)(nil), // 97: tabletmanagerdata.PromoteReplicaResponse + (*BackupRequest)(nil), // 98: tabletmanagerdata.BackupRequest + (*BackupResponse)(nil), // 99: tabletmanagerdata.BackupResponse + (*RestoreFromBackupRequest)(nil), // 100: tabletmanagerdata.RestoreFromBackupRequest + (*RestoreFromBackupResponse)(nil), // 101: tabletmanagerdata.RestoreFromBackupResponse + (*CreateVReplicationWorkflowRequest)(nil), // 102: tabletmanagerdata.CreateVReplicationWorkflowRequest + (*CreateVReplicationWorkflowResponse)(nil), // 103: tabletmanagerdata.CreateVReplicationWorkflowResponse + (*DeleteVReplicationWorkflowRequest)(nil), // 104: tabletmanagerdata.DeleteVReplicationWorkflowRequest + (*DeleteVReplicationWorkflowResponse)(nil), // 105: tabletmanagerdata.DeleteVReplicationWorkflowResponse + (*HasVReplicationWorkflowsRequest)(nil), // 106: tabletmanagerdata.HasVReplicationWorkflowsRequest + (*HasVReplicationWorkflowsResponse)(nil), // 107: tabletmanagerdata.HasVReplicationWorkflowsResponse + (*ReadVReplicationWorkflowsRequest)(nil), // 108: tabletmanagerdata.ReadVReplicationWorkflowsRequest + (*ReadVReplicationWorkflowsResponse)(nil), // 109: tabletmanagerdata.ReadVReplicationWorkflowsResponse + (*ReadVReplicationWorkflowRequest)(nil), // 110: tabletmanagerdata.ReadVReplicationWorkflowRequest + (*ReadVReplicationWorkflowResponse)(nil), // 111: tabletmanagerdata.ReadVReplicationWorkflowResponse + (*VDiffRequest)(nil), // 112: tabletmanagerdata.VDiffRequest + (*VDiffResponse)(nil), // 113: tabletmanagerdata.VDiffResponse + (*VDiffPickerOptions)(nil), // 114: tabletmanagerdata.VDiffPickerOptions + (*VDiffReportOptions)(nil), // 115: tabletmanagerdata.VDiffReportOptions + (*VDiffCoreOptions)(nil), // 116: tabletmanagerdata.VDiffCoreOptions + (*VDiffOptions)(nil), // 117: tabletmanagerdata.VDiffOptions + (*UpdateVReplicationWorkflowRequest)(nil), // 118: tabletmanagerdata.UpdateVReplicationWorkflowRequest + (*UpdateVReplicationWorkflowResponse)(nil), // 119: tabletmanagerdata.UpdateVReplicationWorkflowResponse + (*UpdateVReplicationWorkflowsRequest)(nil), // 120: tabletmanagerdata.UpdateVReplicationWorkflowsRequest + (*UpdateVReplicationWorkflowsResponse)(nil), // 121: tabletmanagerdata.UpdateVReplicationWorkflowsResponse + (*ResetSequencesRequest)(nil), // 122: tabletmanagerdata.ResetSequencesRequest + (*ResetSequencesResponse)(nil), // 123: tabletmanagerdata.ResetSequencesResponse + (*CheckThrottlerRequest)(nil), // 124: tabletmanagerdata.CheckThrottlerRequest + (*CheckThrottlerResponse)(nil), // 125: tabletmanagerdata.CheckThrottlerResponse + (*GetThrottlerStatusRequest)(nil), // 126: tabletmanagerdata.GetThrottlerStatusRequest + (*GetThrottlerStatusResponse)(nil), // 127: tabletmanagerdata.GetThrottlerStatusResponse + nil, // 128: tabletmanagerdata.UserPermission.PrivilegesEntry + nil, // 129: tabletmanagerdata.DbPermission.PrivilegesEntry + nil, // 130: tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry + nil, // 131: tabletmanagerdata.GetGlobalStatusVarsResponse.StatusValuesEntry + (*ReadVReplicationWorkflowResponse_Stream)(nil), // 132: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + (*CheckThrottlerResponse_Metric)(nil), // 133: tabletmanagerdata.CheckThrottlerResponse.Metric + nil, // 134: tabletmanagerdata.CheckThrottlerResponse.MetricsEntry + (*GetThrottlerStatusResponse_MetricResult)(nil), // 135: tabletmanagerdata.GetThrottlerStatusResponse.MetricResult + nil, // 136: tabletmanagerdata.GetThrottlerStatusResponse.AggregatedMetricsEntry + nil, // 137: tabletmanagerdata.GetThrottlerStatusResponse.MetricThresholdsEntry + (*GetThrottlerStatusResponse_MetricHealth)(nil), // 138: tabletmanagerdata.GetThrottlerStatusResponse.MetricHealth + nil, // 139: tabletmanagerdata.GetThrottlerStatusResponse.MetricsHealthEntry + nil, // 140: tabletmanagerdata.GetThrottlerStatusResponse.ThrottledAppsEntry + nil, // 141: tabletmanagerdata.GetThrottlerStatusResponse.AppCheckedMetricsEntry + (*GetThrottlerStatusResponse_RecentApp)(nil), // 142: tabletmanagerdata.GetThrottlerStatusResponse.RecentApp + nil, // 143: tabletmanagerdata.GetThrottlerStatusResponse.RecentAppsEntry + (*query.Field)(nil), // 144: query.Field + (topodata.TabletType)(0), // 145: topodata.TabletType + (*vtrpc.CallerID)(nil), // 146: vtrpc.CallerID + (*query.QueryResult)(nil), // 147: query.QueryResult + (*replicationdata.Status)(nil), // 148: replicationdata.Status + (*replicationdata.PrimaryStatus)(nil), // 149: replicationdata.PrimaryStatus + (*topodata.TabletAlias)(nil), // 150: topodata.TabletAlias + (*replicationdata.FullStatus)(nil), // 151: replicationdata.FullStatus + (replicationdata.StopReplicationMode)(0), // 152: replicationdata.StopReplicationMode + (*replicationdata.StopReplicationStatus)(nil), // 153: replicationdata.StopReplicationStatus + (*logutil.Event)(nil), // 154: logutil.Event + (*vttime.Time)(nil), // 155: vttime.Time + (*binlogdata.BinlogSource)(nil), // 156: binlogdata.BinlogSource + (binlogdata.VReplicationWorkflowType)(0), // 157: binlogdata.VReplicationWorkflowType + (binlogdata.VReplicationWorkflowSubType)(0), // 158: binlogdata.VReplicationWorkflowSubType + (binlogdata.VReplicationWorkflowState)(0), // 159: binlogdata.VReplicationWorkflowState + (binlogdata.OnDDLAction)(0), // 160: binlogdata.OnDDLAction + (*topodata.ThrottledAppRule)(nil), // 161: topodata.ThrottledAppRule } var file_tabletmanagerdata_proto_depIdxs = []int32{ - 143, // 0: tabletmanagerdata.TableDefinition.fields:type_name -> query.Field - 1, // 1: tabletmanagerdata.SchemaDefinition.table_definitions:type_name -> tabletmanagerdata.TableDefinition - 2, // 2: tabletmanagerdata.SchemaChangeResult.before_schema:type_name -> tabletmanagerdata.SchemaDefinition - 2, // 3: tabletmanagerdata.SchemaChangeResult.after_schema:type_name -> tabletmanagerdata.SchemaDefinition - 127, // 4: tabletmanagerdata.UserPermission.privileges:type_name -> tabletmanagerdata.UserPermission.PrivilegesEntry - 128, // 5: tabletmanagerdata.DbPermission.privileges:type_name -> tabletmanagerdata.DbPermission.PrivilegesEntry - 4, // 6: tabletmanagerdata.Permissions.user_permissions:type_name -> tabletmanagerdata.UserPermission - 5, // 7: tabletmanagerdata.Permissions.db_permissions:type_name -> tabletmanagerdata.DbPermission - 129, // 8: tabletmanagerdata.ExecuteHookRequest.extra_env:type_name -> tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry - 2, // 9: tabletmanagerdata.GetSchemaResponse.schema_definition:type_name -> tabletmanagerdata.SchemaDefinition - 6, // 10: tabletmanagerdata.GetPermissionsResponse.permissions:type_name -> tabletmanagerdata.Permissions - 130, // 11: tabletmanagerdata.GetGlobalStatusVarsResponse.status_values:type_name -> tabletmanagerdata.GetGlobalStatusVarsResponse.StatusValuesEntry - 144, // 12: tabletmanagerdata.ChangeTypeRequest.tablet_type:type_name -> topodata.TabletType - 3, // 13: tabletmanagerdata.PreflightSchemaResponse.change_results:type_name -> tabletmanagerdata.SchemaChangeResult - 2, // 14: tabletmanagerdata.ApplySchemaRequest.before_schema:type_name -> tabletmanagerdata.SchemaDefinition - 2, // 15: tabletmanagerdata.ApplySchemaRequest.after_schema:type_name -> tabletmanagerdata.SchemaDefinition - 2, // 16: tabletmanagerdata.ApplySchemaResponse.before_schema:type_name -> tabletmanagerdata.SchemaDefinition - 2, // 17: tabletmanagerdata.ApplySchemaResponse.after_schema:type_name -> tabletmanagerdata.SchemaDefinition - 145, // 18: tabletmanagerdata.ExecuteQueryRequest.caller_id:type_name -> vtrpc.CallerID - 146, // 19: tabletmanagerdata.ExecuteQueryResponse.result:type_name -> query.QueryResult - 146, // 20: tabletmanagerdata.ExecuteFetchAsDbaResponse.result:type_name -> query.QueryResult - 146, // 21: tabletmanagerdata.ExecuteMultiFetchAsDbaResponse.results:type_name -> query.QueryResult - 146, // 22: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse.result:type_name -> query.QueryResult - 146, // 23: tabletmanagerdata.ExecuteFetchAsAppResponse.result:type_name -> query.QueryResult - 147, // 24: tabletmanagerdata.ReplicationStatusResponse.status:type_name -> replicationdata.Status - 148, // 25: tabletmanagerdata.PrimaryStatusResponse.status:type_name -> replicationdata.PrimaryStatus - 146, // 26: tabletmanagerdata.VReplicationExecResponse.result:type_name -> query.QueryResult - 149, // 27: tabletmanagerdata.PopulateReparentJournalRequest.primary_alias:type_name -> topodata.TabletAlias - 149, // 28: tabletmanagerdata.InitReplicaRequest.parent:type_name -> topodata.TabletAlias - 148, // 29: tabletmanagerdata.DemotePrimaryResponse.primary_status:type_name -> replicationdata.PrimaryStatus - 150, // 30: tabletmanagerdata.FullStatusResponse.status:type_name -> replicationdata.FullStatus - 149, // 31: tabletmanagerdata.SetReplicationSourceRequest.parent:type_name -> topodata.TabletAlias - 149, // 32: tabletmanagerdata.ReplicaWasRestartedRequest.parent:type_name -> topodata.TabletAlias - 151, // 33: tabletmanagerdata.StopReplicationAndGetStatusRequest.stop_replication_mode:type_name -> replicationdata.StopReplicationMode - 152, // 34: tabletmanagerdata.StopReplicationAndGetStatusResponse.status:type_name -> replicationdata.StopReplicationStatus - 153, // 35: tabletmanagerdata.BackupResponse.event:type_name -> logutil.Event - 154, // 36: tabletmanagerdata.RestoreFromBackupRequest.backup_time:type_name -> vttime.Time - 154, // 37: tabletmanagerdata.RestoreFromBackupRequest.restore_to_timestamp:type_name -> vttime.Time - 153, // 38: tabletmanagerdata.RestoreFromBackupResponse.event:type_name -> logutil.Event - 155, // 39: tabletmanagerdata.CreateVReplicationWorkflowRequest.binlog_source:type_name -> binlogdata.BinlogSource - 144, // 40: tabletmanagerdata.CreateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType + 144, // 0: tabletmanagerdata.TableDefinition.fields:type_name -> query.Field + 2, // 1: tabletmanagerdata.SchemaDefinition.table_definitions:type_name -> tabletmanagerdata.TableDefinition + 3, // 2: tabletmanagerdata.SchemaChangeResult.before_schema:type_name -> tabletmanagerdata.SchemaDefinition + 3, // 3: tabletmanagerdata.SchemaChangeResult.after_schema:type_name -> tabletmanagerdata.SchemaDefinition + 128, // 4: tabletmanagerdata.UserPermission.privileges:type_name -> tabletmanagerdata.UserPermission.PrivilegesEntry + 129, // 5: tabletmanagerdata.DbPermission.privileges:type_name -> tabletmanagerdata.DbPermission.PrivilegesEntry + 5, // 6: tabletmanagerdata.Permissions.user_permissions:type_name -> tabletmanagerdata.UserPermission + 6, // 7: tabletmanagerdata.Permissions.db_permissions:type_name -> tabletmanagerdata.DbPermission + 130, // 8: tabletmanagerdata.ExecuteHookRequest.extra_env:type_name -> tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry + 3, // 9: tabletmanagerdata.GetSchemaResponse.schema_definition:type_name -> tabletmanagerdata.SchemaDefinition + 7, // 10: tabletmanagerdata.GetPermissionsResponse.permissions:type_name -> tabletmanagerdata.Permissions + 131, // 11: tabletmanagerdata.GetGlobalStatusVarsResponse.status_values:type_name -> tabletmanagerdata.GetGlobalStatusVarsResponse.StatusValuesEntry + 145, // 12: tabletmanagerdata.ChangeTypeRequest.tablet_type:type_name -> topodata.TabletType + 4, // 13: tabletmanagerdata.PreflightSchemaResponse.change_results:type_name -> tabletmanagerdata.SchemaChangeResult + 3, // 14: tabletmanagerdata.ApplySchemaRequest.before_schema:type_name -> tabletmanagerdata.SchemaDefinition + 3, // 15: tabletmanagerdata.ApplySchemaRequest.after_schema:type_name -> tabletmanagerdata.SchemaDefinition + 3, // 16: tabletmanagerdata.ApplySchemaResponse.before_schema:type_name -> tabletmanagerdata.SchemaDefinition + 3, // 17: tabletmanagerdata.ApplySchemaResponse.after_schema:type_name -> tabletmanagerdata.SchemaDefinition + 146, // 18: tabletmanagerdata.ExecuteQueryRequest.caller_id:type_name -> vtrpc.CallerID + 147, // 19: tabletmanagerdata.ExecuteQueryResponse.result:type_name -> query.QueryResult + 147, // 20: tabletmanagerdata.ExecuteFetchAsDbaResponse.result:type_name -> query.QueryResult + 147, // 21: tabletmanagerdata.ExecuteMultiFetchAsDbaResponse.results:type_name -> query.QueryResult + 147, // 22: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse.result:type_name -> query.QueryResult + 147, // 23: tabletmanagerdata.ExecuteFetchAsAppResponse.result:type_name -> query.QueryResult + 148, // 24: tabletmanagerdata.ReplicationStatusResponse.status:type_name -> replicationdata.Status + 149, // 25: tabletmanagerdata.PrimaryStatusResponse.status:type_name -> replicationdata.PrimaryStatus + 147, // 26: tabletmanagerdata.VReplicationExecResponse.result:type_name -> query.QueryResult + 150, // 27: tabletmanagerdata.PopulateReparentJournalRequest.primary_alias:type_name -> topodata.TabletAlias + 150, // 28: tabletmanagerdata.InitReplicaRequest.parent:type_name -> topodata.TabletAlias + 149, // 29: tabletmanagerdata.DemotePrimaryResponse.primary_status:type_name -> replicationdata.PrimaryStatus + 151, // 30: tabletmanagerdata.FullStatusResponse.status:type_name -> replicationdata.FullStatus + 150, // 31: tabletmanagerdata.SetReplicationSourceRequest.parent:type_name -> topodata.TabletAlias + 150, // 32: tabletmanagerdata.ReplicaWasRestartedRequest.parent:type_name -> topodata.TabletAlias + 152, // 33: tabletmanagerdata.StopReplicationAndGetStatusRequest.stop_replication_mode:type_name -> replicationdata.StopReplicationMode + 153, // 34: tabletmanagerdata.StopReplicationAndGetStatusResponse.status:type_name -> replicationdata.StopReplicationStatus + 154, // 35: tabletmanagerdata.BackupResponse.event:type_name -> logutil.Event + 155, // 36: tabletmanagerdata.RestoreFromBackupRequest.backup_time:type_name -> vttime.Time + 155, // 37: tabletmanagerdata.RestoreFromBackupRequest.restore_to_timestamp:type_name -> vttime.Time + 154, // 38: tabletmanagerdata.RestoreFromBackupResponse.event:type_name -> logutil.Event + 156, // 39: tabletmanagerdata.CreateVReplicationWorkflowRequest.binlog_source:type_name -> binlogdata.BinlogSource + 145, // 40: tabletmanagerdata.CreateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType 0, // 41: tabletmanagerdata.CreateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 156, // 42: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_type:type_name -> binlogdata.VReplicationWorkflowType - 157, // 43: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType - 146, // 44: tabletmanagerdata.CreateVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 146, // 45: tabletmanagerdata.DeleteVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 158, // 46: tabletmanagerdata.ReadVReplicationWorkflowsRequest.include_states:type_name -> binlogdata.VReplicationWorkflowState - 158, // 47: tabletmanagerdata.ReadVReplicationWorkflowsRequest.exclude_states:type_name -> binlogdata.VReplicationWorkflowState - 110, // 48: tabletmanagerdata.ReadVReplicationWorkflowsResponse.workflows:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse - 144, // 49: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types:type_name -> topodata.TabletType + 157, // 42: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_type:type_name -> binlogdata.VReplicationWorkflowType + 158, // 43: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType + 147, // 44: tabletmanagerdata.CreateVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 147, // 45: tabletmanagerdata.DeleteVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 159, // 46: tabletmanagerdata.ReadVReplicationWorkflowsRequest.include_states:type_name -> binlogdata.VReplicationWorkflowState + 159, // 47: tabletmanagerdata.ReadVReplicationWorkflowsRequest.exclude_states:type_name -> binlogdata.VReplicationWorkflowState + 111, // 48: tabletmanagerdata.ReadVReplicationWorkflowsResponse.workflows:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse + 145, // 49: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types:type_name -> topodata.TabletType 0, // 50: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 156, // 51: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_type:type_name -> binlogdata.VReplicationWorkflowType - 157, // 52: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType - 131, // 53: tabletmanagerdata.ReadVReplicationWorkflowResponse.streams:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - 116, // 54: tabletmanagerdata.VDiffRequest.options:type_name -> tabletmanagerdata.VDiffOptions - 146, // 55: tabletmanagerdata.VDiffResponse.output:type_name -> query.QueryResult - 113, // 56: tabletmanagerdata.VDiffOptions.picker_options:type_name -> tabletmanagerdata.VDiffPickerOptions - 115, // 57: tabletmanagerdata.VDiffOptions.core_options:type_name -> tabletmanagerdata.VDiffCoreOptions - 114, // 58: tabletmanagerdata.VDiffOptions.report_options:type_name -> tabletmanagerdata.VDiffReportOptions - 144, // 59: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType + 157, // 51: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_type:type_name -> binlogdata.VReplicationWorkflowType + 158, // 52: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType + 132, // 53: tabletmanagerdata.ReadVReplicationWorkflowResponse.streams:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + 117, // 54: tabletmanagerdata.VDiffRequest.options:type_name -> tabletmanagerdata.VDiffOptions + 147, // 55: tabletmanagerdata.VDiffResponse.output:type_name -> query.QueryResult + 114, // 56: tabletmanagerdata.VDiffOptions.picker_options:type_name -> tabletmanagerdata.VDiffPickerOptions + 116, // 57: tabletmanagerdata.VDiffOptions.core_options:type_name -> tabletmanagerdata.VDiffCoreOptions + 115, // 58: tabletmanagerdata.VDiffOptions.report_options:type_name -> tabletmanagerdata.VDiffReportOptions + 145, // 59: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType 0, // 60: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 159, // 61: tabletmanagerdata.UpdateVReplicationWorkflowRequest.on_ddl:type_name -> binlogdata.OnDDLAction - 158, // 62: tabletmanagerdata.UpdateVReplicationWorkflowRequest.state:type_name -> binlogdata.VReplicationWorkflowState - 146, // 63: tabletmanagerdata.UpdateVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 158, // 64: tabletmanagerdata.UpdateVReplicationWorkflowsRequest.state:type_name -> binlogdata.VReplicationWorkflowState - 146, // 65: tabletmanagerdata.UpdateVReplicationWorkflowsResponse.result:type_name -> query.QueryResult - 133, // 66: tabletmanagerdata.CheckThrottlerResponse.metrics:type_name -> tabletmanagerdata.CheckThrottlerResponse.MetricsEntry - 135, // 67: tabletmanagerdata.GetThrottlerStatusResponse.aggregated_metrics:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.AggregatedMetricsEntry - 136, // 68: tabletmanagerdata.GetThrottlerStatusResponse.metric_thresholds:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricThresholdsEntry - 138, // 69: tabletmanagerdata.GetThrottlerStatusResponse.metrics_health:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricsHealthEntry - 139, // 70: tabletmanagerdata.GetThrottlerStatusResponse.throttled_apps:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.ThrottledAppsEntry - 140, // 71: tabletmanagerdata.GetThrottlerStatusResponse.app_checked_metrics:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.AppCheckedMetricsEntry - 142, // 72: tabletmanagerdata.GetThrottlerStatusResponse.recent_apps:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.RecentAppsEntry - 155, // 73: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.bls:type_name -> binlogdata.BinlogSource - 154, // 74: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_updated:type_name -> vttime.Time - 154, // 75: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.transaction_timestamp:type_name -> vttime.Time - 158, // 76: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.state:type_name -> binlogdata.VReplicationWorkflowState - 154, // 77: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_heartbeat:type_name -> vttime.Time - 154, // 78: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_throttled:type_name -> vttime.Time - 132, // 79: tabletmanagerdata.CheckThrottlerResponse.MetricsEntry.value:type_name -> tabletmanagerdata.CheckThrottlerResponse.Metric - 134, // 80: tabletmanagerdata.GetThrottlerStatusResponse.AggregatedMetricsEntry.value:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricResult - 154, // 81: tabletmanagerdata.GetThrottlerStatusResponse.MetricHealth.last_healthy_at:type_name -> vttime.Time - 137, // 82: tabletmanagerdata.GetThrottlerStatusResponse.MetricsHealthEntry.value:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricHealth - 160, // 83: tabletmanagerdata.GetThrottlerStatusResponse.ThrottledAppsEntry.value:type_name -> topodata.ThrottledAppRule - 154, // 84: tabletmanagerdata.GetThrottlerStatusResponse.RecentApp.checked_at:type_name -> vttime.Time - 141, // 85: tabletmanagerdata.GetThrottlerStatusResponse.RecentAppsEntry.value:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.RecentApp - 86, // [86:86] is the sub-list for method output_type - 86, // [86:86] is the sub-list for method input_type - 86, // [86:86] is the sub-list for extension type_name - 86, // [86:86] is the sub-list for extension extendee - 0, // [0:86] is the sub-list for field type_name + 160, // 61: tabletmanagerdata.UpdateVReplicationWorkflowRequest.on_ddl:type_name -> binlogdata.OnDDLAction + 159, // 62: tabletmanagerdata.UpdateVReplicationWorkflowRequest.state:type_name -> binlogdata.VReplicationWorkflowState + 147, // 63: tabletmanagerdata.UpdateVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 159, // 64: tabletmanagerdata.UpdateVReplicationWorkflowsRequest.state:type_name -> binlogdata.VReplicationWorkflowState + 147, // 65: tabletmanagerdata.UpdateVReplicationWorkflowsResponse.result:type_name -> query.QueryResult + 134, // 66: tabletmanagerdata.CheckThrottlerResponse.metrics:type_name -> tabletmanagerdata.CheckThrottlerResponse.MetricsEntry + 1, // 67: tabletmanagerdata.CheckThrottlerResponse.response_code:type_name -> tabletmanagerdata.CheckThrottlerResponseCode + 136, // 68: tabletmanagerdata.GetThrottlerStatusResponse.aggregated_metrics:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.AggregatedMetricsEntry + 137, // 69: tabletmanagerdata.GetThrottlerStatusResponse.metric_thresholds:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricThresholdsEntry + 139, // 70: tabletmanagerdata.GetThrottlerStatusResponse.metrics_health:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricsHealthEntry + 140, // 71: tabletmanagerdata.GetThrottlerStatusResponse.throttled_apps:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.ThrottledAppsEntry + 141, // 72: tabletmanagerdata.GetThrottlerStatusResponse.app_checked_metrics:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.AppCheckedMetricsEntry + 143, // 73: tabletmanagerdata.GetThrottlerStatusResponse.recent_apps:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.RecentAppsEntry + 156, // 74: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.bls:type_name -> binlogdata.BinlogSource + 155, // 75: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_updated:type_name -> vttime.Time + 155, // 76: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.transaction_timestamp:type_name -> vttime.Time + 159, // 77: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.state:type_name -> binlogdata.VReplicationWorkflowState + 155, // 78: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_heartbeat:type_name -> vttime.Time + 155, // 79: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_throttled:type_name -> vttime.Time + 1, // 80: tabletmanagerdata.CheckThrottlerResponse.Metric.response_code:type_name -> tabletmanagerdata.CheckThrottlerResponseCode + 133, // 81: tabletmanagerdata.CheckThrottlerResponse.MetricsEntry.value:type_name -> tabletmanagerdata.CheckThrottlerResponse.Metric + 135, // 82: tabletmanagerdata.GetThrottlerStatusResponse.AggregatedMetricsEntry.value:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricResult + 155, // 83: tabletmanagerdata.GetThrottlerStatusResponse.MetricHealth.last_healthy_at:type_name -> vttime.Time + 138, // 84: tabletmanagerdata.GetThrottlerStatusResponse.MetricsHealthEntry.value:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.MetricHealth + 161, // 85: tabletmanagerdata.GetThrottlerStatusResponse.ThrottledAppsEntry.value:type_name -> topodata.ThrottledAppRule + 155, // 86: tabletmanagerdata.GetThrottlerStatusResponse.RecentApp.checked_at:type_name -> vttime.Time + 1, // 87: tabletmanagerdata.GetThrottlerStatusResponse.RecentApp.response_code:type_name -> tabletmanagerdata.CheckThrottlerResponseCode + 142, // 88: tabletmanagerdata.GetThrottlerStatusResponse.RecentAppsEntry.value:type_name -> tabletmanagerdata.GetThrottlerStatusResponse.RecentApp + 89, // [89:89] is the sub-list for method output_type + 89, // [89:89] is the sub-list for method input_type + 89, // [89:89] is the sub-list for extension type_name + 89, // [89:89] is the sub-list for extension extendee + 0, // [0:89] is the sub-list for field type_name } func init() { file_tabletmanagerdata_proto_init() } @@ -10262,7 +10376,7 @@ func file_tabletmanagerdata_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_tabletmanagerdata_proto_rawDesc, - NumEnums: 1, + NumEnums: 2, NumMessages: 142, 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 eb0b058a56e..343e96b59b5 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go @@ -2499,13 +2499,14 @@ func (m *CheckThrottlerResponse_Metric) CloneVT() *CheckThrottlerResponse_Metric return (*CheckThrottlerResponse_Metric)(nil) } r := &CheckThrottlerResponse_Metric{ - Name: m.Name, - StatusCode: m.StatusCode, - Value: m.Value, - Threshold: m.Threshold, - Error: m.Error, - Message: m.Message, - Scope: m.Scope, + Name: m.Name, + StatusCode: m.StatusCode, + Value: m.Value, + Threshold: m.Threshold, + Error: m.Error, + Message: m.Message, + Scope: m.Scope, + ResponseCode: m.ResponseCode, } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) @@ -2531,6 +2532,7 @@ func (m *CheckThrottlerResponse) CloneVT() *CheckThrottlerResponse { RecentlyChecked: m.RecentlyChecked, AppName: m.AppName, Summary: m.Summary, + ResponseCode: m.ResponseCode, } if rhs := m.Metrics; rhs != nil { tmpContainer := make(map[string]*CheckThrottlerResponse_Metric, len(rhs)) @@ -2609,8 +2611,9 @@ func (m *GetThrottlerStatusResponse_RecentApp) CloneVT() *GetThrottlerStatusResp return (*GetThrottlerStatusResponse_RecentApp)(nil) } r := &GetThrottlerStatusResponse_RecentApp{ - CheckedAt: m.CheckedAt.CloneVT(), - StatusCode: m.StatusCode, + CheckedAt: m.CheckedAt.CloneVT(), + StatusCode: m.StatusCode, + ResponseCode: m.ResponseCode, } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) @@ -8757,6 +8760,11 @@ func (m *CheckThrottlerResponse_Metric) MarshalToSizedBufferVT(dAtA []byte) (int i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.ResponseCode != 0 { + i = encodeVarint(dAtA, i, uint64(m.ResponseCode)) + i-- + dAtA[i] = 0x40 + } if len(m.Scope) > 0 { i -= len(m.Scope) copy(dAtA[i:], m.Scope) @@ -8835,6 +8843,11 @@ func (m *CheckThrottlerResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.ResponseCode != 0 { + i = encodeVarint(dAtA, i, uint64(m.ResponseCode)) + i-- + dAtA[i] = 0x50 + } if len(m.Summary) > 0 { i -= len(m.Summary) copy(dAtA[i:], m.Summary) @@ -9072,6 +9085,11 @@ func (m *GetThrottlerStatusResponse_RecentApp) MarshalToSizedBufferVT(dAtA []byt i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if m.ResponseCode != 0 { + i = encodeVarint(dAtA, i, uint64(m.ResponseCode)) + i-- + dAtA[i] = 0x18 + } if m.StatusCode != 0 { i = encodeVarint(dAtA, i, uint64(m.StatusCode)) i-- @@ -11539,6 +11557,9 @@ func (m *CheckThrottlerResponse_Metric) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } + if m.ResponseCode != 0 { + n += 1 + sov(uint64(m.ResponseCode)) + } n += len(m.unknownFields) return n } @@ -11590,6 +11611,9 @@ func (m *CheckThrottlerResponse) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } + if m.ResponseCode != 0 { + n += 1 + sov(uint64(m.ResponseCode)) + } n += len(m.unknownFields) return n } @@ -11651,6 +11675,9 @@ func (m *GetThrottlerStatusResponse_RecentApp) SizeVT() (n int) { if m.StatusCode != 0 { n += 1 + sov(uint64(m.StatusCode)) } + if m.ResponseCode != 0 { + n += 1 + sov(uint64(m.ResponseCode)) + } n += len(m.unknownFields) return n } @@ -25313,6 +25340,25 @@ func (m *CheckThrottlerResponse_Metric) UnmarshalVT(dAtA []byte) error { } m.Scope = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseCode", wireType) + } + m.ResponseCode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ResponseCode |= CheckThrottlerResponseCode(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -25682,6 +25728,25 @@ func (m *CheckThrottlerResponse) UnmarshalVT(dAtA []byte) error { } m.Summary = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseCode", wireType) + } + m.ResponseCode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ResponseCode |= CheckThrottlerResponseCode(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -26039,6 +26104,25 @@ func (m *GetThrottlerStatusResponse_RecentApp) UnmarshalVT(dAtA []byte) error { break } } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ResponseCode", wireType) + } + m.ResponseCode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ResponseCode |= CheckThrottlerResponseCode(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) diff --git a/go/vt/vttablet/tabletmanager/rpc_throttler.go b/go/vt/vttablet/tabletmanager/rpc_throttler.go index 5facbb01229..ec75db6da43 100644 --- a/go/vt/vttablet/tabletmanager/rpc_throttler.go +++ b/go/vt/vttablet/tabletmanager/rpc_throttler.go @@ -53,6 +53,7 @@ func (tm *TabletManager) CheckThrottler(ctx context.Context, req *tabletmanagerd return nil, vterrors.Errorf(vtrpc.Code_INTERNAL, "nil checkResult") } resp := &tabletmanagerdatapb.CheckThrottlerResponse{ + ResponseCode: throttle.ResponseCodeFromStatus(checkResult.ResponseCode, checkResult.StatusCode), StatusCode: int32(checkResult.StatusCode), Value: checkResult.Value, Threshold: checkResult.Threshold, @@ -64,22 +65,24 @@ func (tm *TabletManager) CheckThrottler(ctx context.Context, req *tabletmanagerd } for name, metric := range checkResult.Metrics { resp.Metrics[name] = &tabletmanagerdatapb.CheckThrottlerResponse_Metric{ - Name: name, - Scope: metric.Scope, - StatusCode: int32(metric.StatusCode), - Value: metric.Value, - Threshold: metric.Threshold, - Message: metric.Message, + Name: name, + Scope: metric.Scope, + StatusCode: int32(metric.StatusCode), + ResponseCode: throttle.ResponseCodeFromStatus(metric.ResponseCode, metric.StatusCode), + Value: metric.Value, + Threshold: metric.Threshold, + Message: metric.Message, } } if len(checkResult.Metrics) == 0 { // For backwards compatibility, when the checked tablet is of lower version, it does not return a // matrics map, but only the one metric. resp.Metrics[base.DefaultMetricName.String()] = &tabletmanagerdatapb.CheckThrottlerResponse_Metric{ - StatusCode: int32(checkResult.StatusCode), - Value: checkResult.Value, - Threshold: checkResult.Threshold, - Message: checkResult.Message, + StatusCode: int32(checkResult.StatusCode), + ResponseCode: throttle.ResponseCodeFromStatus(checkResult.ResponseCode, checkResult.StatusCode), + Value: checkResult.Value, + Threshold: checkResult.Threshold, + Message: checkResult.Message, } } if checkResult.Error != nil { @@ -140,8 +143,9 @@ func (tm *TabletManager) GetThrottlerStatus(ctx context.Context, req *tabletmana } for _, recentApp := range status.RecentApps { resp.RecentApps[recentApp.AppName] = &tabletmanagerdatapb.GetThrottlerStatusResponse_RecentApp{ - CheckedAt: protoutil.TimeToProto(recentApp.CheckedAt), - StatusCode: int32(recentApp.StatusCode), + CheckedAt: protoutil.TimeToProto(recentApp.CheckedAt), + StatusCode: int32(recentApp.StatusCode), + ResponseCode: recentApp.ResponseCode, } } return resp, nil diff --git a/go/vt/vttablet/tabletserver/tabletserver.go b/go/vt/vttablet/tabletserver/tabletserver.go index 8a6d1a0be39..167d55a4e6f 100644 --- a/go/vt/vttablet/tabletserver/tabletserver.go +++ b/go/vt/vttablet/tabletserver/tabletserver.go @@ -46,6 +46,7 @@ import ( "vitess.io/vitess/go/vt/mysqlctl" binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" querypb "vitess.io/vitess/go/vt/proto/query" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" topodatapb "vitess.io/vitess/go/vt/proto/topodata" vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" "vitess.io/vitess/go/vt/servenv" @@ -1800,8 +1801,9 @@ func (tsv *TabletServer) registerThrottlerCheckHandlers() { } metricNames := tsv.lagThrottler.MetricNames(r.URL.Query()["m"]) checkResult := tsv.lagThrottler.Check(ctx, appName, metricNames, flags) - if checkResult.StatusCode == http.StatusNotFound && flags.OKIfNotExists { + if checkResult.ResponseCode == tabletmanagerdatapb.CheckThrottlerResponseCode_UNKNOWN_METRIC && flags.OKIfNotExists { checkResult.StatusCode = http.StatusOK // 200 + checkResult.ResponseCode = tabletmanagerdatapb.CheckThrottlerResponseCode_OK } if r.Method == http.MethodGet { diff --git a/go/vt/vttablet/tabletserver/throttle/base/recent_app.go b/go/vt/vttablet/tabletserver/throttle/base/recent_app.go index 148e6b31fe4..7ae2bf789af 100644 --- a/go/vt/vttablet/tabletserver/throttle/base/recent_app.go +++ b/go/vt/vttablet/tabletserver/throttle/base/recent_app.go @@ -42,21 +42,25 @@ package base import ( "time" + + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" ) // RecentApp indicates when an app was last checked type RecentApp struct { - AppName string - CheckedAt time.Time - StatusCode int + AppName string + CheckedAt time.Time + StatusCode int + ResponseCode tabletmanagerdatapb.CheckThrottlerResponseCode } // NewRecentApp creates a RecentApp -func NewRecentApp(appName string, statusCode int) *RecentApp { +func NewRecentApp(appName string, statusCode int, responseCode tabletmanagerdatapb.CheckThrottlerResponseCode) *RecentApp { result := &RecentApp{ - AppName: appName, - CheckedAt: time.Now(), - StatusCode: statusCode, + AppName: appName, + CheckedAt: time.Now(), + StatusCode: statusCode, + ResponseCode: responseCode, } return result } diff --git a/go/vt/vttablet/tabletserver/throttle/check.go b/go/vt/vttablet/tabletserver/throttle/check.go index 460d27a5181..ccdfcb2ce23 100644 --- a/go/vt/vttablet/tabletserver/throttle/check.go +++ b/go/vt/vttablet/tabletserver/throttle/check.go @@ -51,6 +51,8 @@ import ( "vitess.io/vitess/go/textutil" "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/base" "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/throttlerapp" + + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" ) const ( @@ -100,37 +102,44 @@ func (check *ThrottlerCheck) checkAppMetricResult(ctx context.Context, appName s } value, err := metricResult.Get() if appName == "" { - return NewCheckResult(http.StatusExpectationFailed, value, threshold, "", fmt.Errorf("no app indicated")) + return NewCheckResult(tabletmanagerdatapb.CheckThrottlerResponseCode_APP_DENIED, http.StatusExpectationFailed, value, threshold, "", fmt.Errorf("no app indicated")) } var statusCode int + var responseCode tabletmanagerdatapb.CheckThrottlerResponseCode switch { case err == base.ErrAppDenied: // app specifically not allowed to get metrics statusCode = http.StatusExpectationFailed // 417 + responseCode = tabletmanagerdatapb.CheckThrottlerResponseCode_APP_DENIED case err == base.ErrNoSuchMetric: // not collected yet, or metric does not exist statusCode = http.StatusNotFound // 404 + responseCode = tabletmanagerdatapb.CheckThrottlerResponseCode_UNKNOWN_METRIC case err != nil: // any error statusCode = http.StatusInternalServerError // 500 + responseCode = tabletmanagerdatapb.CheckThrottlerResponseCode_INTERNAL_ERROR case value > threshold: // casual throttling statusCode = http.StatusTooManyRequests // 429 + responseCode = tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED err = base.ErrThresholdExceeded default: // all good! statusCode = http.StatusOK // 200 + responseCode = tabletmanagerdatapb.CheckThrottlerResponseCode_OK } - return NewCheckResult(statusCode, value, threshold, matchedApp, err) + return NewCheckResult(responseCode, statusCode, value, threshold, matchedApp, err) } // Check is the core function that runs when a user wants to check a metric func (check *ThrottlerCheck) Check(ctx context.Context, appName string, scope base.Scope, metricNames base.MetricNames, flags *CheckFlags) (checkResult *CheckResult) { checkResult = &CheckResult{ - StatusCode: http.StatusOK, - Metrics: make(map[string]*MetricResult), + StatusCode: http.StatusOK, + ResponseCode: tabletmanagerdatapb.CheckThrottlerResponseCode_OK, + Metrics: make(map[string]*MetricResult), } if len(metricNames) == 0 { metricNames = base.MetricNames{check.throttler.metricNameUsedAsDefault()} @@ -138,6 +147,7 @@ func (check *ThrottlerCheck) Check(ctx context.Context, appName string, scope ba metricNames = metricNames.Unique() applyMetricToCheckResult := func(metricName base.MetricName, metric *MetricResult) { checkResult.StatusCode = metric.StatusCode + checkResult.ResponseCode = metric.ResponseCode checkResult.Value = metric.Value checkResult.Threshold = metric.Threshold checkResult.Error = metric.Error @@ -171,7 +181,7 @@ func (check *ThrottlerCheck) Check(ctx context.Context, appName string, scope ba metricCheckResult := check.checkAppMetricResult(ctx, appName, metricResultFunc, flags) if !throttlerapp.VitessName.Equals(appName) { - go func(statusCode int) { + go func(metricCheckResult *CheckResult) { if metricScope == base.UndefinedScope { // While we should never get here, the following code will panic if we do // because it will attempt to recreate ThrottlerCheckAnyTotal. @@ -179,22 +189,23 @@ func (check *ThrottlerCheck) Check(ctx context.Context, appName string, scope ba return } stats.GetOrNewCounter(fmt.Sprintf("ThrottlerCheck%s%sTotal", textutil.SingleWordCamel(metricScope.String()), textutil.SingleWordCamel(metricName.String())), "").Add(1) - if statusCode != http.StatusOK { + if !metricCheckResult.IsOK() { stats.GetOrNewCounter(fmt.Sprintf("ThrottlerCheck%s%sError", textutil.SingleWordCamel(metricScope.String()), textutil.SingleWordCamel(metricName.String())), "").Add(1) } - }(metricCheckResult.StatusCode) + }(metricCheckResult) } if metricCheckResult.RecentlyChecked { checkResult.RecentlyChecked = true } metric := &MetricResult{ - StatusCode: metricCheckResult.StatusCode, - Value: metricCheckResult.Value, - Threshold: metricCheckResult.Threshold, - Error: metricCheckResult.Error, - Message: metricCheckResult.Message, - AppName: metricCheckResult.AppName, - Scope: metricScope.String(), // This reports back the actual scope used for the check + StatusCode: metricCheckResult.StatusCode, + ResponseCode: metricCheckResult.ResponseCode, + Value: metricCheckResult.Value, + Threshold: metricCheckResult.Threshold, + Error: metricCheckResult.Error, + Message: metricCheckResult.Message, + AppName: metricCheckResult.AppName, + Scope: metricScope.String(), // This reports back the actual scope used for the check } checkResult.Metrics[metricName.String()] = metric if flags.MultiMetricsEnabled && !metricCheckResult.IsOK() && metricName != base.DefaultMetricName { @@ -216,13 +227,13 @@ func (check *ThrottlerCheck) Check(ctx context.Context, appName string, scope ba // If checkResult is not OK, then we will have populated these fields already by the failing metric. applyMetricToCheckResult(base.DefaultMetricName, metric) } - go func(statusCode int) { + go func(checkResult *CheckResult) { statsThrottlerCheckAnyTotal.Add(1) - if statusCode != http.StatusOK { + if !checkResult.IsOK() { statsThrottlerCheckAnyError.Add(1) } - }(checkResult.StatusCode) - go check.throttler.markRecentApp(appName, checkResult.StatusCode) + }(checkResult) + go check.throttler.markRecentApp(appName, checkResult.StatusCode, checkResult.ResponseCode) return checkResult } @@ -234,7 +245,7 @@ func (check *ThrottlerCheck) localCheck(ctx context.Context, aggregatedMetricNam } checkResult = check.Check(ctx, throttlerapp.VitessName.String(), scope, base.MetricNames{metricName}, selfCheckFlags) - if checkResult.StatusCode == http.StatusOK { + if checkResult.IsOK() { check.throttler.markMetricHealthy(aggregatedMetricName) } if timeSinceHealthy, found := check.throttler.timeSinceMetricHealthy(aggregatedMetricName); found { diff --git a/go/vt/vttablet/tabletserver/throttle/check_result.go b/go/vt/vttablet/tabletserver/throttle/check_result.go index ad32ba33d6f..34532b7ce37 100644 --- a/go/vt/vttablet/tabletserver/throttle/check_result.go +++ b/go/vt/vttablet/tabletserver/throttle/check_result.go @@ -45,41 +45,75 @@ import ( "fmt" "net/http" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/base" ) +// ResponseCodeFromStatus returns a ResponseCode based on either given response code or HTTP status code. +// It is used to handle the transition period from v20 to v21 where v20 only returns HTTP status code. +// In v22 and beyond, the HTTP status code will be removed, and so will this function. +func ResponseCodeFromStatus(responseCode tabletmanagerdatapb.CheckThrottlerResponseCode, statusCode int) tabletmanagerdatapb.CheckThrottlerResponseCode { + if responseCode != tabletmanagerdatapb.CheckThrottlerResponseCode_UNDEFINED { + return responseCode + } + switch statusCode { + case http.StatusOK: + return tabletmanagerdatapb.CheckThrottlerResponseCode_OK + case http.StatusExpectationFailed: + return tabletmanagerdatapb.CheckThrottlerResponseCode_APP_DENIED + case http.StatusTooManyRequests: + return tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED + case http.StatusNotFound: + return tabletmanagerdatapb.CheckThrottlerResponseCode_UNKNOWN_METRIC + case http.StatusInternalServerError: + return tabletmanagerdatapb.CheckThrottlerResponseCode_INTERNAL_ERROR + default: + return tabletmanagerdatapb.CheckThrottlerResponseCode_UNDEFINED + } +} + type MetricResult struct { - StatusCode int `json:"StatusCode"` - Scope string `json:"Scope"` - Value float64 `json:"Value"` - Threshold float64 `json:"Threshold"` - Error error `json:"-"` - Message string `json:"Message"` - AppName string `json:"AppName"` + ResponseCode tabletmanagerdatapb.CheckThrottlerResponseCode `json:"ResponseCode"` + StatusCode int `json:"StatusCode"` + Scope string `json:"Scope"` + Value float64 `json:"Value"` + Threshold float64 `json:"Threshold"` + Error error `json:"-"` + Message string `json:"Message"` + AppName string `json:"AppName"` +} + +func (m *MetricResult) IsOK() bool { + if m.ResponseCode != tabletmanagerdatapb.CheckThrottlerResponseCode_UNDEFINED { + return m.ResponseCode == tabletmanagerdatapb.CheckThrottlerResponseCode_OK + } + return m.StatusCode == http.StatusOK } // CheckResult is the result for an app inquiring on a metric. It also exports as JSON via the API type CheckResult struct { - StatusCode int `json:"StatusCode"` - Value float64 `json:"Value"` - Threshold float64 `json:"Threshold"` - Error error `json:"-"` - Message string `json:"Message"` - RecentlyChecked bool `json:"RecentlyChecked"` - AppName string `json:"AppName"` - MetricName string `json:"MetricName"` - Scope string `json:"Scope"` - Metrics map[string]*MetricResult `json:"Metrics"` // New in multi-metrics support. Will eventually replace the above fields. + ResponseCode tabletmanagerdatapb.CheckThrottlerResponseCode `json:"ResponseCode"` + StatusCode int `json:"StatusCode"` + Value float64 `json:"Value"` + Threshold float64 `json:"Threshold"` + Error error `json:"-"` + Message string `json:"Message"` + RecentlyChecked bool `json:"RecentlyChecked"` + AppName string `json:"AppName"` + MetricName string `json:"MetricName"` + Scope string `json:"Scope"` + Metrics map[string]*MetricResult `json:"Metrics"` // New in multi-metrics support. Will eventually replace the above fields. } // NewCheckResult returns a CheckResult -func NewCheckResult(statusCode int, value float64, threshold float64, appName string, err error) *CheckResult { +func NewCheckResult(responseCode tabletmanagerdatapb.CheckThrottlerResponseCode, statusCode int, value float64, threshold float64, appName string, err error) *CheckResult { result := &CheckResult{ - StatusCode: statusCode, - Value: value, - Threshold: threshold, - AppName: appName, - Error: err, + ResponseCode: responseCode, + StatusCode: statusCode, + Value: value, + Threshold: threshold, + AppName: appName, + Error: err, } if err != nil { result.Message = err.Error() @@ -88,35 +122,38 @@ func NewCheckResult(statusCode int, value float64, threshold float64, appName st } func (c *CheckResult) IsOK() bool { + if c.ResponseCode != tabletmanagerdatapb.CheckThrottlerResponseCode_UNDEFINED { + return c.ResponseCode == tabletmanagerdatapb.CheckThrottlerResponseCode_OK + } return c.StatusCode == http.StatusOK } // Summary returns a human-readable summary of the check result func (c *CheckResult) Summary() string { - switch c.StatusCode { - case http.StatusOK: + switch ResponseCodeFromStatus(c.ResponseCode, c.StatusCode) { + case tabletmanagerdatapb.CheckThrottlerResponseCode_OK: return fmt.Sprintf("%s is granted access", c.AppName) - case http.StatusExpectationFailed: + case tabletmanagerdatapb.CheckThrottlerResponseCode_APP_DENIED: return fmt.Sprintf("%s is explicitly denied access", c.AppName) - case http.StatusInternalServerError: + case tabletmanagerdatapb.CheckThrottlerResponseCode_INTERNAL_ERROR: return fmt.Sprintf("%s is denied access due to unexpected error: %v", c.AppName, c.Error) - case http.StatusTooManyRequests: + case tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED: return fmt.Sprintf("%s is denied access due to %s/%s metric value %v exceeding threshold %v", c.AppName, c.Scope, c.MetricName, c.Value, c.Threshold) - case http.StatusNotFound: + case tabletmanagerdatapb.CheckThrottlerResponseCode_UNKNOWN_METRIC: return fmt.Sprintf("%s is denied access due to unknown or uncollected metric", c.AppName) - case 0: + case tabletmanagerdatapb.CheckThrottlerResponseCode_UNDEFINED: return "" default: - return fmt.Sprintf("unknown status code: %v", c.StatusCode) + return fmt.Sprintf("unknown response code: %v", c.ResponseCode) } } // NewErrorCheckResult returns a check result that indicates an error -func NewErrorCheckResult(statusCode int, err error) *CheckResult { - return NewCheckResult(statusCode, 0, 0, "", err) +func NewErrorCheckResult(responseCode tabletmanagerdatapb.CheckThrottlerResponseCode, statusCode int, err error) *CheckResult { + return NewCheckResult(responseCode, statusCode, 0, 0, "", err) } // NoSuchMetricCheckResult is a result returns when a metric is unknown -var NoSuchMetricCheckResult = NewErrorCheckResult(http.StatusNotFound, base.ErrNoSuchMetric) +var NoSuchMetricCheckResult = NewErrorCheckResult(tabletmanagerdatapb.CheckThrottlerResponseCode_UNKNOWN_METRIC, http.StatusNotFound, base.ErrNoSuchMetric) -var okMetricCheckResult = NewCheckResult(http.StatusOK, 0, 0, "", nil) +var okMetricCheckResult = NewCheckResult(tabletmanagerdatapb.CheckThrottlerResponseCode_OK, http.StatusOK, 0, 0, "", nil) diff --git a/go/vt/vttablet/tabletserver/throttle/check_result_test.go b/go/vt/vttablet/tabletserver/throttle/check_result_test.go index f5c984c5943..fdb0ee600ba 100644 --- a/go/vt/vttablet/tabletserver/throttle/check_result_test.go +++ b/go/vt/vttablet/tabletserver/throttle/check_result_test.go @@ -21,8 +21,60 @@ import ( "testing" "github.com/stretchr/testify/assert" + + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" ) +func TestReponseCodeFromStatus(t *testing.T) { + tcases := []struct { + responseCode tabletmanagerdatapb.CheckThrottlerResponseCode + statusCode int + expect tabletmanagerdatapb.CheckThrottlerResponseCode + }{ + { + tabletmanagerdatapb.CheckThrottlerResponseCode_UNDEFINED, + http.StatusOK, + tabletmanagerdatapb.CheckThrottlerResponseCode_OK, + }, + { + tabletmanagerdatapb.CheckThrottlerResponseCode_UNDEFINED, + http.StatusExpectationFailed, + tabletmanagerdatapb.CheckThrottlerResponseCode_APP_DENIED, + }, + { + tabletmanagerdatapb.CheckThrottlerResponseCode_UNDEFINED, + http.StatusNotFound, + tabletmanagerdatapb.CheckThrottlerResponseCode_UNKNOWN_METRIC, + }, + { + tabletmanagerdatapb.CheckThrottlerResponseCode_UNDEFINED, + http.StatusInternalServerError, + tabletmanagerdatapb.CheckThrottlerResponseCode_INTERNAL_ERROR, + }, + { + tabletmanagerdatapb.CheckThrottlerResponseCode_UNDEFINED, + http.StatusTooManyRequests, + tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED, + }, + { + tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED, + http.StatusTooManyRequests, + tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED, + }, + { + tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED, + http.StatusOK, + tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED, + }, + } + for _, tcase := range tcases { + t.Run("", func(t *testing.T) { + result := ResponseCodeFromStatus(tcase.responseCode, tcase.statusCode) + assert.Equal(t, tcase.expect, result) + }) + } +} + func TestCheckResultSummary(t *testing.T) { tcases := []struct { checkResult *CheckResult @@ -57,6 +109,31 @@ func TestCheckResultSummary(t *testing.T) { }, summary: "test is explicitly denied access", }, + { + checkResult: &CheckResult{ + ResponseCode: tabletmanagerdatapb.CheckThrottlerResponseCode_OK, + AppName: "test", + }, + summary: "test is granted access", + }, + { + checkResult: &CheckResult{ + ResponseCode: tabletmanagerdatapb.CheckThrottlerResponseCode_THRESHOLD_EXCEEDED, + AppName: "test", + MetricName: "bugginess", + Threshold: 100, + Value: 200, + Scope: "self", + }, + summary: "test is denied access due to self/bugginess metric value 200 exceeding threshold 100", + }, + { + checkResult: &CheckResult{ + ResponseCode: tabletmanagerdatapb.CheckThrottlerResponseCode_APP_DENIED, + AppName: "test", + }, + summary: "test is explicitly denied access", + }, } for _, tcase := range tcases { t.Run(tcase.summary, func(t *testing.T) { diff --git a/go/vt/vttablet/tabletserver/throttle/client.go b/go/vt/vttablet/tabletserver/throttle/client.go index 972e63724f9..8549fb099b6 100644 --- a/go/vt/vttablet/tabletserver/throttle/client.go +++ b/go/vt/vttablet/tabletserver/throttle/client.go @@ -18,7 +18,6 @@ package throttle import ( "context" - "net/http" "sync" "sync/atomic" "time" @@ -111,11 +110,11 @@ func (c *Client) ThrottleCheckOK(ctx context.Context, overrideAppName throttlera } // It's time to run a throttler check checkResult = c.throttler.Check(ctx, checkApp.String(), nil, &c.flags) - if checkResult.StatusCode != http.StatusOK { + if !checkResult.IsOK() { return checkResult, false } for _, metricResult := range checkResult.Metrics { - if metricResult.StatusCode != http.StatusOK { + if !metricResult.IsOK() { return checkResult, false } } diff --git a/go/vt/vttablet/tabletserver/throttle/throttler.go b/go/vt/vttablet/tabletserver/throttle/throttler.go index 01c4fb3c622..7fb83769a96 100644 --- a/go/vt/vttablet/tabletserver/throttle/throttler.go +++ b/go/vt/vttablet/tabletserver/throttle/throttler.go @@ -66,8 +66,6 @@ import ( "vitess.io/vitess/go/textutil" "vitess.io/vitess/go/timer" "vitess.io/vitess/go/vt/log" - 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/sqlparser" "vitess.io/vitess/go/vt/srvtopo" @@ -80,6 +78,9 @@ import ( "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/config" "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/throttlerapp" "vitess.io/vitess/go/vt/vttablet/tmclient" + + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" ) const ( @@ -1028,8 +1029,11 @@ func (throttler *Throttler) generateTabletProbeFunction(scope base.Scope, tmClie return metricsWithError(fmt.Errorf("gRPC error accessing tablet %v. Err=%v", probe.Alias, gRPCErr)) } throttleMetric.Value = resp.Value + if resp.ResponseCode == tabletmanagerdatapb.CheckThrottlerResponseCode_INTERNAL_ERROR { + throttleMetric.Err = fmt.Errorf("response code: %d", resp.ResponseCode) + } if resp.StatusCode == http.StatusInternalServerError { - throttleMetric.Err = fmt.Errorf("Status code: %d", resp.StatusCode) + throttleMetric.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. @@ -1477,8 +1481,8 @@ func (throttler *Throttler) ThrottledAppsMap() (result map[string](*base.AppThro } // markRecentApp takes note that an app has just asked about throttling, making it "recent" -func (throttler *Throttler) markRecentApp(appName string, statusCode int) { - recentApp := base.NewRecentApp(appName, statusCode) +func (throttler *Throttler) markRecentApp(appName string, statusCode int, responseCode tabletmanagerdatapb.CheckThrottlerResponseCode) { + recentApp := base.NewRecentApp(appName, statusCode, responseCode) throttler.recentApps.Set(appName, recentApp, cache.DefaultExpiration) } diff --git a/go/vt/vttablet/tabletserver/throttle/throttler_test.go b/go/vt/vttablet/tabletserver/throttle/throttler_test.go index 508f542478e..9ea75090515 100644 --- a/go/vt/vttablet/tabletserver/throttle/throttler_test.go +++ b/go/vt/vttablet/tabletserver/throttle/throttler_test.go @@ -74,20 +74,24 @@ var ( } replicaMetrics = map[string]*MetricResult{ base.LagMetricName.String(): { - StatusCode: http.StatusOK, - Value: 0.9, + StatusCode: http.StatusOK, + ResponseCode: tabletmanagerdatapb.CheckThrottlerResponseCode_OK, + Value: 0.9, }, base.ThreadsRunningMetricName.String(): { - StatusCode: http.StatusOK, - Value: 13, + StatusCode: http.StatusOK, + ResponseCode: tabletmanagerdatapb.CheckThrottlerResponseCode_OK, + Value: 13, }, base.CustomMetricName.String(): { - StatusCode: http.StatusOK, - Value: 14, + StatusCode: http.StatusOK, + ResponseCode: tabletmanagerdatapb.CheckThrottlerResponseCode_OK, + Value: 14, }, base.LoadAvgMetricName.String(): { - StatusCode: http.StatusOK, - Value: 5.1, + StatusCode: http.StatusOK, + ResponseCode: tabletmanagerdatapb.CheckThrottlerResponseCode_OK, + Value: 5.1, }, } ) @@ -116,14 +120,16 @@ func (c *fakeTMClient) CheckThrottler(ctx context.Context, tablet *topodatapb.Ta RecentlyChecked: false, } if !c.v20.Load() { + resp.ResponseCode = tabletmanagerdatapb.CheckThrottlerResponseCode_OK resp.Metrics = make(map[string]*tabletmanagerdatapb.CheckThrottlerResponse_Metric) for name, metric := range replicaMetrics { resp.Metrics[name] = &tabletmanagerdatapb.CheckThrottlerResponse_Metric{ - Name: name, - StatusCode: int32(metric.StatusCode), - Value: metric.Value, - Threshold: metric.Threshold, - Message: metric.Message, + Name: name, + StatusCode: int32(metric.StatusCode), + ResponseCode: metric.ResponseCode, + Value: metric.Value, + Threshold: metric.Threshold, + Message: metric.Message, } } } @@ -417,6 +423,7 @@ func TestApplyThrottlerConfigMetricThresholds(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.3, checkResult.Value) // self lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.Len(t, checkResult.Metrics, 1) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is granted access") }) @@ -440,6 +447,7 @@ func TestApplyThrottlerConfigMetricThresholds(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.3, checkResult.Value, "unexpected result: %+v", checkResult) // self lag value assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Len(t, checkResult.Metrics, 1) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is denied access due to self/lag metric value") }) @@ -464,6 +472,7 @@ func TestApplyThrottlerConfigMetricThresholds(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.3, checkResult.Value, "unexpected result: %+v", checkResult) // self lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Len(t, checkResult.Metrics, 1) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is granted access") }) @@ -522,6 +531,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.Len(t, checkResult.Metrics, 1) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is denied access due to shard/lag metric value") }) @@ -537,6 +547,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // self lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.Len(t, checkResult.Metrics, 1) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is granted access") }) @@ -552,6 +563,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.Len(t, checkResult.Metrics, 1) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is granted access") }) @@ -571,6 +583,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 2.718, checkResult.Value) // self loadavg value assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Len(t, checkResult.Metrics, 1) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is denied access due to self/loadavg metric value") }) @@ -590,6 +603,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 5.1, checkResult.Value) // shard loadavg value assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Len(t, checkResult.Metrics, 1) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is denied access due to shard/loadavg metric value") }) @@ -608,6 +622,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 2.718, checkResult.Value) // self loadavg value assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Equal(t, 2, len(checkResult.Metrics)) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is denied access due to self/loadavg metric value") }) @@ -626,6 +641,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 5.1, checkResult.Value) // shard loadavg value assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Equal(t, 2, len(checkResult.Metrics)) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is denied access due to shard/loadavg metric value") }) @@ -640,6 +656,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Equal(t, 1, len(checkResult.Metrics), "unexpected metrics: %+v", checkResult.Metrics) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is granted access") }) @@ -658,6 +675,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Equal(t, 2, len(checkResult.Metrics)) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is granted access") }) @@ -676,6 +694,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 2.718, checkResult.Value) // loadavg self value exceeds threshold assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Equal(t, 2, len(checkResult.Metrics)) assert.Contains(t, checkResult.Summary(), throttlerapp.AllName.String()+" is denied access due to self/loadavg metric value") }) @@ -691,6 +710,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Equal(t, 2, len(checkResult.Metrics)) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is granted access") }) @@ -705,6 +725,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 2.718, checkResult.Value) // loadavg self value exceeds threshold assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Equal(t, 2, len(checkResult.Metrics)) assert.Contains(t, checkResult.Summary(), throttlerapp.AllName.String()+" is denied access due to self/loadavg metric value") }) @@ -716,6 +737,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 2.718, checkResult.Value) // loadavg self value exceeds threshold assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Equal(t, 2, len(checkResult.Metrics)) assert.Contains(t, checkResult.Summary(), throttlerapp.AllName.String()+" is denied access due to self/loadavg metric value") }) @@ -726,6 +748,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Equal(t, 2, len(checkResult.Metrics)) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is granted access") }) @@ -741,6 +764,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Len(t, checkResult.Metrics, 1) assert.Contains(t, checkResult.Summary(), throttlerapp.AllName.String()+" is granted access") }) @@ -756,6 +780,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Equal(t, 2, len(checkResult.Metrics)) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is granted access") }) @@ -770,6 +795,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Len(t, checkResult.Metrics, 1) assert.Contains(t, checkResult.Summary(), throttlerapp.OnlineDDLName.String()+" is granted access") }) @@ -787,6 +813,7 @@ func TestApplyThrottlerConfigAppCheckedMetrics(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.Len(t, checkResult.Metrics, 1) assert.Contains(t, checkResult.Summary(), testAppName.String()+" is granted access") }) @@ -1707,6 +1734,7 @@ func TestChecks(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.3, checkResult.Value) // self lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.Equal(t, testAppName.String(), checkResult.AppName) assert.Len(t, checkResult.Metrics, 1) }) @@ -1719,6 +1747,12 @@ func TestChecks(t *testing.T) { t.Logf("%s: %+v", k, v) } } + if !assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) { + for k, v := range checkResult.Metrics { + t.Logf("%s: %+v", k, v) + } + } + assert.Equal(t, testAppName.String(), checkResult.AppName) assert.Equal(t, len(base.KnownMetricNames), len(checkResult.Metrics)) @@ -1766,6 +1800,7 @@ func TestChecks(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.ErrorIs(t, checkResult.Error, base.ErrThresholdExceeded) assert.Equal(t, testAppName.String(), checkResult.AppName) assert.Len(t, checkResult.Metrics, 1) @@ -1775,6 +1810,7 @@ func TestChecks(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.ErrorIs(t, checkResult.Error, base.ErrThresholdExceeded) assert.Equal(t, testAppName.String(), checkResult.AppName) assert.Equal(t, len(base.KnownMetricNames), len(checkResult.Metrics)) @@ -1798,6 +1834,7 @@ func TestChecks(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.ErrorIs(t, checkResult.Error, base.ErrThresholdExceeded) assert.Len(t, checkResult.Metrics, 1) }) @@ -1806,6 +1843,7 @@ func TestChecks(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.ErrorIs(t, checkResult.Error, base.ErrThresholdExceeded) assert.Equal(t, len(base.KnownMetricNames), len(checkResult.Metrics)) @@ -1837,6 +1875,7 @@ func TestChecks(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.9, checkResult.Value) // shard lag value assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.ErrorIs(t, checkResult.Error, base.ErrThresholdExceeded) assert.Equal(t, len(metricNames), len(checkResult.Metrics)) @@ -1865,6 +1904,7 @@ func TestChecks(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.3, checkResult.Value) // explicitly set self lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.Equal(t, len(metricNames), len(checkResult.Metrics)) assert.EqualValues(t, 0.3, checkResult.Metrics[base.LagMetricName.String()].Value) // self lag value, because scope name is in metric name @@ -1927,6 +1967,7 @@ func TestReplica(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.3, checkResult.Value) // self lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.Len(t, checkResult.Metrics, 1) select { case <-ctx.Done(): @@ -1944,6 +1985,7 @@ func TestReplica(t *testing.T) { require.NotNil(t, checkResult) assert.EqualValues(t, 0.3, checkResult.Value) // self lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.Len(t, checkResult.Metrics, 1) assert.True(t, checkResult.RecentlyChecked) assert.True(t, throttler.recentlyChecked()) @@ -1951,6 +1993,7 @@ func TestReplica(t *testing.T) { recentApp, ok := throttler.recentAppsSnapshot()[throttlerapp.OnlineDDLName.String()] require.True(t, ok) assert.EqualValues(t, http.StatusOK, recentApp.StatusCode) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, recentApp.ResponseCode) } } { @@ -1981,6 +2024,7 @@ func TestReplica(t *testing.T) { // loadavg value exceeds threshold. This will show up in the check result as an error. assert.EqualValues(t, 2.718, checkResult.Value, "unexpected result: %+v", checkResult) // self lag value assert.NotEqualValues(t, http.StatusOK, checkResult.StatusCode, "unexpected result: %+v", checkResult) + assert.NotEqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode, "unexpected result: %+v", checkResult) assert.Equal(t, len(base.KnownMetricNames), len(checkResult.Metrics)) }) t.Run("validate v20 non-multi-metric results", func(t *testing.T) { @@ -1996,6 +2040,7 @@ func TestReplica(t *testing.T) { // reports the default metric. assert.EqualValues(t, 0.3, checkResult.Value) // self lag value assert.EqualValues(t, http.StatusOK, checkResult.StatusCode) + assert.EqualValues(t, tabletmanagerdatapb.CheckThrottlerResponseCode_OK, checkResult.ResponseCode) assert.EqualValues(t, 0.75, checkResult.Threshold) // The replica will still report the multi-metrics, and that's fine. As long // as it does not reflect any of their values in the checkResult.Value/StatusCode/Threshold/Error/Message. diff --git a/proto/tabletmanagerdata.proto b/proto/tabletmanagerdata.proto index 549c6c09782..cd74e79fa5d 100644 --- a/proto/tabletmanagerdata.proto +++ b/proto/tabletmanagerdata.proto @@ -736,6 +736,14 @@ message CheckThrottlerRequest { bool multi_metrics_enabled = 5; } +enum CheckThrottlerResponseCode { + UNDEFINED = 0; + OK = 1; + THRESHOLD_EXCEEDED = 2; + APP_DENIED = 3; + UNKNOWN_METRIC = 4; + INTERNAL_ERROR = 5; +} message CheckThrottlerResponse { // StatusCode is HTTP compliant response code (e.g. 200 for OK) @@ -767,6 +775,8 @@ message CheckThrottlerResponse { string message = 6; // Scope used in this check string scope = 7; + // ResponseCode is the enum representation of the response + CheckThrottlerResponseCode response_code = 8; } // Metrics is a map (metric name -> metric value/error) so that the client has as much // information as possible about all the checked metrics. @@ -777,6 +787,9 @@ message CheckThrottlerResponse { // Summary is a human readable analysis of the result string summary = 9; + + // ResponseCode is the enum representation of the response + CheckThrottlerResponseCode response_code = 10; } message GetThrottlerStatusRequest { @@ -835,6 +848,8 @@ message GetThrottlerStatusResponse { message RecentApp { vttime.Time checked_at = 1; int32 status_code = 2; + // ResponseCode is the enum representation of the response + CheckThrottlerResponseCode response_code = 3; } // RecentApps is a map of app names to their recent check status map recent_apps = 18; diff --git a/web/vtadmin/src/proto/vtadmin.d.ts b/web/vtadmin/src/proto/vtadmin.d.ts index d69d72daaac..5dc567d11fe 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -30630,6 +30630,16 @@ export namespace tabletmanagerdata { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** CheckThrottlerResponseCode enum. */ + enum CheckThrottlerResponseCode { + UNDEFINED = 0, + OK = 1, + THRESHOLD_EXCEEDED = 2, + APP_DENIED = 3, + UNKNOWN_METRIC = 4, + INTERNAL_ERROR = 5 + } + /** Properties of a CheckThrottlerResponse. */ interface ICheckThrottlerResponse { @@ -30659,6 +30669,9 @@ export namespace tabletmanagerdata { /** CheckThrottlerResponse summary */ summary?: (string|null); + + /** CheckThrottlerResponse response_code */ + response_code?: (tabletmanagerdata.CheckThrottlerResponseCode|null); } /** Represents a CheckThrottlerResponse. */ @@ -30697,6 +30710,9 @@ export namespace tabletmanagerdata { /** CheckThrottlerResponse summary. */ public summary: string; + /** CheckThrottlerResponse response_code. */ + public response_code: tabletmanagerdata.CheckThrottlerResponseCode; + /** * Creates a new CheckThrottlerResponse instance using the specified properties. * @param [properties] Properties to set @@ -30800,6 +30816,9 @@ export namespace tabletmanagerdata { /** Metric scope */ scope?: (string|null); + + /** Metric response_code */ + response_code?: (tabletmanagerdata.CheckThrottlerResponseCode|null); } /** Represents a Metric. */ @@ -30832,6 +30851,9 @@ export namespace tabletmanagerdata { /** Metric scope. */ public scope: string; + /** Metric response_code. */ + public response_code: tabletmanagerdata.CheckThrottlerResponseCode; + /** * Creates a new Metric instance using the specified properties. * @param [properties] Properties to set @@ -31417,6 +31439,9 @@ export namespace tabletmanagerdata { /** RecentApp status_code */ status_code?: (number|null); + + /** RecentApp response_code */ + response_code?: (tabletmanagerdata.CheckThrottlerResponseCode|null); } /** Represents a RecentApp. */ @@ -31434,6 +31459,9 @@ export namespace tabletmanagerdata { /** RecentApp status_code. */ public status_code: number; + /** RecentApp response_code. */ + public response_code: tabletmanagerdata.CheckThrottlerResponseCode; + /** * Creates a new RecentApp 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 569d1602c6b..4ff1b8b19aa 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -71270,6 +71270,28 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { return CheckThrottlerRequest; })(); + /** + * CheckThrottlerResponseCode enum. + * @name tabletmanagerdata.CheckThrottlerResponseCode + * @enum {number} + * @property {number} UNDEFINED=0 UNDEFINED value + * @property {number} OK=1 OK value + * @property {number} THRESHOLD_EXCEEDED=2 THRESHOLD_EXCEEDED value + * @property {number} APP_DENIED=3 APP_DENIED value + * @property {number} UNKNOWN_METRIC=4 UNKNOWN_METRIC value + * @property {number} INTERNAL_ERROR=5 INTERNAL_ERROR value + */ + tabletmanagerdata.CheckThrottlerResponseCode = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNDEFINED"] = 0; + values[valuesById[1] = "OK"] = 1; + values[valuesById[2] = "THRESHOLD_EXCEEDED"] = 2; + values[valuesById[3] = "APP_DENIED"] = 3; + values[valuesById[4] = "UNKNOWN_METRIC"] = 4; + values[valuesById[5] = "INTERNAL_ERROR"] = 5; + return values; + })(); + tabletmanagerdata.CheckThrottlerResponse = (function() { /** @@ -71285,6 +71307,7 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { * @property {Object.|null} [metrics] CheckThrottlerResponse metrics * @property {string|null} [app_name] CheckThrottlerResponse app_name * @property {string|null} [summary] CheckThrottlerResponse summary + * @property {tabletmanagerdata.CheckThrottlerResponseCode|null} [response_code] CheckThrottlerResponse response_code */ /** @@ -71375,6 +71398,14 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { */ CheckThrottlerResponse.prototype.summary = ""; + /** + * CheckThrottlerResponse response_code. + * @member {tabletmanagerdata.CheckThrottlerResponseCode} response_code + * @memberof tabletmanagerdata.CheckThrottlerResponse + * @instance + */ + CheckThrottlerResponse.prototype.response_code = 0; + /** * Creates a new CheckThrottlerResponse instance using the specified properties. * @function create @@ -71420,6 +71451,8 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { writer.uint32(/* id 8, wireType 2 =*/66).string(message.app_name); if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) writer.uint32(/* id 9, wireType 2 =*/74).string(message.summary); + if (message.response_code != null && Object.hasOwnProperty.call(message, "response_code")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.response_code); return writer; }; @@ -71509,6 +71542,10 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { message.summary = reader.string(); break; } + case 10: { + message.response_code = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -71578,6 +71615,18 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { if (message.summary != null && message.hasOwnProperty("summary")) if (!$util.isString(message.summary)) return "summary: string expected"; + if (message.response_code != null && message.hasOwnProperty("response_code")) + switch (message.response_code) { + default: + return "response_code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } return null; }; @@ -71619,6 +71668,38 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { message.app_name = String(object.app_name); if (object.summary != null) message.summary = String(object.summary); + switch (object.response_code) { + default: + if (typeof object.response_code === "number") { + message.response_code = object.response_code; + break; + } + break; + case "UNDEFINED": + case 0: + message.response_code = 0; + break; + case "OK": + case 1: + message.response_code = 1; + break; + case "THRESHOLD_EXCEEDED": + case 2: + message.response_code = 2; + break; + case "APP_DENIED": + case 3: + message.response_code = 3; + break; + case "UNKNOWN_METRIC": + case 4: + message.response_code = 4; + break; + case "INTERNAL_ERROR": + case 5: + message.response_code = 5; + break; + } return message; }; @@ -71646,6 +71727,7 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { object.recently_checked = false; object.app_name = ""; object.summary = ""; + object.response_code = options.enums === String ? "UNDEFINED" : 0; } if (message.status_code != null && message.hasOwnProperty("status_code")) object.status_code = message.status_code; @@ -71669,6 +71751,8 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { object.app_name = message.app_name; if (message.summary != null && message.hasOwnProperty("summary")) object.summary = message.summary; + if (message.response_code != null && message.hasOwnProperty("response_code")) + object.response_code = options.enums === String ? $root.tabletmanagerdata.CheckThrottlerResponseCode[message.response_code] === undefined ? message.response_code : $root.tabletmanagerdata.CheckThrottlerResponseCode[message.response_code] : message.response_code; return object; }; @@ -71711,6 +71795,7 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { * @property {string|null} [error] Metric error * @property {string|null} [message] Metric message * @property {string|null} [scope] Metric scope + * @property {tabletmanagerdata.CheckThrottlerResponseCode|null} [response_code] Metric response_code */ /** @@ -71784,6 +71869,14 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { */ Metric.prototype.scope = ""; + /** + * Metric response_code. + * @member {tabletmanagerdata.CheckThrottlerResponseCode} response_code + * @memberof tabletmanagerdata.CheckThrottlerResponse.Metric + * @instance + */ + Metric.prototype.response_code = 0; + /** * Creates a new Metric instance using the specified properties. * @function create @@ -71822,6 +71915,8 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { writer.uint32(/* id 6, wireType 2 =*/50).string(message.message); if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.scope); + if (message.response_code != null && Object.hasOwnProperty.call(message, "response_code")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.response_code); return writer; }; @@ -71884,6 +71979,10 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { message.scope = reader.string(); break; } + case 8: { + message.response_code = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -71940,6 +72039,18 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { if (message.scope != null && message.hasOwnProperty("scope")) if (!$util.isString(message.scope)) return "scope: string expected"; + if (message.response_code != null && message.hasOwnProperty("response_code")) + switch (message.response_code) { + default: + return "response_code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } return null; }; @@ -71969,6 +72080,38 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { message.message = String(object.message); if (object.scope != null) message.scope = String(object.scope); + switch (object.response_code) { + default: + if (typeof object.response_code === "number") { + message.response_code = object.response_code; + break; + } + break; + case "UNDEFINED": + case 0: + message.response_code = 0; + break; + case "OK": + case 1: + message.response_code = 1; + break; + case "THRESHOLD_EXCEEDED": + case 2: + message.response_code = 2; + break; + case "APP_DENIED": + case 3: + message.response_code = 3; + break; + case "UNKNOWN_METRIC": + case 4: + message.response_code = 4; + break; + case "INTERNAL_ERROR": + case 5: + message.response_code = 5; + break; + } return message; }; @@ -71993,6 +72136,7 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { object.error = ""; object.message = ""; object.scope = ""; + object.response_code = options.enums === String ? "UNDEFINED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -72008,6 +72152,8 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { object.message = message.message; if (message.scope != null && message.hasOwnProperty("scope")) object.scope = message.scope; + if (message.response_code != null && message.hasOwnProperty("response_code")) + object.response_code = options.enums === String ? $root.tabletmanagerdata.CheckThrottlerResponseCode[message.response_code] === undefined ? message.response_code : $root.tabletmanagerdata.CheckThrottlerResponseCode[message.response_code] : message.response_code; return object; }; @@ -73526,6 +73672,7 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { * @interface IRecentApp * @property {vttime.ITime|null} [checked_at] RecentApp checked_at * @property {number|null} [status_code] RecentApp status_code + * @property {tabletmanagerdata.CheckThrottlerResponseCode|null} [response_code] RecentApp response_code */ /** @@ -73559,6 +73706,14 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { */ RecentApp.prototype.status_code = 0; + /** + * RecentApp response_code. + * @member {tabletmanagerdata.CheckThrottlerResponseCode} response_code + * @memberof tabletmanagerdata.GetThrottlerStatusResponse.RecentApp + * @instance + */ + RecentApp.prototype.response_code = 0; + /** * Creates a new RecentApp instance using the specified properties. * @function create @@ -73587,6 +73742,8 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { $root.vttime.Time.encode(message.checked_at, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.status_code != null && Object.hasOwnProperty.call(message, "status_code")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status_code); + if (message.response_code != null && Object.hasOwnProperty.call(message, "response_code")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.response_code); return writer; }; @@ -73629,6 +73786,10 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { message.status_code = reader.int32(); break; } + case 3: { + message.response_code = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -73672,6 +73833,18 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { if (message.status_code != null && message.hasOwnProperty("status_code")) if (!$util.isInteger(message.status_code)) return "status_code: integer expected"; + if (message.response_code != null && message.hasOwnProperty("response_code")) + switch (message.response_code) { + default: + return "response_code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } return null; }; @@ -73694,6 +73867,38 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { } if (object.status_code != null) message.status_code = object.status_code | 0; + switch (object.response_code) { + default: + if (typeof object.response_code === "number") { + message.response_code = object.response_code; + break; + } + break; + case "UNDEFINED": + case 0: + message.response_code = 0; + break; + case "OK": + case 1: + message.response_code = 1; + break; + case "THRESHOLD_EXCEEDED": + case 2: + message.response_code = 2; + break; + case "APP_DENIED": + case 3: + message.response_code = 3; + break; + case "UNKNOWN_METRIC": + case 4: + message.response_code = 4; + break; + case "INTERNAL_ERROR": + case 5: + message.response_code = 5; + break; + } return message; }; @@ -73713,11 +73918,14 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { if (options.defaults) { object.checked_at = null; object.status_code = 0; + object.response_code = options.enums === String ? "UNDEFINED" : 0; } if (message.checked_at != null && message.hasOwnProperty("checked_at")) object.checked_at = $root.vttime.Time.toObject(message.checked_at, options); if (message.status_code != null && message.hasOwnProperty("status_code")) object.status_code = message.status_code; + if (message.response_code != null && message.hasOwnProperty("response_code")) + object.response_code = options.enums === String ? $root.tabletmanagerdata.CheckThrottlerResponseCode[message.response_code] === undefined ? message.response_code : $root.tabletmanagerdata.CheckThrottlerResponseCode[message.response_code] : message.response_code; return object; };