From b327743a255ca0408eae407d0f6d0cd420700613 Mon Sep 17 00:00:00 2001 From: Manan Gupta <35839558+GuptaManan100@users.noreply.github.com> Date: Fri, 22 Mar 2024 20:27:53 +0530 Subject: [PATCH 01/22] Fix aliasing in routes that have a derived table (#15550) Signed-off-by: Manan Gupta --- .../queries/reference/reference_test.go | 19 ++++++++ go/vt/vtgate/planbuilder/operators/route.go | 5 +++ .../planbuilder/testdata/aggr_cases.json | 4 +- .../planbuilder/testdata/from_cases.json | 4 +- .../testdata/info_schema57_cases.json | 4 +- .../testdata/info_schema80_cases.json | 4 +- .../planbuilder/testdata/reference_cases.json | 44 +++++++++++++++++++ .../planbuilder/testdata/select_cases.json | 4 +- 8 files changed, 78 insertions(+), 10 deletions(-) diff --git a/go/test/endtoend/vtgate/queries/reference/reference_test.go b/go/test/endtoend/vtgate/queries/reference/reference_test.go index 9c2508a889f..0e3096e6064 100644 --- a/go/test/endtoend/vtgate/queries/reference/reference_test.go +++ b/go/test/endtoend/vtgate/queries/reference/reference_test.go @@ -83,6 +83,25 @@ func TestReferenceRouting(t *testing.T) { `[[INT64(0)]]`, ) + t.Run("Complex reference query", func(t *testing.T) { + utils.SkipIfBinaryIsBelowVersion(t, 20, "vtgate") + // Verify a complex query using reference tables with a left join having a derived table with an order by clause works as intended. + utils.AssertMatches( + t, + conn, + `SELECT t.id FROM ( + SELECT zd.id, zd.zip_id + FROM `+shardedKeyspaceName+`.zip_detail AS zd + WHERE zd.id IN (2) + ORDER BY zd.discontinued_at + LIMIT 1 + ) AS t + LEFT JOIN `+shardedKeyspaceName+`.zip_detail AS t0 ON t.zip_id = t0.zip_id + ORDER BY t.id`, + `[[INT64(2)]]`, + ) + }) + // UPDATE should route an unqualified zip_detail to unsharded keyspace. utils.Exec(t, conn, "UPDATE zip_detail SET discontinued_at = NULL WHERE id = 2") diff --git a/go/vt/vtgate/planbuilder/operators/route.go b/go/vt/vtgate/planbuilder/operators/route.go index 5742877fbe3..82aeacb20b6 100644 --- a/go/vt/vtgate/planbuilder/operators/route.go +++ b/go/vt/vtgate/planbuilder/operators/route.go @@ -656,6 +656,11 @@ func addMultipleColumnsToInput( } return derivedName, op, added, offset + case *Horizon: + // if the horizon has an alias, then it is a derived table, + // we have to add a new projection and can't build on this one + return op.Alias, op, false, nil + case selectExpressions: name := op.derivedName() if name != "" { diff --git a/go/vt/vtgate/planbuilder/testdata/aggr_cases.json b/go/vt/vtgate/planbuilder/testdata/aggr_cases.json index e98f53bb4cf..f7e556956e3 100644 --- a/go/vt/vtgate/planbuilder/testdata/aggr_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/aggr_cases.json @@ -6249,8 +6249,8 @@ "Name": "user", "Sharded": true }, - "FieldQuery": "select table_name from (select table_name from `user` where 1 != 1 group by table_name) as `tables` where 1 != 1", - "Query": "select table_name from (select table_name from `user` where id = 143 group by table_name) as `tables`", + "FieldQuery": "select `tables`.table_name from (select table_name from `user` where 1 != 1 group by table_name) as `tables` where 1 != 1", + "Query": "select `tables`.table_name from (select table_name from `user` where id = 143 group by table_name) as `tables`", "Table": "`user`", "Values": [ "143" diff --git a/go/vt/vtgate/planbuilder/testdata/from_cases.json b/go/vt/vtgate/planbuilder/testdata/from_cases.json index b8292888161..491d2d526a8 100644 --- a/go/vt/vtgate/planbuilder/testdata/from_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/from_cases.json @@ -4216,8 +4216,8 @@ "Name": "user", "Sharded": true }, - "FieldQuery": "select id, col from (select id, col from `user` where 1 != 1) as u where 1 != 1", - "Query": "select distinct id, col from (select id, col from `user`) as u", + "FieldQuery": "select u.id, u.col from (select id, col from `user` where 1 != 1) as u where 1 != 1", + "Query": "select distinct u.id, u.col from (select id, col from `user`) as u", "Table": "`user`" }, { diff --git a/go/vt/vtgate/planbuilder/testdata/info_schema57_cases.json b/go/vt/vtgate/planbuilder/testdata/info_schema57_cases.json index 1727e372490..09e04b47343 100644 --- a/go/vt/vtgate/planbuilder/testdata/info_schema57_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/info_schema57_cases.json @@ -1162,8 +1162,8 @@ "Name": "main", "Sharded": false }, - "FieldQuery": "select table_name from (select table_name from information_schema.`tables` where 1 != 1) as `tables` where 1 != 1", - "Query": "select table_name from (select table_name from information_schema.`tables` where table_schema != 'information_schema' limit 1) as `tables`", + "FieldQuery": "select `tables`.table_name from (select table_name from information_schema.`tables` where 1 != 1) as `tables` where 1 != 1", + "Query": "select `tables`.table_name from (select table_name from information_schema.`tables` where table_schema != 'information_schema' limit 1) as `tables`", "Table": "information_schema.`tables`" }, { diff --git a/go/vt/vtgate/planbuilder/testdata/info_schema80_cases.json b/go/vt/vtgate/planbuilder/testdata/info_schema80_cases.json index 3e15c19abc5..3df016e0aa3 100644 --- a/go/vt/vtgate/planbuilder/testdata/info_schema80_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/info_schema80_cases.json @@ -1284,8 +1284,8 @@ "Name": "main", "Sharded": false }, - "FieldQuery": "select table_name from (select table_name from information_schema.`tables` where 1 != 1) as `tables` where 1 != 1", - "Query": "select table_name from (select table_name from information_schema.`tables` where table_schema != 'information_schema' limit 1) as `tables`", + "FieldQuery": "select `tables`.table_name from (select table_name from information_schema.`tables` where 1 != 1) as `tables` where 1 != 1", + "Query": "select `tables`.table_name from (select table_name from information_schema.`tables` where table_schema != 'information_schema' limit 1) as `tables`", "Table": "information_schema.`tables`" }, { diff --git a/go/vt/vtgate/planbuilder/testdata/reference_cases.json b/go/vt/vtgate/planbuilder/testdata/reference_cases.json index 42240ce56c7..91aac12d9e9 100644 --- a/go/vt/vtgate/planbuilder/testdata/reference_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/reference_cases.json @@ -161,6 +161,50 @@ ] } }, + { + "comment": "Reference tables using left join with a derived table having a limit clause", + "query": "SELECT u.id FROM ( SELECT a.id, a.u_id FROM user.ref_with_source AS a WHERE a.id IN (3) ORDER BY a.d_at LIMIT 1) as u LEFT JOIN user.ref_with_source AS u0 ON u.u_id = u0.u_uid ORDER BY u.id", + "plan": { + "QueryType": "SELECT", + "Original": "SELECT u.id FROM ( SELECT a.id, a.u_id FROM user.ref_with_source AS a WHERE a.id IN (3) ORDER BY a.d_at LIMIT 1) as u LEFT JOIN user.ref_with_source AS u0 ON u.u_id = u0.u_uid ORDER BY u.id", + "Instructions": { + "OperatorType": "Join", + "Variant": "LeftJoin", + "JoinColumnIndexes": "L:0", + "JoinVars": { + "u_u_id": 1 + }, + "TableName": "ref_with_source_ref_with_source", + "Inputs": [ + { + "OperatorType": "Route", + "Variant": "Reference", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "FieldQuery": "select u.id, u.u_id from (select a.id, a.u_id from ref_with_source as a where 1 != 1) as u where 1 != 1", + "Query": "select u.id, u.u_id from (select a.id, a.u_id from ref_with_source as a where a.id in (3) order by a.d_at asc limit 1) as u order by u.id asc", + "Table": "ref_with_source" + }, + { + "OperatorType": "Route", + "Variant": "Reference", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "FieldQuery": "select 1 from ref_with_source as u0 where 1 != 1", + "Query": "select 1 from ref_with_source as u0 where u0.u_uid = :u_u_id", + "Table": "ref_with_source" + } + ] + }, + "TablesUsed": [ + "user.ref_with_source" + ] + } + }, { "comment": "insert into qualified ambiguous reference table routes to source", "query": "insert into user.ambiguous_ref_with_source(col) values(1)", diff --git a/go/vt/vtgate/planbuilder/testdata/select_cases.json b/go/vt/vtgate/planbuilder/testdata/select_cases.json index 63fba06202c..bfae85a08b2 100644 --- a/go/vt/vtgate/planbuilder/testdata/select_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/select_cases.json @@ -5043,8 +5043,8 @@ "Name": "main", "Sharded": false }, - "FieldQuery": "select table_name from (select table_name from unsharded where 1 != 1) as `tables` where 1 != 1", - "Query": "select table_name from (select table_name from unsharded limit 1) as `tables`", + "FieldQuery": "select `tables`.table_name from (select table_name from unsharded where 1 != 1) as `tables` where 1 != 1", + "Query": "select `tables`.table_name from (select table_name from unsharded limit 1) as `tables`", "Table": "unsharded" }, { From a06cf7d01d4e68745a93ad4272e0a8a1590d2ce8 Mon Sep 17 00:00:00 2001 From: George Ma <164313692+availhang@users.noreply.github.com> Date: Sat, 23 Mar 2024 01:02:17 +0800 Subject: [PATCH 02/22] chore: fix function names (#15545) Signed-off-by: availhang --- go/vt/vtadmin/http/tablets.go | 2 +- go/vt/vtgate/engine/fuzz.go | 4 ++-- go/vt/vtgate/plugin_mysql_server.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go/vt/vtadmin/http/tablets.go b/go/vt/vtadmin/http/tablets.go index 5e819ce945b..d6c8ba788b5 100644 --- a/go/vt/vtadmin/http/tablets.go +++ b/go/vt/vtadmin/http/tablets.go @@ -212,7 +212,7 @@ func StartReplication(ctx context.Context, r Request, api *API) *JSONResponse { return NewJSONResponse(result, err) } -// StartReplication stops replication on the specified tablet. +// StopReplication stops replication on the specified tablet. func StopReplication(ctx context.Context, r Request, api *API) *JSONResponse { vars := r.Vars() diff --git a/go/vt/vtgate/engine/fuzz.go b/go/vt/vtgate/engine/fuzz.go index 13dac3a99d4..5d00ed2db23 100644 --- a/go/vt/vtgate/engine/fuzz.go +++ b/go/vt/vtgate/engine/fuzz.go @@ -80,7 +80,7 @@ func execUpdate(f *fuzz.ConsumeFuzzer) { _, _ = upd.TryExecute(ctx, vc, map[string]*querypb.BindVariable{}, false) } -// execUpdate implements a wrapper to fuzz Insert.Tryexecute() +// execInsert implements a wrapper to fuzz Insert.Tryexecute() func execInsert(f *fuzz.ConsumeFuzzer) { ins := &Insert{} err := f.GenerateStruct(ins) @@ -91,7 +91,7 @@ func execInsert(f *fuzz.ConsumeFuzzer) { _, _ = ins.TryExecute(ctx, vc, map[string]*querypb.BindVariable{}, false) } -// execUpdate implements a wrapper to fuzz Route.Tryexecute() +// execRoute implements a wrapper to fuzz Route.Tryexecute() func execRoute(f *fuzz.ConsumeFuzzer) { sel := &Route{} err := f.GenerateStruct(sel) diff --git a/go/vt/vtgate/plugin_mysql_server.go b/go/vt/vtgate/plugin_mysql_server.go index c0b2fe38b56..175f4b2cc8f 100644 --- a/go/vt/vtgate/plugin_mysql_server.go +++ b/go/vt/vtgate/plugin_mysql_server.go @@ -487,7 +487,7 @@ func initTLSConfig(ctx context.Context, srv *mysqlServer, mysqlSslCert, mysqlSsl return nil } -// initiMySQLProtocol starts the mysql protocol. +// initMySQLProtocol starts the mysql protocol. // It should be called only once in a process. func initMySQLProtocol(vtgate *VTGate) *mysqlServer { // Flag is not set, just return. From 8a6fe42fc0f9d34980d1bf23df3d077bf4adb693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Taylor?= Date: Sat, 23 Mar 2024 08:00:17 +0100 Subject: [PATCH 03/22] bugfix: handling of ANDed join predicates (#15551) Signed-off-by: Andres Taylor --- .../planbuilder/operators/apply_join.go | 11 ++++++--- .../planbuilder/operators/expressions.go | 1 - .../planbuilder/testdata/select_cases.json | 24 +++++++++++++++++++ 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/go/vt/vtgate/planbuilder/operators/apply_join.go b/go/vt/vtgate/planbuilder/operators/apply_join.go index 2e72f2eae57..043e76b5e15 100644 --- a/go/vt/vtgate/planbuilder/operators/apply_join.go +++ b/go/vt/vtgate/planbuilder/operators/apply_join.go @@ -156,9 +156,14 @@ func (aj *ApplyJoin) AddJoinPredicate(ctx *plancontext.PlanningContext, expr sql if expr == nil { return } - col := breakExpressionInLHSandRHSForApplyJoin(ctx, expr, TableID(aj.LHS)) - aj.JoinPredicates.add(col) - rhs := aj.RHS.AddPredicate(ctx, col.RHSExpr) + rhs := aj.RHS + predicates := sqlparser.SplitAndExpression(nil, expr) + for _, pred := range predicates { + col := breakExpressionInLHSandRHSForApplyJoin(ctx, pred, TableID(aj.LHS)) + aj.JoinPredicates.add(col) + ctx.AddJoinPredicates(pred, col.RHSExpr) + rhs = rhs.AddPredicate(ctx, col.RHSExpr) + } aj.RHS = rhs } diff --git a/go/vt/vtgate/planbuilder/operators/expressions.go b/go/vt/vtgate/planbuilder/operators/expressions.go index 1b9194c35fa..612c1e7ec08 100644 --- a/go/vt/vtgate/planbuilder/operators/expressions.go +++ b/go/vt/vtgate/planbuilder/operators/expressions.go @@ -51,7 +51,6 @@ func breakExpressionInLHSandRHSForApplyJoin( cursor.Replace(arg) }, nil).(sqlparser.Expr) - ctx.AddJoinPredicates(expr, rewrittenExpr) col.RHSExpr = rewrittenExpr col.Original = expr return diff --git a/go/vt/vtgate/planbuilder/testdata/select_cases.json b/go/vt/vtgate/planbuilder/testdata/select_cases.json index bfae85a08b2..9707fa68d2c 100644 --- a/go/vt/vtgate/planbuilder/testdata/select_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/select_cases.json @@ -2658,6 +2658,30 @@ ] } }, + { + "comment": "Complex join with multiple conditions merged into single route", + "query": "select 0 from user as u join user_extra as s on u.id = s.user_id join music as m on m.user_id = u.id and (s.foo or m.bar)", + "plan": { + "QueryType": "SELECT", + "Original": "select 0 from user as u join user_extra as s on u.id = s.user_id join music as m on m.user_id = u.id and (s.foo or m.bar)", + "Instructions": { + "OperatorType": "Route", + "Variant": "Scatter", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "FieldQuery": "select 0 from `user` as u, user_extra as s, music as m where 1 != 1", + "Query": "select 0 from `user` as u, user_extra as s, music as m where u.id = s.user_id and m.user_id = u.id and (s.foo or m.bar)", + "Table": "`user`, music, user_extra" + }, + "TablesUsed": [ + "user.music", + "user.user", + "user.user_extra" + ] + } + }, { "comment": "union as a derived table", "query": "select found from (select id as found from user union all (select id from unsharded)) as t", From 3eb67439d713c3d879356af3d26a1c4ac90fd4de Mon Sep 17 00:00:00 2001 From: Rohit Nayak <57520317+rohit-nayak-ps@users.noreply.github.com> Date: Sat, 23 Mar 2024 11:53:05 +0100 Subject: [PATCH 04/22] Reduce excessing logging in CI (#15462) Signed-off-by: Rohit Nayak --- .github/workflows/cluster_endtoend_12.yml | 6 +++--- .github/workflows/cluster_endtoend_13.yml | 6 +++--- .github/workflows/cluster_endtoend_15.yml | 6 +++--- .github/workflows/cluster_endtoend_18.yml | 6 +++--- .github/workflows/cluster_endtoend_21.yml | 6 +++--- .github/workflows/cluster_endtoend_22.yml | 6 +++--- .../cluster_endtoend_backup_pitr.yml | 6 +++--- ...luster_endtoend_backup_pitr_xtrabackup.yml | 12 +++++------ ...ter_endtoend_ers_prs_newfeatures_heavy.yml | 6 +++--- .../workflows/cluster_endtoend_mysql80.yml | 6 +++--- .../cluster_endtoend_mysql_server_vault.yml | 6 +++--- .../cluster_endtoend_onlineddl_ghost.yml | 6 +++--- .../cluster_endtoend_onlineddl_revert.yml | 6 +++--- .../cluster_endtoend_onlineddl_scheduler.yml | 6 +++--- .../cluster_endtoend_onlineddl_vrepl.yml | 6 +++--- ...luster_endtoend_onlineddl_vrepl_stress.yml | 6 +++--- ..._endtoend_onlineddl_vrepl_stress_suite.yml | 6 +++--- ...cluster_endtoend_onlineddl_vrepl_suite.yml | 6 +++--- .../cluster_endtoend_schemadiff_vrepl.yml | 6 +++--- .../cluster_endtoend_tabletmanager_consul.yml | 6 +++--- ...cluster_endtoend_tabletmanager_tablegc.yml | 6 +++--- ..._endtoend_tabletmanager_throttler_topo.yml | 6 +++--- ...cluster_endtoend_topo_connection_cache.yml | 6 +++--- ...dtoend_vreplication_across_db_versions.yml | 6 +++--- .../cluster_endtoend_vreplication_basic.yml | 6 +++--- ...luster_endtoend_vreplication_cellalias.yml | 6 +++--- ...dtoend_vreplication_foreign_key_stress.yml | 6 +++--- ...vreplication_migrate_vdiff2_convert_tz.yml | 6 +++--- ...ion_partial_movetables_and_materialize.yml | 6 +++--- .../cluster_endtoend_vreplication_v2.yml | 6 +++--- .../workflows/cluster_endtoend_vstream.yml | 6 +++--- .../workflows/cluster_endtoend_vtbackup.yml | 6 +++--- ..._vtctlbackup_sharded_clustertest_heavy.yml | 6 +++--- .../cluster_endtoend_vtgate_concurrentdml.yml | 6 +++--- ...ster_endtoend_vtgate_foreignkey_stress.yml | 6 +++--- .../cluster_endtoend_vtgate_gen4.yml | 6 +++--- .../cluster_endtoend_vtgate_general_heavy.yml | 6 +++--- .../cluster_endtoend_vtgate_godriver.yml | 6 +++--- ...uster_endtoend_vtgate_partial_keyspace.yml | 6 +++--- .../cluster_endtoend_vtgate_queries.yml | 6 +++--- ...cluster_endtoend_vtgate_readafterwrite.yml | 6 +++--- .../cluster_endtoend_vtgate_reservedconn.yml | 6 +++--- .../cluster_endtoend_vtgate_schema.yml | 6 +++--- ...cluster_endtoend_vtgate_schema_tracker.yml | 6 +++--- ...dtoend_vtgate_tablet_healthcheck_cache.yml | 6 +++--- .../cluster_endtoend_vtgate_topo.yml | 6 +++--- .../cluster_endtoend_vtgate_topo_consul.yml | 6 +++--- .../cluster_endtoend_vtgate_topo_etcd.yml | 6 +++--- .../cluster_endtoend_vtgate_transaction.yml | 6 +++--- .../cluster_endtoend_vtgate_unsharded.yml | 6 +++--- .../cluster_endtoend_vtgate_vindex_heavy.yml | 6 +++--- .../cluster_endtoend_vtgate_vschema.yml | 6 +++--- .github/workflows/cluster_endtoend_vtorc.yml | 6 +++--- .../cluster_endtoend_vttablet_prscomplex.yml | 6 +++--- .../workflows/cluster_endtoend_xb_backup.yml | 12 +++++------ .../cluster_endtoend_xb_recovery.yml | 12 +++++------ .github/workflows/unit_race.yml | 8 ++++---- .github/workflows/unit_test_mysql57.yml | 16 +++++++-------- .github/workflows/unit_test_mysql80.yml | 16 +++++++-------- bootstrap.sh | 12 +++++------ test/templates/cluster_endtoend_test.tpl | 16 +++++++-------- test/templates/unit_test.tpl | 20 +++++++++---------- 62 files changed, 221 insertions(+), 221 deletions(-) diff --git a/.github/workflows/cluster_endtoend_12.yml b/.github/workflows/cluster_endtoend_12.yml index 07b3d473b06..14362000aa0 100644 --- a/.github/workflows/cluster_endtoend_12.yml +++ b/.github/workflows/cluster_endtoend_12.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_13.yml b/.github/workflows/cluster_endtoend_13.yml index 4a00ac2702b..e63d2c9a5fe 100644 --- a/.github/workflows/cluster_endtoend_13.yml +++ b/.github/workflows/cluster_endtoend_13.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_15.yml b/.github/workflows/cluster_endtoend_15.yml index d9648d024da..f1345d1edc5 100644 --- a/.github/workflows/cluster_endtoend_15.yml +++ b/.github/workflows/cluster_endtoend_15.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_18.yml b/.github/workflows/cluster_endtoend_18.yml index 521df8f89b4..d693a686f89 100644 --- a/.github/workflows/cluster_endtoend_18.yml +++ b/.github/workflows/cluster_endtoend_18.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_21.yml b/.github/workflows/cluster_endtoend_21.yml index 871c7ef1603..0abf7038dae 100644 --- a/.github/workflows/cluster_endtoend_21.yml +++ b/.github/workflows/cluster_endtoend_21.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_22.yml b/.github/workflows/cluster_endtoend_22.yml index cbdb3b093fb..3e3eff5fe94 100644 --- a/.github/workflows/cluster_endtoend_22.yml +++ b/.github/workflows/cluster_endtoend_22.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_backup_pitr.yml b/.github/workflows/cluster_endtoend_backup_pitr.yml index 490b0f39f23..84c335519db 100644 --- a/.github/workflows/cluster_endtoend_backup_pitr.yml +++ b/.github/workflows/cluster_endtoend_backup_pitr.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_backup_pitr_xtrabackup.yml b/.github/workflows/cluster_endtoend_backup_pitr_xtrabackup.yml index b88b44470bf..fc24d0c8019 100644 --- a/.github/workflows/cluster_endtoend_backup_pitr_xtrabackup.yml +++ b/.github/workflows/cluster_endtoend_backup_pitr_xtrabackup.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -94,15 +94,15 @@ jobs: run: | # Setup Percona Server for MySQL 8.0 - sudo apt-get update - sudo apt-get install -y lsb-release gnupg2 curl + sudo apt-get -qq update + sudo apt-get -qq install -y lsb-release gnupg2 curl wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb sudo percona-release setup ps80 - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop @@ -113,7 +113,7 @@ jobs: # install JUnit report formatter go install github.com/vitessio/go-junit-report@HEAD - sudo apt-get install -y percona-xtrabackup-80 lz4 + sudo apt-get -qq install -y percona-xtrabackup-80 lz4 - name: Setup launchable dependencies if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' diff --git a/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml b/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml index 5fd13aef2fe..5545d9867a6 100644 --- a/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml +++ b/.github/workflows/cluster_endtoend_ers_prs_newfeatures_heavy.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_mysql80.yml b/.github/workflows/cluster_endtoend_mysql80.yml index 5d31c9f233f..2bb8de31cc9 100644 --- a/.github/workflows/cluster_endtoend_mysql80.yml +++ b/.github/workflows/cluster_endtoend_mysql80.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_mysql_server_vault.yml b/.github/workflows/cluster_endtoend_mysql_server_vault.yml index fc5e1d498a2..aa93f2bccb7 100644 --- a/.github/workflows/cluster_endtoend_mysql_server_vault.yml +++ b/.github/workflows/cluster_endtoend_mysql_server_vault.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_onlineddl_ghost.yml b/.github/workflows/cluster_endtoend_onlineddl_ghost.yml index ba3ddfad953..439ba4ea17c 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_ghost.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_ghost.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -100,9 +100,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_onlineddl_revert.yml b/.github/workflows/cluster_endtoend_onlineddl_revert.yml index a40fa04016f..5cf5432c300 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_revert.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_revert.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -100,9 +100,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml b/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml index c6c6b027983..f85aced621e 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_scheduler.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -100,9 +100,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml index 3b1a7312880..31fb0ad1f07 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -100,9 +100,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml index f1c94811612..c0f288d11a2 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -100,9 +100,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml index 56f5ea03318..6b547e5e12f 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_stress_suite.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -100,9 +100,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml index 7a614a7d634..f12b4332748 100644 --- a/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml +++ b/.github/workflows/cluster_endtoend_onlineddl_vrepl_suite.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -100,9 +100,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml b/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml index 1fcfdf2dfa8..ea65d5d295e 100644 --- a/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml +++ b/.github/workflows/cluster_endtoend_schemadiff_vrepl.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -100,9 +100,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_tabletmanager_consul.yml b/.github/workflows/cluster_endtoend_tabletmanager_consul.yml index e6bfbfb19d0..76431e831a7 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_consul.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_consul.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml b/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml index 5cc76747295..1e3d95a01e2 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_tablegc.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml b/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml index cc892ea9ca7..9ec35b1aa8c 100644 --- a/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml +++ b/.github/workflows/cluster_endtoend_tabletmanager_throttler_topo.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_topo_connection_cache.yml b/.github/workflows/cluster_endtoend_topo_connection_cache.yml index dab278a0e50..c4f7126acd0 100644 --- a/.github/workflows/cluster_endtoend_topo_connection_cache.yml +++ b/.github/workflows/cluster_endtoend_topo_connection_cache.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml b/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml index cb26538e646..ec5d1333a62 100644 --- a/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml +++ b/.github/workflows/cluster_endtoend_vreplication_across_db_versions.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vreplication_basic.yml b/.github/workflows/cluster_endtoend_vreplication_basic.yml index 01356242e5c..ea7f5a3f264 100644 --- a/.github/workflows/cluster_endtoend_vreplication_basic.yml +++ b/.github/workflows/cluster_endtoend_vreplication_basic.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vreplication_cellalias.yml b/.github/workflows/cluster_endtoend_vreplication_cellalias.yml index 1afbbfa92a4..8283c1b10f6 100644 --- a/.github/workflows/cluster_endtoend_vreplication_cellalias.yml +++ b/.github/workflows/cluster_endtoend_vreplication_cellalias.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vreplication_foreign_key_stress.yml b/.github/workflows/cluster_endtoend_vreplication_foreign_key_stress.yml index e7649caf534..8703112afd6 100644 --- a/.github/workflows/cluster_endtoend_vreplication_foreign_key_stress.yml +++ b/.github/workflows/cluster_endtoend_vreplication_foreign_key_stress.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml b/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml index c9cf2e2aa0e..8c2ae4dc024 100644 --- a/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml +++ b/.github/workflows/cluster_endtoend_vreplication_migrate_vdiff2_convert_tz.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vreplication_partial_movetables_and_materialize.yml b/.github/workflows/cluster_endtoend_vreplication_partial_movetables_and_materialize.yml index 7e9c2e184af..2330961355d 100644 --- a/.github/workflows/cluster_endtoend_vreplication_partial_movetables_and_materialize.yml +++ b/.github/workflows/cluster_endtoend_vreplication_partial_movetables_and_materialize.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vreplication_v2.yml b/.github/workflows/cluster_endtoend_vreplication_v2.yml index a47e95ad1b5..d3eec0d9374 100644 --- a/.github/workflows/cluster_endtoend_vreplication_v2.yml +++ b/.github/workflows/cluster_endtoend_vreplication_v2.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vstream.yml b/.github/workflows/cluster_endtoend_vstream.yml index f03e581e7ee..e6ac049b62b 100644 --- a/.github/workflows/cluster_endtoend_vstream.yml +++ b/.github/workflows/cluster_endtoend_vstream.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtbackup.yml b/.github/workflows/cluster_endtoend_vtbackup.yml index 9b362919034..310c465bf7f 100644 --- a/.github/workflows/cluster_endtoend_vtbackup.yml +++ b/.github/workflows/cluster_endtoend_vtbackup.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml b/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml index f0146a96c7a..62619891af1 100644 --- a/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtctlbackup_sharded_clustertest_heavy.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml b/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml index 63b74e29cf5..d6278c645b0 100644 --- a/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml +++ b/.github/workflows/cluster_endtoend_vtgate_concurrentdml.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml b/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml index 09ba7042262..216ab31218c 100644 --- a/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml +++ b/.github/workflows/cluster_endtoend_vtgate_foreignkey_stress.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_gen4.yml b/.github/workflows/cluster_endtoend_vtgate_gen4.yml index 0b432857f99..6051ebd4b2d 100644 --- a/.github/workflows/cluster_endtoend_vtgate_gen4.yml +++ b/.github/workflows/cluster_endtoend_vtgate_gen4.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml b/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml index a04bfd6c34d..ba20cb9c0b7 100644 --- a/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtgate_general_heavy.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_godriver.yml b/.github/workflows/cluster_endtoend_vtgate_godriver.yml index 7d3b51fb75e..333c2a2985f 100644 --- a/.github/workflows/cluster_endtoend_vtgate_godriver.yml +++ b/.github/workflows/cluster_endtoend_vtgate_godriver.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml b/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml index 2826691970f..92983807244 100644 --- a/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml +++ b/.github/workflows/cluster_endtoend_vtgate_partial_keyspace.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_queries.yml b/.github/workflows/cluster_endtoend_vtgate_queries.yml index 1ff371e529d..5d9624c667e 100644 --- a/.github/workflows/cluster_endtoend_vtgate_queries.yml +++ b/.github/workflows/cluster_endtoend_vtgate_queries.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml b/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml index 49012f82dad..11b99031c29 100644 --- a/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml +++ b/.github/workflows/cluster_endtoend_vtgate_readafterwrite.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml b/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml index 7e1b85ef558..ade9fe91ebe 100644 --- a/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml +++ b/.github/workflows/cluster_endtoend_vtgate_reservedconn.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_schema.yml b/.github/workflows/cluster_endtoend_vtgate_schema.yml index 4ae04e2553b..8dcc9eb2b07 100644 --- a/.github/workflows/cluster_endtoend_vtgate_schema.yml +++ b/.github/workflows/cluster_endtoend_vtgate_schema.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml b/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml index 2190ada16ac..a8a2acea62f 100644 --- a/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml +++ b/.github/workflows/cluster_endtoend_vtgate_schema_tracker.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml b/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml index 2b432ac4ebe..ed4a8c0267c 100644 --- a/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml +++ b/.github/workflows/cluster_endtoend_vtgate_tablet_healthcheck_cache.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_topo.yml b/.github/workflows/cluster_endtoend_vtgate_topo.yml index ab61473b237..974ec0a78e9 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml b/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml index 2460bdfd455..00d2eaf86c2 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo_consul.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml b/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml index 6da750f5aff..4851c355f00 100644 --- a/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml +++ b/.github/workflows/cluster_endtoend_vtgate_topo_etcd.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_transaction.yml b/.github/workflows/cluster_endtoend_vtgate_transaction.yml index 5b33ecdfc37..a2bc38e85f9 100644 --- a/.github/workflows/cluster_endtoend_vtgate_transaction.yml +++ b/.github/workflows/cluster_endtoend_vtgate_transaction.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_unsharded.yml b/.github/workflows/cluster_endtoend_vtgate_unsharded.yml index cf0b469a2dc..204c73691c9 100644 --- a/.github/workflows/cluster_endtoend_vtgate_unsharded.yml +++ b/.github/workflows/cluster_endtoend_vtgate_unsharded.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml b/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml index 26ded9b01c9..d8053f27b06 100644 --- a/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml +++ b/.github/workflows/cluster_endtoend_vtgate_vindex_heavy.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtgate_vschema.yml b/.github/workflows/cluster_endtoend_vtgate_vschema.yml index 4b6f75f5381..8360849e6c9 100644 --- a/.github/workflows/cluster_endtoend_vtgate_vschema.yml +++ b/.github/workflows/cluster_endtoend_vtgate_vschema.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vtorc.yml b/.github/workflows/cluster_endtoend_vtorc.yml index b0a09d49a49..4d5aa4b964f 100644 --- a/.github/workflows/cluster_endtoend_vtorc.yml +++ b/.github/workflows/cluster_endtoend_vtorc.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -108,9 +108,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml b/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml index 905e36c42ef..aee724dd4f6 100644 --- a/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml +++ b/.github/workflows/cluster_endtoend_vttablet_prscomplex.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -99,9 +99,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop diff --git a/.github/workflows/cluster_endtoend_xb_backup.yml b/.github/workflows/cluster_endtoend_xb_backup.yml index e02e66add7f..4cfe72c7d56 100644 --- a/.github/workflows/cluster_endtoend_xb_backup.yml +++ b/.github/workflows/cluster_endtoend_xb_backup.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -94,15 +94,15 @@ jobs: run: | # Setup Percona Server for MySQL 8.0 - sudo apt-get update - sudo apt-get install -y lsb-release gnupg2 curl + sudo apt-get -qq update + sudo apt-get -qq install -y lsb-release gnupg2 curl wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb sudo percona-release setup ps80 - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop @@ -113,7 +113,7 @@ jobs: # install JUnit report formatter go install github.com/vitessio/go-junit-report@HEAD - sudo apt-get install -y percona-xtrabackup-80 lz4 + sudo apt-get -qq install -y percona-xtrabackup-80 lz4 - name: Setup launchable dependencies if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' diff --git a/.github/workflows/cluster_endtoend_xb_recovery.yml b/.github/workflows/cluster_endtoend_xb_recovery.yml index afb9b16f097..337e3031240 100644 --- a/.github/workflows/cluster_endtoend_xb_recovery.yml +++ b/.github/workflows/cluster_endtoend_xb_recovery.yml @@ -36,7 +36,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ -H "Accept: application/vnd.github.v3+json" \ "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}") @@ -94,15 +94,15 @@ jobs: run: | # Setup Percona Server for MySQL 8.0 - sudo apt-get update - sudo apt-get install -y lsb-release gnupg2 curl + sudo apt-get -qq update + sudo apt-get -qq install -y lsb-release gnupg2 curl wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb sudo percona-release setup ps80 - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils libncurses5 sudo service mysql stop sudo service etcd stop @@ -113,7 +113,7 @@ jobs: # install JUnit report formatter go install github.com/vitessio/go-junit-report@HEAD - sudo apt-get install -y percona-xtrabackup-80 lz4 + sudo apt-get -qq install -y percona-xtrabackup-80 lz4 - name: Setup launchable dependencies if: steps.skip-workflow.outputs.is_draft == 'false' && steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.end_to_end == 'true' && github.base_ref == 'main' diff --git a/.github/workflows/unit_race.yml b/.github/workflows/unit_race.yml index b56aa74c3af..a1381b9df30 100644 --- a/.github/workflows/unit_race.yml +++ b/.github/workflows/unit_race.yml @@ -68,19 +68,19 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | export DEBIAN_FRONTEND="noninteractive" - sudo apt-get update + sudo apt-get -qq update # mysql80 - sudo apt-get install -y mysql-server mysql-client + sudo apt-get -qq install -y mysql-server mysql-client - sudo apt-get install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata + sudo apt-get -qq install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata sudo service mysql stop sudo bash -c "echo '/usr/sbin/mysqld { }' > /etc/apparmor.d/usr.sbin.mysqld" # https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263 sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld || echo "could not remove mysqld profile" mkdir -p dist bin - curl -L https://github.com/coreos/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz | tar -zxC dist + curl -s -L https://github.com/coreos/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz | tar -zxC dist mv dist/etcd-v3.3.10-linux-amd64/{etcd,etcdctl} bin/ go mod download diff --git a/.github/workflows/unit_test_mysql57.yml b/.github/workflows/unit_test_mysql57.yml index 9513ec693b9..a9779a445d6 100644 --- a/.github/workflows/unit_test_mysql57.yml +++ b/.github/workflows/unit_test_mysql57.yml @@ -89,13 +89,13 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | export DEBIAN_FRONTEND="noninteractive" - sudo apt-get update + sudo apt-get -qq update # Uninstall any previously installed MySQL first sudo systemctl stop apparmor - sudo DEBIAN_FRONTEND="noninteractive" apt-get remove -y --purge mysql-server mysql-client mysql-common - sudo apt-get -y autoremove - sudo apt-get -y autoclean + sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq remove -y --purge mysql-server mysql-client mysql-common + sudo apt-get -qq -y autoremove + sudo apt-get -qq -y autoclean sudo deluser mysql sudo rm -rf /var/lib/mysql sudo rm -rf /etc/mysql @@ -110,17 +110,17 @@ jobs: echo mysql-apt-config mysql-apt-config/repo-codename select bionic | sudo debconf-set-selections echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update - sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7* libncurses5 + sudo apt-get -qq update + sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq install -y mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7* libncurses5 - sudo apt-get install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata + sudo apt-get -qq install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata sudo service mysql stop sudo bash -c "echo '/usr/sbin/mysqld { }' > /etc/apparmor.d/usr.sbin.mysqld" # https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263 sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld || echo "could not remove mysqld profile" mkdir -p dist bin - curl -L https://github.com/coreos/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz | tar -zxC dist + curl -s -L https://github.com/coreos/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz | tar -zxC dist mv dist/etcd-v3.3.10-linux-amd64/{etcd,etcdctl} bin/ go mod download diff --git a/.github/workflows/unit_test_mysql80.yml b/.github/workflows/unit_test_mysql80.yml index 987f6ebd8b3..ef494307409 100644 --- a/.github/workflows/unit_test_mysql80.yml +++ b/.github/workflows/unit_test_mysql80.yml @@ -89,13 +89,13 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | export DEBIAN_FRONTEND="noninteractive" - sudo apt-get update + sudo apt-get -qq update # Uninstall any previously installed MySQL first sudo systemctl stop apparmor - sudo DEBIAN_FRONTEND="noninteractive" apt-get remove -y --purge mysql-server mysql-client mysql-common - sudo apt-get -y autoremove - sudo apt-get -y autoclean + sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq remove -y --purge mysql-server mysql-client mysql-common + sudo apt-get -qq -y autoremove + sudo apt-get -qq -y autoclean sudo deluser mysql sudo rm -rf /var/lib/mysql sudo rm -rf /etc/mysql @@ -107,17 +107,17 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update - sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-server mysql-client + sudo apt-get -qq update + sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq install -y mysql-server mysql-client - sudo apt-get install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata + sudo apt-get -qq install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata sudo service mysql stop sudo bash -c "echo '/usr/sbin/mysqld { }' > /etc/apparmor.d/usr.sbin.mysqld" # https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263 sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld || echo "could not remove mysqld profile" mkdir -p dist bin - curl -L https://github.com/coreos/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz | tar -zxC dist + curl -s -L https://github.com/coreos/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz | tar -zxC dist mv dist/etcd-v3.3.10-linux-amd64/{etcd,etcdctl} bin/ go mod download diff --git a/bootstrap.sh b/bootstrap.sh index d3a4943ad38..5d6840496d3 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -113,7 +113,7 @@ install_protoc() { esac # This is how we'd download directly from source: - "${VTROOT}/tools/wget-retry" https://github.com/protocolbuffers/protobuf/releases/download/v$version/protoc-$version-$platform-${target}.zip + "${VTROOT}/tools/wget-retry" -q https://github.com/protocolbuffers/protobuf/releases/download/v$version/protoc-$version-$platform-${target}.zip #"${VTROOT}/tools/wget-retry" "${VITESS_RESOURCES_DOWNLOAD_URL}/protoc-$version-$platform-${target}.zip" unzip "protoc-$version-$platform-${target}.zip" @@ -128,9 +128,9 @@ install_zookeeper() { zk="zookeeper-$version" # This is how we'd download directly from source: # wget "https://dlcdn.apache.org/zookeeper/$zk/apache-$zk.tar.gz" - "${VTROOT}/tools/wget-retry" "${VITESS_RESOURCES_DOWNLOAD_URL}/apache-${zk}.tar.gz" + "${VTROOT}/tools/wget-retry" -q "${VITESS_RESOURCES_DOWNLOAD_URL}/apache-${zk}.tar.gz" tar -xzf "$dist/apache-$zk.tar.gz" - mvn -f $dist/apache-$zk/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml clean install -P fatjar -DskipTests + mvn -q -f $dist/apache-$zk/zookeeper-contrib/zookeeper-contrib-fatjar/pom.xml clean install -P fatjar -DskipTests mkdir -p $dist/lib cp "$dist/apache-$zk/zookeeper-contrib/zookeeper-contrib-fatjar/target/$zk-fatjar.jar" "$dist/lib/$zk-fatjar.jar" rm -rf "$dist/apache-$zk" @@ -158,7 +158,7 @@ install_etcd() { file="etcd-${version}-${platform}-${target}.${ext}" # This is how we'd download directly from source: - "${VTROOT}/tools/wget-retry" "https://github.com/etcd-io/etcd/releases/download/$version/$file" + "${VTROOT}/tools/wget-retry" -q "https://github.com/etcd-io/etcd/releases/download/$version/$file" #"${VTROOT}/tools/wget-retry" "${VITESS_RESOURCES_DOWNLOAD_URL}/${file}" if [ "$ext" = "tar.gz" ]; then tar xzf "$file" @@ -191,7 +191,7 @@ install_consul() { # This is how we'd download directly from source: # download_url=https://releases.hashicorp.com/consul # wget "${download_url}/${version}/consul_${version}_${platform}_${target}.zip" - "${VTROOT}/tools/wget-retry" "${VITESS_RESOURCES_DOWNLOAD_URL}/consul_${version}_${platform}_${target}.zip" + "${VTROOT}/tools/wget-retry" -q "${VITESS_RESOURCES_DOWNLOAD_URL}/consul_${version}_${platform}_${target}.zip" unzip "consul_${version}_${platform}_${target}.zip" ln -snf "$dist/consul" "$VTROOT/bin/consul" } @@ -217,7 +217,7 @@ install_toxiproxy() { # This is how we'd download directly from source: file="toxiproxy-server-${platform}-${target}" - "${VTROOT}/tools/wget-retry" "https://github.com/Shopify/toxiproxy/releases/download/$version/$file" + "${VTROOT}/tools/wget-retry" -q "https://github.com/Shopify/toxiproxy/releases/download/$version/$file" chmod +x "$dist/$file" ln -snf "$dist/$file" "$VTROOT/bin/toxiproxy-server" } diff --git a/test/templates/cluster_endtoend_test.tpl b/test/templates/cluster_endtoend_test.tpl index 51572c42006..c202f62a63b 100644 --- a/test/templates/cluster_endtoend_test.tpl +++ b/test/templates/cluster_endtoend_test.tpl @@ -34,7 +34,7 @@ jobs: echo Skip ${skip} echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT - PR_DATA=$(curl \ + PR_DATA=$(curl -s\ -H "{{"Authorization: token ${{ secrets.GITHUB_TOKEN }}"}}" \ -H "Accept: application/vnd.github.v3+json" \ "{{"https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}"}}") @@ -109,15 +109,15 @@ jobs: {{if .InstallXtraBackup}} # Setup Percona Server for MySQL 8.0 - sudo apt-get update - sudo apt-get install -y lsb-release gnupg2 curl + sudo apt-get -qq update + sudo apt-get -qq install -y lsb-release gnupg2 curl wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb sudo DEBIAN_FRONTEND="noninteractive" dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb sudo percona-release setup ps80 - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y percona-server-server percona-server-client make unzip g++ etcd git wget eatmydata xz-utils libncurses5 {{else}} @@ -127,9 +127,9 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update + sudo apt-get -qq update # Install everything else we need, and configure - sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 + sudo apt-get -qq install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata xz-utils libncurses5 {{end}} @@ -144,7 +144,7 @@ jobs: {{if .InstallXtraBackup}} - sudo apt-get install -y percona-xtrabackup-80 lz4 + sudo apt-get -qq install -y percona-xtrabackup-80 lz4 {{end}} diff --git a/test/templates/unit_test.tpl b/test/templates/unit_test.tpl index 29f5caae3c2..6185b0d19d8 100644 --- a/test/templates/unit_test.tpl +++ b/test/templates/unit_test.tpl @@ -87,13 +87,13 @@ jobs: if: steps.skip-workflow.outputs.skip-workflow == 'false' && steps.changes.outputs.unit_tests == 'true' run: | export DEBIAN_FRONTEND="noninteractive" - sudo apt-get update + sudo apt-get -qq update # Uninstall any previously installed MySQL first sudo systemctl stop apparmor - sudo DEBIAN_FRONTEND="noninteractive" apt-get remove -y --purge mysql-server mysql-client mysql-common - sudo apt-get -y autoremove - sudo apt-get -y autoclean + sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq remove -y --purge mysql-server mysql-client mysql-common + sudo apt-get -qq -y autoremove + sudo apt-get -qq -y autoclean sudo deluser mysql sudo rm -rf /var/lib/mysql sudo rm -rf /etc/mysql @@ -109,8 +109,8 @@ jobs: echo mysql-apt-config mysql-apt-config/repo-codename select bionic | sudo debconf-set-selections echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update - sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7* libncurses5 + sudo apt-get -qq update + sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq install -y mysql-client=5.7* mysql-community-server=5.7* mysql-server=5.7* libncurses5 {{end}} @@ -122,19 +122,19 @@ jobs: wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.29-1_all.deb echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config* - sudo apt-get update - sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-server mysql-client + sudo apt-get -qq update + sudo DEBIAN_FRONTEND="noninteractive" apt-get -qq install -y mysql-server mysql-client {{end}} - sudo apt-get install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata + sudo apt-get -qq install -y make unzip g++ curl git wget ant openjdk-11-jdk eatmydata sudo service mysql stop sudo bash -c "echo '/usr/sbin/mysqld { }' > /etc/apparmor.d/usr.sbin.mysqld" # https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263 sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld || echo "could not remove mysqld profile" mkdir -p dist bin - curl -L https://github.com/coreos/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz | tar -zxC dist + curl -s -L https://github.com/coreos/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz | tar -zxC dist mv dist/etcd-v3.3.10-linux-amd64/{etcd,etcdctl} bin/ go mod download From 4f2456064a9773447c059193e485d2bf02cfab96 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Sun, 24 Mar 2024 16:45:37 +0200 Subject: [PATCH 05/22] `proto`: lexical ordering of `ExecuteMultiFetchAsDBA` (#15558) Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/proto/vtctldata/vtctldata.pb.go | 266 +++--- go/vt/proto/vtctldata/vtctldata_vtproto.pb.go | 428 +++++----- go/vt/proto/vtctlservice/vtctlservice.pb.go | 42 +- .../vtctlservice/vtctlservice_grpc.pb.go | 54 +- go/vt/vtctl/grpcvtctldclient/client_gen.go | 12 +- go/vt/vtctl/localvtctldclient/client_gen.go | 10 +- proto/vtctldata.proto | 18 +- proto/vtctlservice.proto | 4 +- web/vtadmin/src/proto/vtadmin.d.ts | 316 +++---- web/vtadmin/src/proto/vtadmin.js | 798 +++++++++--------- 10 files changed, 974 insertions(+), 974 deletions(-) diff --git a/go/vt/proto/vtctldata/vtctldata.pb.go b/go/vt/proto/vtctldata/vtctldata.pb.go index 321eebbc1f7..864135a23c8 100644 --- a/go/vt/proto/vtctldata/vtctldata.pb.go +++ b/go/vt/proto/vtctldata/vtctldata.pb.go @@ -4095,31 +4095,17 @@ func (x *ExecuteFetchAsDBAResponse) GetResult() *query.QueryResult { return nil } -type ExecuteMultiFetchAsDBARequest struct { +type ExecuteHookRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TabletAlias *topodata.TabletAlias `protobuf:"bytes,1,opt,name=tablet_alias,json=tabletAlias,proto3" json:"tablet_alias,omitempty"` - // SQL could have potentially multiple queries separated by semicolons. - Sql string `protobuf:"bytes,2,opt,name=sql,proto3" json:"sql,omitempty"` - // MaxRows is an optional parameter to limit the number of rows read into the - // QueryResult. Note that this does not apply a LIMIT to a query, just how - // many rows are read from the MySQL server on the tablet side. - // - // This field is optional. Specifying a non-positive value will use whatever - // default is configured in the VtctldService. - MaxRows int64 `protobuf:"varint,3,opt,name=max_rows,json=maxRows,proto3" json:"max_rows,omitempty"` - // DisableBinlogs instructs the tablet not to use binary logging when - // executing the query. - DisableBinlogs bool `protobuf:"varint,4,opt,name=disable_binlogs,json=disableBinlogs,proto3" json:"disable_binlogs,omitempty"` - // ReloadSchema instructs the tablet to reload its schema after executing the - // query. - ReloadSchema bool `protobuf:"varint,5,opt,name=reload_schema,json=reloadSchema,proto3" json:"reload_schema,omitempty"` + TabletAlias *topodata.TabletAlias `protobuf:"bytes,1,opt,name=tablet_alias,json=tabletAlias,proto3" json:"tablet_alias,omitempty"` + TabletHookRequest *tabletmanagerdata.ExecuteHookRequest `protobuf:"bytes,2,opt,name=tablet_hook_request,json=tabletHookRequest,proto3" json:"tablet_hook_request,omitempty"` } -func (x *ExecuteMultiFetchAsDBARequest) Reset() { - *x = ExecuteMultiFetchAsDBARequest{} +func (x *ExecuteHookRequest) Reset() { + *x = ExecuteHookRequest{} if protoimpl.UnsafeEnabled { mi := &file_vtctldata_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4127,13 +4113,13 @@ func (x *ExecuteMultiFetchAsDBARequest) Reset() { } } -func (x *ExecuteMultiFetchAsDBARequest) String() string { +func (x *ExecuteHookRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ExecuteMultiFetchAsDBARequest) ProtoMessage() {} +func (*ExecuteHookRequest) ProtoMessage() {} -func (x *ExecuteMultiFetchAsDBARequest) ProtoReflect() protoreflect.Message { +func (x *ExecuteHookRequest) ProtoReflect() protoreflect.Message { mi := &file_vtctldata_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4145,56 +4131,35 @@ func (x *ExecuteMultiFetchAsDBARequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ExecuteMultiFetchAsDBARequest.ProtoReflect.Descriptor instead. -func (*ExecuteMultiFetchAsDBARequest) Descriptor() ([]byte, []int) { +// Deprecated: Use ExecuteHookRequest.ProtoReflect.Descriptor instead. +func (*ExecuteHookRequest) Descriptor() ([]byte, []int) { return file_vtctldata_proto_rawDescGZIP(), []int{53} } -func (x *ExecuteMultiFetchAsDBARequest) GetTabletAlias() *topodata.TabletAlias { +func (x *ExecuteHookRequest) GetTabletAlias() *topodata.TabletAlias { if x != nil { return x.TabletAlias } return nil } -func (x *ExecuteMultiFetchAsDBARequest) GetSql() string { - if x != nil { - return x.Sql - } - return "" -} - -func (x *ExecuteMultiFetchAsDBARequest) GetMaxRows() int64 { - if x != nil { - return x.MaxRows - } - return 0 -} - -func (x *ExecuteMultiFetchAsDBARequest) GetDisableBinlogs() bool { - if x != nil { - return x.DisableBinlogs - } - return false -} - -func (x *ExecuteMultiFetchAsDBARequest) GetReloadSchema() bool { +func (x *ExecuteHookRequest) GetTabletHookRequest() *tabletmanagerdata.ExecuteHookRequest { if x != nil { - return x.ReloadSchema + return x.TabletHookRequest } - return false + return nil } -type ExecuteMultiFetchAsDBAResponse struct { +type ExecuteHookResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Results []*query.QueryResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` + HookResult *tabletmanagerdata.ExecuteHookResponse `protobuf:"bytes,1,opt,name=hook_result,json=hookResult,proto3" json:"hook_result,omitempty"` } -func (x *ExecuteMultiFetchAsDBAResponse) Reset() { - *x = ExecuteMultiFetchAsDBAResponse{} +func (x *ExecuteHookResponse) Reset() { + *x = ExecuteHookResponse{} if protoimpl.UnsafeEnabled { mi := &file_vtctldata_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4202,13 +4167,13 @@ func (x *ExecuteMultiFetchAsDBAResponse) Reset() { } } -func (x *ExecuteMultiFetchAsDBAResponse) String() string { +func (x *ExecuteHookResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ExecuteMultiFetchAsDBAResponse) ProtoMessage() {} +func (*ExecuteHookResponse) ProtoMessage() {} -func (x *ExecuteMultiFetchAsDBAResponse) ProtoReflect() protoreflect.Message { +func (x *ExecuteHookResponse) ProtoReflect() protoreflect.Message { mi := &file_vtctldata_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4220,29 +4185,43 @@ func (x *ExecuteMultiFetchAsDBAResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ExecuteMultiFetchAsDBAResponse.ProtoReflect.Descriptor instead. -func (*ExecuteMultiFetchAsDBAResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use ExecuteHookResponse.ProtoReflect.Descriptor instead. +func (*ExecuteHookResponse) Descriptor() ([]byte, []int) { return file_vtctldata_proto_rawDescGZIP(), []int{54} } -func (x *ExecuteMultiFetchAsDBAResponse) GetResults() []*query.QueryResult { +func (x *ExecuteHookResponse) GetHookResult() *tabletmanagerdata.ExecuteHookResponse { if x != nil { - return x.Results + return x.HookResult } return nil } -type ExecuteHookRequest struct { +type ExecuteMultiFetchAsDBARequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TabletAlias *topodata.TabletAlias `protobuf:"bytes,1,opt,name=tablet_alias,json=tabletAlias,proto3" json:"tablet_alias,omitempty"` - TabletHookRequest *tabletmanagerdata.ExecuteHookRequest `protobuf:"bytes,2,opt,name=tablet_hook_request,json=tabletHookRequest,proto3" json:"tablet_hook_request,omitempty"` + TabletAlias *topodata.TabletAlias `protobuf:"bytes,1,opt,name=tablet_alias,json=tabletAlias,proto3" json:"tablet_alias,omitempty"` + // SQL could have potentially multiple queries separated by semicolons. + Sql string `protobuf:"bytes,2,opt,name=sql,proto3" json:"sql,omitempty"` + // MaxRows is an optional parameter to limit the number of rows read into the + // QueryResult. Note that this does not apply a LIMIT to a query, just how + // many rows are read from the MySQL server on the tablet side. + // + // This field is optional. Specifying a non-positive value will use whatever + // default is configured in the VtctldService. + MaxRows int64 `protobuf:"varint,3,opt,name=max_rows,json=maxRows,proto3" json:"max_rows,omitempty"` + // DisableBinlogs instructs the tablet not to use binary logging when + // executing the query. + DisableBinlogs bool `protobuf:"varint,4,opt,name=disable_binlogs,json=disableBinlogs,proto3" json:"disable_binlogs,omitempty"` + // ReloadSchema instructs the tablet to reload its schema after executing the + // query. + ReloadSchema bool `protobuf:"varint,5,opt,name=reload_schema,json=reloadSchema,proto3" json:"reload_schema,omitempty"` } -func (x *ExecuteHookRequest) Reset() { - *x = ExecuteHookRequest{} +func (x *ExecuteMultiFetchAsDBARequest) Reset() { + *x = ExecuteMultiFetchAsDBARequest{} if protoimpl.UnsafeEnabled { mi := &file_vtctldata_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4250,13 +4229,13 @@ func (x *ExecuteHookRequest) Reset() { } } -func (x *ExecuteHookRequest) String() string { +func (x *ExecuteMultiFetchAsDBARequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ExecuteHookRequest) ProtoMessage() {} +func (*ExecuteMultiFetchAsDBARequest) ProtoMessage() {} -func (x *ExecuteHookRequest) ProtoReflect() protoreflect.Message { +func (x *ExecuteMultiFetchAsDBARequest) ProtoReflect() protoreflect.Message { mi := &file_vtctldata_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4268,35 +4247,56 @@ func (x *ExecuteHookRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ExecuteHookRequest.ProtoReflect.Descriptor instead. -func (*ExecuteHookRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use ExecuteMultiFetchAsDBARequest.ProtoReflect.Descriptor instead. +func (*ExecuteMultiFetchAsDBARequest) Descriptor() ([]byte, []int) { return file_vtctldata_proto_rawDescGZIP(), []int{55} } -func (x *ExecuteHookRequest) GetTabletAlias() *topodata.TabletAlias { +func (x *ExecuteMultiFetchAsDBARequest) GetTabletAlias() *topodata.TabletAlias { if x != nil { return x.TabletAlias } return nil } -func (x *ExecuteHookRequest) GetTabletHookRequest() *tabletmanagerdata.ExecuteHookRequest { +func (x *ExecuteMultiFetchAsDBARequest) GetSql() string { if x != nil { - return x.TabletHookRequest + return x.Sql } - return nil + return "" } -type ExecuteHookResponse struct { +func (x *ExecuteMultiFetchAsDBARequest) GetMaxRows() int64 { + if x != nil { + return x.MaxRows + } + return 0 +} + +func (x *ExecuteMultiFetchAsDBARequest) GetDisableBinlogs() bool { + if x != nil { + return x.DisableBinlogs + } + return false +} + +func (x *ExecuteMultiFetchAsDBARequest) GetReloadSchema() bool { + if x != nil { + return x.ReloadSchema + } + return false +} + +type ExecuteMultiFetchAsDBAResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - HookResult *tabletmanagerdata.ExecuteHookResponse `protobuf:"bytes,1,opt,name=hook_result,json=hookResult,proto3" json:"hook_result,omitempty"` + Results []*query.QueryResult `protobuf:"bytes,1,rep,name=results,proto3" json:"results,omitempty"` } -func (x *ExecuteHookResponse) Reset() { - *x = ExecuteHookResponse{} +func (x *ExecuteMultiFetchAsDBAResponse) Reset() { + *x = ExecuteMultiFetchAsDBAResponse{} if protoimpl.UnsafeEnabled { mi := &file_vtctldata_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4304,13 +4304,13 @@ func (x *ExecuteHookResponse) Reset() { } } -func (x *ExecuteHookResponse) String() string { +func (x *ExecuteMultiFetchAsDBAResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*ExecuteHookResponse) ProtoMessage() {} +func (*ExecuteMultiFetchAsDBAResponse) ProtoMessage() {} -func (x *ExecuteHookResponse) ProtoReflect() protoreflect.Message { +func (x *ExecuteMultiFetchAsDBAResponse) ProtoReflect() protoreflect.Message { mi := &file_vtctldata_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4322,14 +4322,14 @@ func (x *ExecuteHookResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use ExecuteHookResponse.ProtoReflect.Descriptor instead. -func (*ExecuteHookResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use ExecuteMultiFetchAsDBAResponse.ProtoReflect.Descriptor instead. +func (*ExecuteMultiFetchAsDBAResponse) Descriptor() ([]byte, []int) { return file_vtctldata_proto_rawDescGZIP(), []int{56} } -func (x *ExecuteHookResponse) GetHookResult() *tabletmanagerdata.ExecuteHookResponse { +func (x *ExecuteMultiFetchAsDBAResponse) GetResults() []*query.QueryResult { if x != nil { - return x.HookResult + return x.Results } return nil } @@ -16589,41 +16589,41 @@ var file_vtctldata_proto_rawDesc = []byte{ 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x22, 0xd4, 0x01, 0x0a, 0x1d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4d, 0x75, 0x6c, 0x74, - 0x69, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, 0x44, 0x42, 0x41, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, - 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, - 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x10, 0x0a, 0x03, - 0x73, 0x71, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x71, 0x6c, 0x12, 0x19, - 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x07, 0x6d, 0x61, 0x78, 0x52, 0x6f, 0x77, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x69, 0x6e, 0x6c, 0x6f, - 0x67, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x63, 0x68, - 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x72, 0x65, 0x6c, 0x6f, 0x61, - 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, 0x4e, 0x0a, 0x1e, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, 0x44, 0x42, - 0x41, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0xa5, 0x01, 0x0a, 0x12, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, - 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x0b, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x55, 0x0a, 0x13, 0x74, 0x61, 0x62, 0x6c, - 0x65, 0x74, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, - 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x11, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x74, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0x5e, 0x0a, 0x13, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0b, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, + 0x22, 0xa5, 0x01, 0x0a, 0x12, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, + 0x6c, 0x69, 0x61, 0x73, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, + 0x73, 0x12, 0x55, 0x0a, 0x13, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x68, 0x6f, 0x6f, 0x6b, + 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, + 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x11, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x48, 0x6f, 0x6f, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5e, 0x0a, 0x13, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x47, 0x0a, 0x0b, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, + 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x68, 0x6f, + 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xd4, 0x01, 0x0a, 0x1d, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x65, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, + 0x44, 0x42, 0x41, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, + 0x6c, 0x69, 0x61, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x71, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x73, 0x71, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x61, 0x78, 0x5f, 0x72, 0x6f, + 0x77, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6d, 0x61, 0x78, 0x52, 0x6f, 0x77, + 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x62, 0x69, 0x6e, + 0x6c, 0x6f, 0x67, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, + 0x62, 0x6c, 0x65, 0x42, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, + 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0c, 0x72, 0x65, 0x6c, 0x6f, 0x61, 0x64, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x22, + 0x4e, 0x0a, 0x1e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x46, + 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, 0x44, 0x42, 0x41, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x3c, 0x0a, 0x1e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x49, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, @@ -18210,10 +18210,10 @@ var file_vtctldata_proto_goTypes = []interface{}{ (*ExecuteFetchAsAppResponse)(nil), // 54: vtctldata.ExecuteFetchAsAppResponse (*ExecuteFetchAsDBARequest)(nil), // 55: vtctldata.ExecuteFetchAsDBARequest (*ExecuteFetchAsDBAResponse)(nil), // 56: vtctldata.ExecuteFetchAsDBAResponse - (*ExecuteMultiFetchAsDBARequest)(nil), // 57: vtctldata.ExecuteMultiFetchAsDBARequest - (*ExecuteMultiFetchAsDBAResponse)(nil), // 58: vtctldata.ExecuteMultiFetchAsDBAResponse - (*ExecuteHookRequest)(nil), // 59: vtctldata.ExecuteHookRequest - (*ExecuteHookResponse)(nil), // 60: vtctldata.ExecuteHookResponse + (*ExecuteHookRequest)(nil), // 57: vtctldata.ExecuteHookRequest + (*ExecuteHookResponse)(nil), // 58: vtctldata.ExecuteHookResponse + (*ExecuteMultiFetchAsDBARequest)(nil), // 59: vtctldata.ExecuteMultiFetchAsDBARequest + (*ExecuteMultiFetchAsDBAResponse)(nil), // 60: vtctldata.ExecuteMultiFetchAsDBAResponse (*FindAllShardsInKeyspaceRequest)(nil), // 61: vtctldata.FindAllShardsInKeyspaceRequest (*FindAllShardsInKeyspaceResponse)(nil), // 62: vtctldata.FindAllShardsInKeyspaceResponse (*ForceCutOverSchemaMigrationRequest)(nil), // 63: vtctldata.ForceCutOverSchemaMigrationRequest @@ -18527,11 +18527,11 @@ var file_vtctldata_proto_depIdxs = []int32{ 294, // 56: vtctldata.ExecuteFetchAsAppResponse.result:type_name -> query.QueryResult 283, // 57: vtctldata.ExecuteFetchAsDBARequest.tablet_alias:type_name -> topodata.TabletAlias 294, // 58: vtctldata.ExecuteFetchAsDBAResponse.result:type_name -> query.QueryResult - 283, // 59: vtctldata.ExecuteMultiFetchAsDBARequest.tablet_alias:type_name -> topodata.TabletAlias - 294, // 60: vtctldata.ExecuteMultiFetchAsDBAResponse.results:type_name -> query.QueryResult - 283, // 61: vtctldata.ExecuteHookRequest.tablet_alias:type_name -> topodata.TabletAlias - 295, // 62: vtctldata.ExecuteHookRequest.tablet_hook_request:type_name -> tabletmanagerdata.ExecuteHookRequest - 296, // 63: vtctldata.ExecuteHookResponse.hook_result:type_name -> tabletmanagerdata.ExecuteHookResponse + 283, // 59: vtctldata.ExecuteHookRequest.tablet_alias:type_name -> topodata.TabletAlias + 295, // 60: vtctldata.ExecuteHookRequest.tablet_hook_request:type_name -> tabletmanagerdata.ExecuteHookRequest + 296, // 61: vtctldata.ExecuteHookResponse.hook_result:type_name -> tabletmanagerdata.ExecuteHookResponse + 283, // 62: vtctldata.ExecuteMultiFetchAsDBARequest.tablet_alias:type_name -> topodata.TabletAlias + 294, // 63: vtctldata.ExecuteMultiFetchAsDBAResponse.results:type_name -> query.QueryResult 253, // 64: vtctldata.FindAllShardsInKeyspaceResponse.shards:type_name -> vtctldata.FindAllShardsInKeyspaceResponse.ShardsEntry 254, // 65: vtctldata.ForceCutOverSchemaMigrationResponse.rows_affected_by_shard:type_name -> vtctldata.ForceCutOverSchemaMigrationResponse.RowsAffectedByShardEntry 297, // 66: vtctldata.GetBackupsResponse.backups:type_name -> mysqlctl.BackupInfo @@ -19333,7 +19333,7 @@ func file_vtctldata_proto_init() { } } file_vtctldata_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteMultiFetchAsDBARequest); i { + switch v := v.(*ExecuteHookRequest); i { case 0: return &v.state case 1: @@ -19345,7 +19345,7 @@ func file_vtctldata_proto_init() { } } file_vtctldata_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteMultiFetchAsDBAResponse); i { + switch v := v.(*ExecuteHookResponse); i { case 0: return &v.state case 1: @@ -19357,7 +19357,7 @@ func file_vtctldata_proto_init() { } } file_vtctldata_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteHookRequest); i { + switch v := v.(*ExecuteMultiFetchAsDBARequest); i { case 0: return &v.state case 1: @@ -19369,7 +19369,7 @@ func file_vtctldata_proto_init() { } } file_vtctldata_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteHookResponse); i { + switch v := v.(*ExecuteMultiFetchAsDBAResponse); i { case 0: return &v.state case 1: diff --git a/go/vt/proto/vtctldata/vtctldata_vtproto.pb.go b/go/vt/proto/vtctldata/vtctldata_vtproto.pb.go index 0710a1c0a5a..1e027e237e1 100644 --- a/go/vt/proto/vtctldata/vtctldata_vtproto.pb.go +++ b/go/vt/proto/vtctldata/vtctldata_vtproto.pb.go @@ -1421,16 +1421,13 @@ func (m *ExecuteFetchAsDBAResponse) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *ExecuteMultiFetchAsDBARequest) CloneVT() *ExecuteMultiFetchAsDBARequest { +func (m *ExecuteHookRequest) CloneVT() *ExecuteHookRequest { if m == nil { - return (*ExecuteMultiFetchAsDBARequest)(nil) + return (*ExecuteHookRequest)(nil) } - r := &ExecuteMultiFetchAsDBARequest{ - TabletAlias: m.TabletAlias.CloneVT(), - Sql: m.Sql, - MaxRows: m.MaxRows, - DisableBinlogs: m.DisableBinlogs, - ReloadSchema: m.ReloadSchema, + r := &ExecuteHookRequest{ + TabletAlias: m.TabletAlias.CloneVT(), + TabletHookRequest: m.TabletHookRequest.CloneVT(), } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) @@ -1439,21 +1436,16 @@ func (m *ExecuteMultiFetchAsDBARequest) CloneVT() *ExecuteMultiFetchAsDBARequest return r } -func (m *ExecuteMultiFetchAsDBARequest) CloneMessageVT() proto.Message { +func (m *ExecuteHookRequest) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *ExecuteMultiFetchAsDBAResponse) CloneVT() *ExecuteMultiFetchAsDBAResponse { +func (m *ExecuteHookResponse) CloneVT() *ExecuteHookResponse { if m == nil { - return (*ExecuteMultiFetchAsDBAResponse)(nil) + return (*ExecuteHookResponse)(nil) } - r := &ExecuteMultiFetchAsDBAResponse{} - if rhs := m.Results; rhs != nil { - tmpContainer := make([]*query.QueryResult, len(rhs)) - for k, v := range rhs { - tmpContainer[k] = v.CloneVT() - } - r.Results = tmpContainer + r := &ExecuteHookResponse{ + HookResult: m.HookResult.CloneVT(), } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) @@ -1462,17 +1454,20 @@ func (m *ExecuteMultiFetchAsDBAResponse) CloneVT() *ExecuteMultiFetchAsDBARespon return r } -func (m *ExecuteMultiFetchAsDBAResponse) CloneMessageVT() proto.Message { +func (m *ExecuteHookResponse) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *ExecuteHookRequest) CloneVT() *ExecuteHookRequest { +func (m *ExecuteMultiFetchAsDBARequest) CloneVT() *ExecuteMultiFetchAsDBARequest { if m == nil { - return (*ExecuteHookRequest)(nil) + return (*ExecuteMultiFetchAsDBARequest)(nil) } - r := &ExecuteHookRequest{ - TabletAlias: m.TabletAlias.CloneVT(), - TabletHookRequest: m.TabletHookRequest.CloneVT(), + r := &ExecuteMultiFetchAsDBARequest{ + TabletAlias: m.TabletAlias.CloneVT(), + Sql: m.Sql, + MaxRows: m.MaxRows, + DisableBinlogs: m.DisableBinlogs, + ReloadSchema: m.ReloadSchema, } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) @@ -1481,16 +1476,21 @@ func (m *ExecuteHookRequest) CloneVT() *ExecuteHookRequest { return r } -func (m *ExecuteHookRequest) CloneMessageVT() proto.Message { +func (m *ExecuteMultiFetchAsDBARequest) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *ExecuteHookResponse) CloneVT() *ExecuteHookResponse { +func (m *ExecuteMultiFetchAsDBAResponse) CloneVT() *ExecuteMultiFetchAsDBAResponse { if m == nil { - return (*ExecuteHookResponse)(nil) + return (*ExecuteMultiFetchAsDBAResponse)(nil) } - r := &ExecuteHookResponse{ - HookResult: m.HookResult.CloneVT(), + r := &ExecuteMultiFetchAsDBAResponse{} + if rhs := m.Results; rhs != nil { + tmpContainer := make([]*query.QueryResult, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Results = tmpContainer } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) @@ -1499,7 +1499,7 @@ func (m *ExecuteHookResponse) CloneVT() *ExecuteHookResponse { return r } -func (m *ExecuteHookResponse) CloneMessageVT() proto.Message { +func (m *ExecuteMultiFetchAsDBAResponse) CloneMessageVT() proto.Message { return m.CloneVT() } @@ -9565,7 +9565,7 @@ func (m *ExecuteFetchAsDBAResponse) MarshalToSizedBufferVT(dAtA []byte) (int, er return len(dAtA) - i, nil } -func (m *ExecuteMultiFetchAsDBARequest) MarshalVT() (dAtA []byte, err error) { +func (m *ExecuteHookRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -9578,12 +9578,12 @@ func (m *ExecuteMultiFetchAsDBARequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ExecuteMultiFetchAsDBARequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *ExecuteHookRequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ExecuteMultiFetchAsDBARequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ExecuteHookRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -9595,35 +9595,13 @@ func (m *ExecuteMultiFetchAsDBARequest) MarshalToSizedBufferVT(dAtA []byte) (int i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.ReloadSchema { - i-- - if m.ReloadSchema { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.DisableBinlogs { - i-- - if m.DisableBinlogs { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if m.TabletHookRequest != nil { + size, err := m.TabletHookRequest.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x20 - } - if m.MaxRows != 0 { - i = encodeVarint(dAtA, i, uint64(m.MaxRows)) - i-- - dAtA[i] = 0x18 - } - if len(m.Sql) > 0 { - i -= len(m.Sql) - copy(dAtA[i:], m.Sql) - i = encodeVarint(dAtA, i, uint64(len(m.Sql))) + i -= size + i = encodeVarint(dAtA, i, uint64(size)) i-- dAtA[i] = 0x12 } @@ -9640,7 +9618,7 @@ func (m *ExecuteMultiFetchAsDBARequest) MarshalToSizedBufferVT(dAtA []byte) (int return len(dAtA) - i, nil } -func (m *ExecuteMultiFetchAsDBAResponse) MarshalVT() (dAtA []byte, err error) { +func (m *ExecuteHookResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -9653,12 +9631,12 @@ func (m *ExecuteMultiFetchAsDBAResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ExecuteMultiFetchAsDBAResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *ExecuteHookResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ExecuteMultiFetchAsDBAResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ExecuteHookResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -9670,22 +9648,20 @@ func (m *ExecuteMultiFetchAsDBAResponse) MarshalToSizedBufferVT(dAtA []byte) (in i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if len(m.Results) > 0 { - for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Results[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0xa + if m.HookResult != nil { + size, err := m.HookResult.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *ExecuteHookRequest) MarshalVT() (dAtA []byte, err error) { +func (m *ExecuteMultiFetchAsDBARequest) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -9698,12 +9674,12 @@ func (m *ExecuteHookRequest) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ExecuteHookRequest) MarshalToVT(dAtA []byte) (int, error) { +func (m *ExecuteMultiFetchAsDBARequest) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ExecuteHookRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ExecuteMultiFetchAsDBARequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -9715,13 +9691,35 @@ func (m *ExecuteHookRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.TabletHookRequest != nil { - size, err := m.TabletHookRequest.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err + if m.ReloadSchema { + i-- + if m.ReloadSchema { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x28 + } + if m.DisableBinlogs { + i-- + if m.DisableBinlogs { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.MaxRows != 0 { + i = encodeVarint(dAtA, i, uint64(m.MaxRows)) + i-- + dAtA[i] = 0x18 + } + if len(m.Sql) > 0 { + i -= len(m.Sql) + copy(dAtA[i:], m.Sql) + i = encodeVarint(dAtA, i, uint64(len(m.Sql))) i-- dAtA[i] = 0x12 } @@ -9738,7 +9736,7 @@ func (m *ExecuteHookRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *ExecuteHookResponse) MarshalVT() (dAtA []byte, err error) { +func (m *ExecuteMultiFetchAsDBAResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -9751,12 +9749,12 @@ func (m *ExecuteHookResponse) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *ExecuteHookResponse) MarshalToVT(dAtA []byte) (int, error) { +func (m *ExecuteMultiFetchAsDBAResponse) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *ExecuteHookResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *ExecuteMultiFetchAsDBAResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -9768,15 +9766,17 @@ func (m *ExecuteHookResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.HookResult != nil { - size, err := m.HookResult.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err + if len(m.Results) > 0 { + for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Results[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -21455,7 +21455,7 @@ func (m *ExecuteFetchAsDBAResponse) SizeVT() (n int) { return n } -func (m *ExecuteMultiFetchAsDBARequest) SizeVT() (n int) { +func (m *ExecuteHookRequest) SizeVT() (n int) { if m == nil { return 0 } @@ -21465,40 +21465,29 @@ func (m *ExecuteMultiFetchAsDBARequest) SizeVT() (n int) { l = m.TabletAlias.SizeVT() n += 1 + l + sov(uint64(l)) } - l = len(m.Sql) - if l > 0 { + if m.TabletHookRequest != nil { + l = m.TabletHookRequest.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.MaxRows != 0 { - n += 1 + sov(uint64(m.MaxRows)) - } - if m.DisableBinlogs { - n += 2 - } - if m.ReloadSchema { - n += 2 - } n += len(m.unknownFields) return n } -func (m *ExecuteMultiFetchAsDBAResponse) SizeVT() (n int) { +func (m *ExecuteHookResponse) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Results) > 0 { - for _, e := range m.Results { - l = e.SizeVT() - n += 1 + l + sov(uint64(l)) - } + if m.HookResult != nil { + l = m.HookResult.SizeVT() + n += 1 + l + sov(uint64(l)) } n += len(m.unknownFields) return n } -func (m *ExecuteHookRequest) SizeVT() (n int) { +func (m *ExecuteMultiFetchAsDBARequest) SizeVT() (n int) { if m == nil { return 0 } @@ -21508,23 +21497,34 @@ func (m *ExecuteHookRequest) SizeVT() (n int) { l = m.TabletAlias.SizeVT() n += 1 + l + sov(uint64(l)) } - if m.TabletHookRequest != nil { - l = m.TabletHookRequest.SizeVT() + l = len(m.Sql) + if l > 0 { n += 1 + l + sov(uint64(l)) } + if m.MaxRows != 0 { + n += 1 + sov(uint64(m.MaxRows)) + } + if m.DisableBinlogs { + n += 2 + } + if m.ReloadSchema { + n += 2 + } n += len(m.unknownFields) return n } -func (m *ExecuteHookResponse) SizeVT() (n int) { +func (m *ExecuteMultiFetchAsDBAResponse) SizeVT() (n int) { if m == nil { return 0 } var l int _ = l - if m.HookResult != nil { - l = m.HookResult.SizeVT() - n += 1 + l + sov(uint64(l)) + if len(m.Results) > 0 { + for _, e := range m.Results { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } } n += len(m.unknownFields) return n @@ -35902,7 +35902,7 @@ func (m *ExecuteFetchAsDBAResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *ExecuteMultiFetchAsDBARequest) UnmarshalVT(dAtA []byte) error { +func (m *ExecuteHookRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -35925,10 +35925,10 @@ func (m *ExecuteMultiFetchAsDBARequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ExecuteMultiFetchAsDBARequest: wiretype end group for non-group") + return fmt.Errorf("proto: ExecuteHookRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ExecuteMultiFetchAsDBARequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ExecuteHookRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -35969,9 +35969,9 @@ func (m *ExecuteMultiFetchAsDBARequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sql", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TabletHookRequest", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -35981,83 +35981,28 @@ func (m *ExecuteMultiFetchAsDBARequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Sql = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxRows", wireType) - } - m.MaxRows = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxRows |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field DisableBinlogs", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.DisableBinlogs = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ReloadSchema", wireType) + if m.TabletHookRequest == nil { + m.TabletHookRequest = &tabletmanagerdata.ExecuteHookRequest{} } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } + if err := m.TabletHookRequest.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.ReloadSchema = bool(v != 0) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -36080,7 +36025,7 @@ func (m *ExecuteMultiFetchAsDBARequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *ExecuteMultiFetchAsDBAResponse) UnmarshalVT(dAtA []byte) error { +func (m *ExecuteHookResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -36103,15 +36048,15 @@ func (m *ExecuteMultiFetchAsDBAResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ExecuteMultiFetchAsDBAResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ExecuteHookResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ExecuteMultiFetchAsDBAResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ExecuteHookResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field HookResult", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -36138,8 +36083,10 @@ func (m *ExecuteMultiFetchAsDBAResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Results = append(m.Results, &query.QueryResult{}) - if err := m.Results[len(m.Results)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if m.HookResult == nil { + m.HookResult = &tabletmanagerdata.ExecuteHookResponse{} + } + if err := m.HookResult.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -36165,7 +36112,7 @@ func (m *ExecuteMultiFetchAsDBAResponse) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *ExecuteHookRequest) UnmarshalVT(dAtA []byte) error { +func (m *ExecuteMultiFetchAsDBARequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -36188,10 +36135,10 @@ func (m *ExecuteHookRequest) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ExecuteHookRequest: wiretype end group for non-group") + return fmt.Errorf("proto: ExecuteMultiFetchAsDBARequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ExecuteHookRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ExecuteMultiFetchAsDBARequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -36232,9 +36179,9 @@ func (m *ExecuteHookRequest) UnmarshalVT(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TabletHookRequest", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Sql", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -36244,28 +36191,83 @@ func (m *ExecuteHookRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if m.TabletHookRequest == nil { - m.TabletHookRequest = &tabletmanagerdata.ExecuteHookRequest{} + m.Sql = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxRows", wireType) } - if err := m.TabletHookRequest.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err + m.MaxRows = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxRows |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableBinlogs", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableBinlogs = bool(v != 0) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReloadSchema", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ReloadSchema = bool(v != 0) default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -36288,7 +36290,7 @@ func (m *ExecuteHookRequest) UnmarshalVT(dAtA []byte) error { } return nil } -func (m *ExecuteHookResponse) UnmarshalVT(dAtA []byte) error { +func (m *ExecuteMultiFetchAsDBAResponse) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -36311,15 +36313,15 @@ func (m *ExecuteHookResponse) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ExecuteHookResponse: wiretype end group for non-group") + return fmt.Errorf("proto: ExecuteMultiFetchAsDBAResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ExecuteHookResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ExecuteMultiFetchAsDBAResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HookResult", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -36346,10 +36348,8 @@ func (m *ExecuteHookResponse) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.HookResult == nil { - m.HookResult = &tabletmanagerdata.ExecuteHookResponse{} - } - if err := m.HookResult.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + m.Results = append(m.Results, &query.QueryResult{}) + if err := m.Results[len(m.Results)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/go/vt/proto/vtctlservice/vtctlservice.pb.go b/go/vt/proto/vtctlservice/vtctlservice.pb.go index 924cbfc14d8..2e05d9455c9 100644 --- a/go/vt/proto/vtctlservice/vtctlservice.pb.go +++ b/go/vt/proto/vtctlservice/vtctlservice.pb.go @@ -185,19 +185,19 @@ var file_vtctlservice_proto_rawDesc = []byte{ 0x63, 0x68, 0x41, 0x73, 0x44, 0x42, 0x41, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, 0x44, 0x42, 0x41, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x6f, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x65, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, 0x44, 0x42, 0x41, - 0x12, 0x28, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x65, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, - 0x44, 0x42, 0x41, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x76, 0x74, 0x63, - 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4d, 0x75, - 0x6c, 0x74, 0x69, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, 0x44, 0x42, 0x41, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0b, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x1d, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, - 0x74, 0x61, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, - 0x61, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x72, 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0b, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x12, 0x1d, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, + 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x16, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4d, + 0x75, 0x6c, 0x74, 0x69, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, 0x44, 0x42, 0x41, 0x12, 0x28, + 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x65, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, 0x44, 0x42, + 0x41, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, + 0x64, 0x61, 0x74, 0x61, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4d, 0x75, 0x6c, 0x74, + 0x69, 0x46, 0x65, 0x74, 0x63, 0x68, 0x41, 0x73, 0x44, 0x42, 0x41, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x72, 0x0a, 0x17, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x49, 0x6e, 0x4b, 0x65, 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x29, 0x2e, 0x76, 0x74, 0x63, 0x74, 0x6c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x53, 0x68, 0x61, 0x72, 0x64, 0x73, 0x49, 0x6e, 0x4b, 0x65, 0x79, 0x73, @@ -745,8 +745,8 @@ var file_vtctlservice_proto_goTypes = []interface{}{ (*vtctldata.EmergencyReparentShardRequest)(nil), // 21: vtctldata.EmergencyReparentShardRequest (*vtctldata.ExecuteFetchAsAppRequest)(nil), // 22: vtctldata.ExecuteFetchAsAppRequest (*vtctldata.ExecuteFetchAsDBARequest)(nil), // 23: vtctldata.ExecuteFetchAsDBARequest - (*vtctldata.ExecuteMultiFetchAsDBARequest)(nil), // 24: vtctldata.ExecuteMultiFetchAsDBARequest - (*vtctldata.ExecuteHookRequest)(nil), // 25: vtctldata.ExecuteHookRequest + (*vtctldata.ExecuteHookRequest)(nil), // 24: vtctldata.ExecuteHookRequest + (*vtctldata.ExecuteMultiFetchAsDBARequest)(nil), // 25: vtctldata.ExecuteMultiFetchAsDBARequest (*vtctldata.FindAllShardsInKeyspaceRequest)(nil), // 26: vtctldata.FindAllShardsInKeyspaceRequest (*vtctldata.ForceCutOverSchemaMigrationRequest)(nil), // 27: vtctldata.ForceCutOverSchemaMigrationRequest (*vtctldata.GetBackupsRequest)(nil), // 28: vtctldata.GetBackupsRequest @@ -858,8 +858,8 @@ var file_vtctlservice_proto_goTypes = []interface{}{ (*vtctldata.EmergencyReparentShardResponse)(nil), // 134: vtctldata.EmergencyReparentShardResponse (*vtctldata.ExecuteFetchAsAppResponse)(nil), // 135: vtctldata.ExecuteFetchAsAppResponse (*vtctldata.ExecuteFetchAsDBAResponse)(nil), // 136: vtctldata.ExecuteFetchAsDBAResponse - (*vtctldata.ExecuteMultiFetchAsDBAResponse)(nil), // 137: vtctldata.ExecuteMultiFetchAsDBAResponse - (*vtctldata.ExecuteHookResponse)(nil), // 138: vtctldata.ExecuteHookResponse + (*vtctldata.ExecuteHookResponse)(nil), // 137: vtctldata.ExecuteHookResponse + (*vtctldata.ExecuteMultiFetchAsDBAResponse)(nil), // 138: vtctldata.ExecuteMultiFetchAsDBAResponse (*vtctldata.FindAllShardsInKeyspaceResponse)(nil), // 139: vtctldata.FindAllShardsInKeyspaceResponse (*vtctldata.ForceCutOverSchemaMigrationResponse)(nil), // 140: vtctldata.ForceCutOverSchemaMigrationResponse (*vtctldata.GetBackupsResponse)(nil), // 141: vtctldata.GetBackupsResponse @@ -971,8 +971,8 @@ var file_vtctlservice_proto_depIdxs = []int32{ 21, // 21: vtctlservice.Vtctld.EmergencyReparentShard:input_type -> vtctldata.EmergencyReparentShardRequest 22, // 22: vtctlservice.Vtctld.ExecuteFetchAsApp:input_type -> vtctldata.ExecuteFetchAsAppRequest 23, // 23: vtctlservice.Vtctld.ExecuteFetchAsDBA:input_type -> vtctldata.ExecuteFetchAsDBARequest - 24, // 24: vtctlservice.Vtctld.ExecuteMultiFetchAsDBA:input_type -> vtctldata.ExecuteMultiFetchAsDBARequest - 25, // 25: vtctlservice.Vtctld.ExecuteHook:input_type -> vtctldata.ExecuteHookRequest + 24, // 24: vtctlservice.Vtctld.ExecuteHook:input_type -> vtctldata.ExecuteHookRequest + 25, // 25: vtctlservice.Vtctld.ExecuteMultiFetchAsDBA:input_type -> vtctldata.ExecuteMultiFetchAsDBARequest 26, // 26: vtctlservice.Vtctld.FindAllShardsInKeyspace:input_type -> vtctldata.FindAllShardsInKeyspaceRequest 27, // 27: vtctlservice.Vtctld.ForceCutOverSchemaMigration:input_type -> vtctldata.ForceCutOverSchemaMigrationRequest 28, // 28: vtctlservice.Vtctld.GetBackups:input_type -> vtctldata.GetBackupsRequest @@ -1085,8 +1085,8 @@ var file_vtctlservice_proto_depIdxs = []int32{ 134, // 135: vtctlservice.Vtctld.EmergencyReparentShard:output_type -> vtctldata.EmergencyReparentShardResponse 135, // 136: vtctlservice.Vtctld.ExecuteFetchAsApp:output_type -> vtctldata.ExecuteFetchAsAppResponse 136, // 137: vtctlservice.Vtctld.ExecuteFetchAsDBA:output_type -> vtctldata.ExecuteFetchAsDBAResponse - 137, // 138: vtctlservice.Vtctld.ExecuteMultiFetchAsDBA:output_type -> vtctldata.ExecuteMultiFetchAsDBAResponse - 138, // 139: vtctlservice.Vtctld.ExecuteHook:output_type -> vtctldata.ExecuteHookResponse + 137, // 138: vtctlservice.Vtctld.ExecuteHook:output_type -> vtctldata.ExecuteHookResponse + 138, // 139: vtctlservice.Vtctld.ExecuteMultiFetchAsDBA:output_type -> vtctldata.ExecuteMultiFetchAsDBAResponse 139, // 140: vtctlservice.Vtctld.FindAllShardsInKeyspace:output_type -> vtctldata.FindAllShardsInKeyspaceResponse 140, // 141: vtctlservice.Vtctld.ForceCutOverSchemaMigration:output_type -> vtctldata.ForceCutOverSchemaMigrationResponse 141, // 142: vtctlservice.Vtctld.GetBackups:output_type -> vtctldata.GetBackupsResponse diff --git a/go/vt/proto/vtctlservice/vtctlservice_grpc.pb.go b/go/vt/proto/vtctlservice/vtctlservice_grpc.pb.go index d0fd7867604..b369a41b1f1 100644 --- a/go/vt/proto/vtctlservice/vtctlservice_grpc.pb.go +++ b/go/vt/proto/vtctlservice/vtctlservice_grpc.pb.go @@ -203,10 +203,10 @@ type VtctldClient interface { ExecuteFetchAsApp(ctx context.Context, in *vtctldata.ExecuteFetchAsAppRequest, opts ...grpc.CallOption) (*vtctldata.ExecuteFetchAsAppResponse, error) // ExecuteFetchAsDBA executes a SQL query on the remote tablet as the DBA user. ExecuteFetchAsDBA(ctx context.Context, in *vtctldata.ExecuteFetchAsDBARequest, opts ...grpc.CallOption) (*vtctldata.ExecuteFetchAsDBAResponse, error) - // ExecuteMultiFetchAsDBA executes one or more SQL queries on the remote tablet as the DBA user. - ExecuteMultiFetchAsDBA(ctx context.Context, in *vtctldata.ExecuteMultiFetchAsDBARequest, opts ...grpc.CallOption) (*vtctldata.ExecuteMultiFetchAsDBAResponse, error) // ExecuteHook runs the hook on the tablet. ExecuteHook(ctx context.Context, in *vtctldata.ExecuteHookRequest, opts ...grpc.CallOption) (*vtctldata.ExecuteHookResponse, error) + // ExecuteMultiFetchAsDBA executes one or more SQL queries on the remote tablet as the DBA user. + ExecuteMultiFetchAsDBA(ctx context.Context, in *vtctldata.ExecuteMultiFetchAsDBARequest, opts ...grpc.CallOption) (*vtctldata.ExecuteMultiFetchAsDBAResponse, error) // FindAllShardsInKeyspace returns a map of shard names to shard references // for a given keyspace. FindAllShardsInKeyspace(ctx context.Context, in *vtctldata.FindAllShardsInKeyspaceRequest, opts ...grpc.CallOption) (*vtctldata.FindAllShardsInKeyspaceResponse, error) @@ -719,18 +719,18 @@ func (c *vtctldClient) ExecuteFetchAsDBA(ctx context.Context, in *vtctldata.Exec return out, nil } -func (c *vtctldClient) ExecuteMultiFetchAsDBA(ctx context.Context, in *vtctldata.ExecuteMultiFetchAsDBARequest, opts ...grpc.CallOption) (*vtctldata.ExecuteMultiFetchAsDBAResponse, error) { - out := new(vtctldata.ExecuteMultiFetchAsDBAResponse) - err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/ExecuteMultiFetchAsDBA", in, out, opts...) +func (c *vtctldClient) ExecuteHook(ctx context.Context, in *vtctldata.ExecuteHookRequest, opts ...grpc.CallOption) (*vtctldata.ExecuteHookResponse, error) { + out := new(vtctldata.ExecuteHookResponse) + err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/ExecuteHook", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *vtctldClient) ExecuteHook(ctx context.Context, in *vtctldata.ExecuteHookRequest, opts ...grpc.CallOption) (*vtctldata.ExecuteHookResponse, error) { - out := new(vtctldata.ExecuteHookResponse) - err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/ExecuteHook", in, out, opts...) +func (c *vtctldClient) ExecuteMultiFetchAsDBA(ctx context.Context, in *vtctldata.ExecuteMultiFetchAsDBARequest, opts ...grpc.CallOption) (*vtctldata.ExecuteMultiFetchAsDBAResponse, error) { + out := new(vtctldata.ExecuteMultiFetchAsDBAResponse) + err := c.cc.Invoke(ctx, "/vtctlservice.Vtctld/ExecuteMultiFetchAsDBA", in, out, opts...) if err != nil { return nil, err } @@ -1623,10 +1623,10 @@ type VtctldServer interface { ExecuteFetchAsApp(context.Context, *vtctldata.ExecuteFetchAsAppRequest) (*vtctldata.ExecuteFetchAsAppResponse, error) // ExecuteFetchAsDBA executes a SQL query on the remote tablet as the DBA user. ExecuteFetchAsDBA(context.Context, *vtctldata.ExecuteFetchAsDBARequest) (*vtctldata.ExecuteFetchAsDBAResponse, error) - // ExecuteMultiFetchAsDBA executes one or more SQL queries on the remote tablet as the DBA user. - ExecuteMultiFetchAsDBA(context.Context, *vtctldata.ExecuteMultiFetchAsDBARequest) (*vtctldata.ExecuteMultiFetchAsDBAResponse, error) // ExecuteHook runs the hook on the tablet. ExecuteHook(context.Context, *vtctldata.ExecuteHookRequest) (*vtctldata.ExecuteHookResponse, error) + // ExecuteMultiFetchAsDBA executes one or more SQL queries on the remote tablet as the DBA user. + ExecuteMultiFetchAsDBA(context.Context, *vtctldata.ExecuteMultiFetchAsDBARequest) (*vtctldata.ExecuteMultiFetchAsDBAResponse, error) // FindAllShardsInKeyspace returns a map of shard names to shard references // for a given keyspace. FindAllShardsInKeyspace(context.Context, *vtctldata.FindAllShardsInKeyspaceRequest) (*vtctldata.FindAllShardsInKeyspaceResponse, error) @@ -1952,12 +1952,12 @@ func (UnimplementedVtctldServer) ExecuteFetchAsApp(context.Context, *vtctldata.E func (UnimplementedVtctldServer) ExecuteFetchAsDBA(context.Context, *vtctldata.ExecuteFetchAsDBARequest) (*vtctldata.ExecuteFetchAsDBAResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ExecuteFetchAsDBA not implemented") } -func (UnimplementedVtctldServer) ExecuteMultiFetchAsDBA(context.Context, *vtctldata.ExecuteMultiFetchAsDBARequest) (*vtctldata.ExecuteMultiFetchAsDBAResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExecuteMultiFetchAsDBA not implemented") -} func (UnimplementedVtctldServer) ExecuteHook(context.Context, *vtctldata.ExecuteHookRequest) (*vtctldata.ExecuteHookResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ExecuteHook not implemented") } +func (UnimplementedVtctldServer) ExecuteMultiFetchAsDBA(context.Context, *vtctldata.ExecuteMultiFetchAsDBARequest) (*vtctldata.ExecuteMultiFetchAsDBAResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExecuteMultiFetchAsDBA not implemented") +} func (UnimplementedVtctldServer) FindAllShardsInKeyspace(context.Context, *vtctldata.FindAllShardsInKeyspaceRequest) (*vtctldata.FindAllShardsInKeyspaceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method FindAllShardsInKeyspace not implemented") } @@ -2655,38 +2655,38 @@ func _Vtctld_ExecuteFetchAsDBA_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _Vtctld_ExecuteMultiFetchAsDBA_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(vtctldata.ExecuteMultiFetchAsDBARequest) +func _Vtctld_ExecuteHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(vtctldata.ExecuteHookRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(VtctldServer).ExecuteMultiFetchAsDBA(ctx, in) + return srv.(VtctldServer).ExecuteHook(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/vtctlservice.Vtctld/ExecuteMultiFetchAsDBA", + FullMethod: "/vtctlservice.Vtctld/ExecuteHook", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VtctldServer).ExecuteMultiFetchAsDBA(ctx, req.(*vtctldata.ExecuteMultiFetchAsDBARequest)) + return srv.(VtctldServer).ExecuteHook(ctx, req.(*vtctldata.ExecuteHookRequest)) } return interceptor(ctx, in, info, handler) } -func _Vtctld_ExecuteHook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(vtctldata.ExecuteHookRequest) +func _Vtctld_ExecuteMultiFetchAsDBA_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(vtctldata.ExecuteMultiFetchAsDBARequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(VtctldServer).ExecuteHook(ctx, in) + return srv.(VtctldServer).ExecuteMultiFetchAsDBA(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/vtctlservice.Vtctld/ExecuteHook", + FullMethod: "/vtctlservice.Vtctld/ExecuteMultiFetchAsDBA", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VtctldServer).ExecuteHook(ctx, req.(*vtctldata.ExecuteHookRequest)) + return srv.(VtctldServer).ExecuteMultiFetchAsDBA(ctx, req.(*vtctldata.ExecuteMultiFetchAsDBARequest)) } return interceptor(ctx, in, info, handler) } @@ -4369,14 +4369,14 @@ var Vtctld_ServiceDesc = grpc.ServiceDesc{ MethodName: "ExecuteFetchAsDBA", Handler: _Vtctld_ExecuteFetchAsDBA_Handler, }, - { - MethodName: "ExecuteMultiFetchAsDBA", - Handler: _Vtctld_ExecuteMultiFetchAsDBA_Handler, - }, { MethodName: "ExecuteHook", Handler: _Vtctld_ExecuteHook_Handler, }, + { + MethodName: "ExecuteMultiFetchAsDBA", + Handler: _Vtctld_ExecuteMultiFetchAsDBA_Handler, + }, { MethodName: "FindAllShardsInKeyspace", Handler: _Vtctld_FindAllShardsInKeyspace_Handler, diff --git a/go/vt/vtctl/grpcvtctldclient/client_gen.go b/go/vt/vtctl/grpcvtctldclient/client_gen.go index fc38a232095..78825e666b7 100644 --- a/go/vt/vtctl/grpcvtctldclient/client_gen.go +++ b/go/vt/vtctl/grpcvtctldclient/client_gen.go @@ -236,22 +236,22 @@ func (client *gRPCVtctldClient) ExecuteFetchAsDBA(ctx context.Context, in *vtctl return client.c.ExecuteFetchAsDBA(ctx, in, opts...) } -// ExecuteMultiFetchAsDBA is part of the vtctlservicepb.VtctldClient interface. -func (client *gRPCVtctldClient) ExecuteMultiFetchAsDBA(ctx context.Context, in *vtctldatapb.ExecuteMultiFetchAsDBARequest, opts ...grpc.CallOption) (*vtctldatapb.ExecuteMultiFetchAsDBAResponse, error) { +// ExecuteHook is part of the vtctlservicepb.VtctldClient interface. +func (client *gRPCVtctldClient) ExecuteHook(ctx context.Context, in *vtctldatapb.ExecuteHookRequest, opts ...grpc.CallOption) (*vtctldatapb.ExecuteHookResponse, error) { if client.c == nil { return nil, status.Error(codes.Unavailable, connClosedMsg) } - return client.c.ExecuteMultiFetchAsDBA(ctx, in, opts...) + return client.c.ExecuteHook(ctx, in, opts...) } -// ExecuteHook is part of the vtctlservicepb.VtctldClient interface. -func (client *gRPCVtctldClient) ExecuteHook(ctx context.Context, in *vtctldatapb.ExecuteHookRequest, opts ...grpc.CallOption) (*vtctldatapb.ExecuteHookResponse, error) { +// ExecuteMultiFetchAsDBA is part of the vtctlservicepb.VtctldClient interface. +func (client *gRPCVtctldClient) ExecuteMultiFetchAsDBA(ctx context.Context, in *vtctldatapb.ExecuteMultiFetchAsDBARequest, opts ...grpc.CallOption) (*vtctldatapb.ExecuteMultiFetchAsDBAResponse, error) { if client.c == nil { return nil, status.Error(codes.Unavailable, connClosedMsg) } - return client.c.ExecuteHook(ctx, in, opts...) + return client.c.ExecuteMultiFetchAsDBA(ctx, in, opts...) } // FindAllShardsInKeyspace is part of the vtctlservicepb.VtctldClient interface. diff --git a/go/vt/vtctl/localvtctldclient/client_gen.go b/go/vt/vtctl/localvtctldclient/client_gen.go index 564ecc99eb3..ecd4b8b7efd 100644 --- a/go/vt/vtctl/localvtctldclient/client_gen.go +++ b/go/vt/vtctl/localvtctldclient/client_gen.go @@ -236,16 +236,16 @@ func (client *localVtctldClient) ExecuteFetchAsDBA(ctx context.Context, in *vtct return client.s.ExecuteFetchAsDBA(ctx, in) } -// ExecuteMultiFetchAsDBA is part of the vtctlservicepb.VtctldClient interface. -func (client *localVtctldClient) ExecuteMultiFetchAsDBA(ctx context.Context, in *vtctldatapb.ExecuteMultiFetchAsDBARequest, opts ...grpc.CallOption) (*vtctldatapb.ExecuteMultiFetchAsDBAResponse, error) { - return client.s.ExecuteMultiFetchAsDBA(ctx, in) -} - // ExecuteHook is part of the vtctlservicepb.VtctldClient interface. func (client *localVtctldClient) ExecuteHook(ctx context.Context, in *vtctldatapb.ExecuteHookRequest, opts ...grpc.CallOption) (*vtctldatapb.ExecuteHookResponse, error) { return client.s.ExecuteHook(ctx, in) } +// ExecuteMultiFetchAsDBA is part of the vtctlservicepb.VtctldClient interface. +func (client *localVtctldClient) ExecuteMultiFetchAsDBA(ctx context.Context, in *vtctldatapb.ExecuteMultiFetchAsDBARequest, opts ...grpc.CallOption) (*vtctldatapb.ExecuteMultiFetchAsDBAResponse, error) { + return client.s.ExecuteMultiFetchAsDBA(ctx, in) +} + // FindAllShardsInKeyspace is part of the vtctlservicepb.VtctldClient interface. func (client *localVtctldClient) FindAllShardsInKeyspace(ctx context.Context, in *vtctldatapb.FindAllShardsInKeyspaceRequest, opts ...grpc.CallOption) (*vtctldatapb.FindAllShardsInKeyspaceResponse, error) { return client.s.FindAllShardsInKeyspace(ctx, in) diff --git a/proto/vtctldata.proto b/proto/vtctldata.proto index 4b496838f4b..5f6b78bdd92 100644 --- a/proto/vtctldata.proto +++ b/proto/vtctldata.proto @@ -683,6 +683,15 @@ message ExecuteFetchAsDBAResponse { query.QueryResult result = 1; } +message ExecuteHookRequest { + topodata.TabletAlias tablet_alias = 1; + tabletmanagerdata.ExecuteHookRequest tablet_hook_request = 2; +} + +message ExecuteHookResponse { + tabletmanagerdata.ExecuteHookResponse hook_result = 1; +} + message ExecuteMultiFetchAsDBARequest { topodata.TabletAlias tablet_alias = 1; // SQL could have potentially multiple queries separated by semicolons. @@ -706,15 +715,6 @@ message ExecuteMultiFetchAsDBAResponse { repeated query.QueryResult results = 1; } -message ExecuteHookRequest { - topodata.TabletAlias tablet_alias = 1; - tabletmanagerdata.ExecuteHookRequest tablet_hook_request = 2; -} - -message ExecuteHookResponse { - tabletmanagerdata.ExecuteHookResponse hook_result = 1; -} - message FindAllShardsInKeyspaceRequest { string keyspace = 1; } diff --git a/proto/vtctlservice.proto b/proto/vtctlservice.proto index a079d21598b..6307150f669 100644 --- a/proto/vtctlservice.proto +++ b/proto/vtctlservice.proto @@ -98,10 +98,10 @@ service Vtctld { rpc ExecuteFetchAsApp(vtctldata.ExecuteFetchAsAppRequest) returns (vtctldata.ExecuteFetchAsAppResponse) {}; // ExecuteFetchAsDBA executes a SQL query on the remote tablet as the DBA user. rpc ExecuteFetchAsDBA(vtctldata.ExecuteFetchAsDBARequest) returns (vtctldata.ExecuteFetchAsDBAResponse) {}; - // ExecuteMultiFetchAsDBA executes one or more SQL queries on the remote tablet as the DBA user. - rpc ExecuteMultiFetchAsDBA(vtctldata.ExecuteMultiFetchAsDBARequest) returns (vtctldata.ExecuteMultiFetchAsDBAResponse) {}; // ExecuteHook runs the hook on the tablet. rpc ExecuteHook(vtctldata.ExecuteHookRequest) returns (vtctldata.ExecuteHookResponse); + // ExecuteMultiFetchAsDBA executes one or more SQL queries on the remote tablet as the DBA user. + rpc ExecuteMultiFetchAsDBA(vtctldata.ExecuteMultiFetchAsDBARequest) returns (vtctldata.ExecuteMultiFetchAsDBAResponse) {}; // FindAllShardsInKeyspace returns a map of shard names to shard references // for a given keyspace. rpc FindAllShardsInKeyspace(vtctldata.FindAllShardsInKeyspaceRequest) returns (vtctldata.FindAllShardsInKeyspaceResponse) {}; diff --git a/web/vtadmin/src/proto/vtadmin.d.ts b/web/vtadmin/src/proto/vtadmin.d.ts index 627dc4824ad..93248bec5d3 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -50833,418 +50833,418 @@ export namespace vtctldata { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ExecuteMultiFetchAsDBARequest. */ - interface IExecuteMultiFetchAsDBARequest { + /** Properties of an ExecuteHookRequest. */ + interface IExecuteHookRequest { - /** ExecuteMultiFetchAsDBARequest tablet_alias */ + /** ExecuteHookRequest tablet_alias */ tablet_alias?: (topodata.ITabletAlias|null); - /** ExecuteMultiFetchAsDBARequest sql */ - sql?: (string|null); - - /** ExecuteMultiFetchAsDBARequest max_rows */ - max_rows?: (number|Long|null); - - /** ExecuteMultiFetchAsDBARequest disable_binlogs */ - disable_binlogs?: (boolean|null); - - /** ExecuteMultiFetchAsDBARequest reload_schema */ - reload_schema?: (boolean|null); + /** ExecuteHookRequest tablet_hook_request */ + tablet_hook_request?: (tabletmanagerdata.IExecuteHookRequest|null); } - /** Represents an ExecuteMultiFetchAsDBARequest. */ - class ExecuteMultiFetchAsDBARequest implements IExecuteMultiFetchAsDBARequest { + /** Represents an ExecuteHookRequest. */ + class ExecuteHookRequest implements IExecuteHookRequest { /** - * Constructs a new ExecuteMultiFetchAsDBARequest. + * Constructs a new ExecuteHookRequest. * @param [properties] Properties to set */ - constructor(properties?: vtctldata.IExecuteMultiFetchAsDBARequest); + constructor(properties?: vtctldata.IExecuteHookRequest); - /** ExecuteMultiFetchAsDBARequest tablet_alias. */ + /** ExecuteHookRequest tablet_alias. */ public tablet_alias?: (topodata.ITabletAlias|null); - /** ExecuteMultiFetchAsDBARequest sql. */ - public sql: string; - - /** ExecuteMultiFetchAsDBARequest max_rows. */ - public max_rows: (number|Long); - - /** ExecuteMultiFetchAsDBARequest disable_binlogs. */ - public disable_binlogs: boolean; - - /** ExecuteMultiFetchAsDBARequest reload_schema. */ - public reload_schema: boolean; + /** ExecuteHookRequest tablet_hook_request. */ + public tablet_hook_request?: (tabletmanagerdata.IExecuteHookRequest|null); /** - * Creates a new ExecuteMultiFetchAsDBARequest instance using the specified properties. + * Creates a new ExecuteHookRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ExecuteMultiFetchAsDBARequest instance + * @returns ExecuteHookRequest instance */ - public static create(properties?: vtctldata.IExecuteMultiFetchAsDBARequest): vtctldata.ExecuteMultiFetchAsDBARequest; + public static create(properties?: vtctldata.IExecuteHookRequest): vtctldata.ExecuteHookRequest; /** - * Encodes the specified ExecuteMultiFetchAsDBARequest message. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBARequest.verify|verify} messages. - * @param message ExecuteMultiFetchAsDBARequest message or plain object to encode + * Encodes the specified ExecuteHookRequest message. Does not implicitly {@link vtctldata.ExecuteHookRequest.verify|verify} messages. + * @param message ExecuteHookRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: vtctldata.IExecuteMultiFetchAsDBARequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: vtctldata.IExecuteHookRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExecuteMultiFetchAsDBARequest message, length delimited. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBARequest.verify|verify} messages. - * @param message ExecuteMultiFetchAsDBARequest message or plain object to encode + * Encodes the specified ExecuteHookRequest message, length delimited. Does not implicitly {@link vtctldata.ExecuteHookRequest.verify|verify} messages. + * @param message ExecuteHookRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: vtctldata.IExecuteMultiFetchAsDBARequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: vtctldata.IExecuteHookRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExecuteMultiFetchAsDBARequest message from the specified reader or buffer. + * Decodes an ExecuteHookRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExecuteMultiFetchAsDBARequest + * @returns ExecuteHookRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vtctldata.ExecuteMultiFetchAsDBARequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vtctldata.ExecuteHookRequest; /** - * Decodes an ExecuteMultiFetchAsDBARequest message from the specified reader or buffer, length delimited. + * Decodes an ExecuteHookRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExecuteMultiFetchAsDBARequest + * @returns ExecuteHookRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vtctldata.ExecuteMultiFetchAsDBARequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vtctldata.ExecuteHookRequest; /** - * Verifies an ExecuteMultiFetchAsDBARequest message. + * Verifies an ExecuteHookRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ExecuteMultiFetchAsDBARequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteHookRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExecuteMultiFetchAsDBARequest + * @returns ExecuteHookRequest */ - public static fromObject(object: { [k: string]: any }): vtctldata.ExecuteMultiFetchAsDBARequest; + public static fromObject(object: { [k: string]: any }): vtctldata.ExecuteHookRequest; /** - * Creates a plain object from an ExecuteMultiFetchAsDBARequest message. Also converts values to other types if specified. - * @param message ExecuteMultiFetchAsDBARequest + * Creates a plain object from an ExecuteHookRequest message. Also converts values to other types if specified. + * @param message ExecuteHookRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: vtctldata.ExecuteMultiFetchAsDBARequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: vtctldata.ExecuteHookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExecuteMultiFetchAsDBARequest to JSON. + * Converts this ExecuteHookRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ExecuteMultiFetchAsDBARequest + * Gets the default type url for ExecuteHookRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ExecuteMultiFetchAsDBAResponse. */ - interface IExecuteMultiFetchAsDBAResponse { + /** Properties of an ExecuteHookResponse. */ + interface IExecuteHookResponse { - /** ExecuteMultiFetchAsDBAResponse results */ - results?: (query.IQueryResult[]|null); + /** ExecuteHookResponse hook_result */ + hook_result?: (tabletmanagerdata.IExecuteHookResponse|null); } - /** Represents an ExecuteMultiFetchAsDBAResponse. */ - class ExecuteMultiFetchAsDBAResponse implements IExecuteMultiFetchAsDBAResponse { + /** Represents an ExecuteHookResponse. */ + class ExecuteHookResponse implements IExecuteHookResponse { /** - * Constructs a new ExecuteMultiFetchAsDBAResponse. + * Constructs a new ExecuteHookResponse. * @param [properties] Properties to set */ - constructor(properties?: vtctldata.IExecuteMultiFetchAsDBAResponse); + constructor(properties?: vtctldata.IExecuteHookResponse); - /** ExecuteMultiFetchAsDBAResponse results. */ - public results: query.IQueryResult[]; + /** ExecuteHookResponse hook_result. */ + public hook_result?: (tabletmanagerdata.IExecuteHookResponse|null); /** - * Creates a new ExecuteMultiFetchAsDBAResponse instance using the specified properties. + * Creates a new ExecuteHookResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ExecuteMultiFetchAsDBAResponse instance + * @returns ExecuteHookResponse instance */ - public static create(properties?: vtctldata.IExecuteMultiFetchAsDBAResponse): vtctldata.ExecuteMultiFetchAsDBAResponse; + public static create(properties?: vtctldata.IExecuteHookResponse): vtctldata.ExecuteHookResponse; /** - * Encodes the specified ExecuteMultiFetchAsDBAResponse message. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBAResponse.verify|verify} messages. - * @param message ExecuteMultiFetchAsDBAResponse message or plain object to encode + * Encodes the specified ExecuteHookResponse message. Does not implicitly {@link vtctldata.ExecuteHookResponse.verify|verify} messages. + * @param message ExecuteHookResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: vtctldata.IExecuteMultiFetchAsDBAResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: vtctldata.IExecuteHookResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExecuteMultiFetchAsDBAResponse message, length delimited. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBAResponse.verify|verify} messages. - * @param message ExecuteMultiFetchAsDBAResponse message or plain object to encode + * Encodes the specified ExecuteHookResponse message, length delimited. Does not implicitly {@link vtctldata.ExecuteHookResponse.verify|verify} messages. + * @param message ExecuteHookResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: vtctldata.IExecuteMultiFetchAsDBAResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: vtctldata.IExecuteHookResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExecuteMultiFetchAsDBAResponse message from the specified reader or buffer. + * Decodes an ExecuteHookResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExecuteMultiFetchAsDBAResponse + * @returns ExecuteHookResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vtctldata.ExecuteMultiFetchAsDBAResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vtctldata.ExecuteHookResponse; /** - * Decodes an ExecuteMultiFetchAsDBAResponse message from the specified reader or buffer, length delimited. + * Decodes an ExecuteHookResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExecuteMultiFetchAsDBAResponse + * @returns ExecuteHookResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vtctldata.ExecuteMultiFetchAsDBAResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vtctldata.ExecuteHookResponse; /** - * Verifies an ExecuteMultiFetchAsDBAResponse message. + * Verifies an ExecuteHookResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ExecuteMultiFetchAsDBAResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteHookResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExecuteMultiFetchAsDBAResponse + * @returns ExecuteHookResponse */ - public static fromObject(object: { [k: string]: any }): vtctldata.ExecuteMultiFetchAsDBAResponse; + public static fromObject(object: { [k: string]: any }): vtctldata.ExecuteHookResponse; /** - * Creates a plain object from an ExecuteMultiFetchAsDBAResponse message. Also converts values to other types if specified. - * @param message ExecuteMultiFetchAsDBAResponse + * Creates a plain object from an ExecuteHookResponse message. Also converts values to other types if specified. + * @param message ExecuteHookResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: vtctldata.ExecuteMultiFetchAsDBAResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: vtctldata.ExecuteHookResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExecuteMultiFetchAsDBAResponse to JSON. + * Converts this ExecuteHookResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ExecuteMultiFetchAsDBAResponse + * Gets the default type url for ExecuteHookResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ExecuteHookRequest. */ - interface IExecuteHookRequest { + /** Properties of an ExecuteMultiFetchAsDBARequest. */ + interface IExecuteMultiFetchAsDBARequest { - /** ExecuteHookRequest tablet_alias */ + /** ExecuteMultiFetchAsDBARequest tablet_alias */ tablet_alias?: (topodata.ITabletAlias|null); - /** ExecuteHookRequest tablet_hook_request */ - tablet_hook_request?: (tabletmanagerdata.IExecuteHookRequest|null); + /** ExecuteMultiFetchAsDBARequest sql */ + sql?: (string|null); + + /** ExecuteMultiFetchAsDBARequest max_rows */ + max_rows?: (number|Long|null); + + /** ExecuteMultiFetchAsDBARequest disable_binlogs */ + disable_binlogs?: (boolean|null); + + /** ExecuteMultiFetchAsDBARequest reload_schema */ + reload_schema?: (boolean|null); } - /** Represents an ExecuteHookRequest. */ - class ExecuteHookRequest implements IExecuteHookRequest { + /** Represents an ExecuteMultiFetchAsDBARequest. */ + class ExecuteMultiFetchAsDBARequest implements IExecuteMultiFetchAsDBARequest { /** - * Constructs a new ExecuteHookRequest. + * Constructs a new ExecuteMultiFetchAsDBARequest. * @param [properties] Properties to set */ - constructor(properties?: vtctldata.IExecuteHookRequest); + constructor(properties?: vtctldata.IExecuteMultiFetchAsDBARequest); - /** ExecuteHookRequest tablet_alias. */ + /** ExecuteMultiFetchAsDBARequest tablet_alias. */ public tablet_alias?: (topodata.ITabletAlias|null); - /** ExecuteHookRequest tablet_hook_request. */ - public tablet_hook_request?: (tabletmanagerdata.IExecuteHookRequest|null); + /** ExecuteMultiFetchAsDBARequest sql. */ + public sql: string; + + /** ExecuteMultiFetchAsDBARequest max_rows. */ + public max_rows: (number|Long); + + /** ExecuteMultiFetchAsDBARequest disable_binlogs. */ + public disable_binlogs: boolean; + + /** ExecuteMultiFetchAsDBARequest reload_schema. */ + public reload_schema: boolean; /** - * Creates a new ExecuteHookRequest instance using the specified properties. + * Creates a new ExecuteMultiFetchAsDBARequest instance using the specified properties. * @param [properties] Properties to set - * @returns ExecuteHookRequest instance + * @returns ExecuteMultiFetchAsDBARequest instance */ - public static create(properties?: vtctldata.IExecuteHookRequest): vtctldata.ExecuteHookRequest; + public static create(properties?: vtctldata.IExecuteMultiFetchAsDBARequest): vtctldata.ExecuteMultiFetchAsDBARequest; /** - * Encodes the specified ExecuteHookRequest message. Does not implicitly {@link vtctldata.ExecuteHookRequest.verify|verify} messages. - * @param message ExecuteHookRequest message or plain object to encode + * Encodes the specified ExecuteMultiFetchAsDBARequest message. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBARequest.verify|verify} messages. + * @param message ExecuteMultiFetchAsDBARequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: vtctldata.IExecuteHookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: vtctldata.IExecuteMultiFetchAsDBARequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExecuteHookRequest message, length delimited. Does not implicitly {@link vtctldata.ExecuteHookRequest.verify|verify} messages. - * @param message ExecuteHookRequest message or plain object to encode + * Encodes the specified ExecuteMultiFetchAsDBARequest message, length delimited. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBARequest.verify|verify} messages. + * @param message ExecuteMultiFetchAsDBARequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: vtctldata.IExecuteHookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: vtctldata.IExecuteMultiFetchAsDBARequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExecuteHookRequest message from the specified reader or buffer. + * Decodes an ExecuteMultiFetchAsDBARequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExecuteHookRequest + * @returns ExecuteMultiFetchAsDBARequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vtctldata.ExecuteHookRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vtctldata.ExecuteMultiFetchAsDBARequest; /** - * Decodes an ExecuteHookRequest message from the specified reader or buffer, length delimited. + * Decodes an ExecuteMultiFetchAsDBARequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExecuteHookRequest + * @returns ExecuteMultiFetchAsDBARequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vtctldata.ExecuteHookRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vtctldata.ExecuteMultiFetchAsDBARequest; /** - * Verifies an ExecuteHookRequest message. + * Verifies an ExecuteMultiFetchAsDBARequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ExecuteHookRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteMultiFetchAsDBARequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExecuteHookRequest + * @returns ExecuteMultiFetchAsDBARequest */ - public static fromObject(object: { [k: string]: any }): vtctldata.ExecuteHookRequest; + public static fromObject(object: { [k: string]: any }): vtctldata.ExecuteMultiFetchAsDBARequest; /** - * Creates a plain object from an ExecuteHookRequest message. Also converts values to other types if specified. - * @param message ExecuteHookRequest + * Creates a plain object from an ExecuteMultiFetchAsDBARequest message. Also converts values to other types if specified. + * @param message ExecuteMultiFetchAsDBARequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: vtctldata.ExecuteHookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: vtctldata.ExecuteMultiFetchAsDBARequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExecuteHookRequest to JSON. + * Converts this ExecuteMultiFetchAsDBARequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ExecuteHookRequest + * Gets the default type url for ExecuteMultiFetchAsDBARequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ExecuteHookResponse. */ - interface IExecuteHookResponse { + /** Properties of an ExecuteMultiFetchAsDBAResponse. */ + interface IExecuteMultiFetchAsDBAResponse { - /** ExecuteHookResponse hook_result */ - hook_result?: (tabletmanagerdata.IExecuteHookResponse|null); + /** ExecuteMultiFetchAsDBAResponse results */ + results?: (query.IQueryResult[]|null); } - /** Represents an ExecuteHookResponse. */ - class ExecuteHookResponse implements IExecuteHookResponse { + /** Represents an ExecuteMultiFetchAsDBAResponse. */ + class ExecuteMultiFetchAsDBAResponse implements IExecuteMultiFetchAsDBAResponse { /** - * Constructs a new ExecuteHookResponse. + * Constructs a new ExecuteMultiFetchAsDBAResponse. * @param [properties] Properties to set */ - constructor(properties?: vtctldata.IExecuteHookResponse); + constructor(properties?: vtctldata.IExecuteMultiFetchAsDBAResponse); - /** ExecuteHookResponse hook_result. */ - public hook_result?: (tabletmanagerdata.IExecuteHookResponse|null); + /** ExecuteMultiFetchAsDBAResponse results. */ + public results: query.IQueryResult[]; /** - * Creates a new ExecuteHookResponse instance using the specified properties. + * Creates a new ExecuteMultiFetchAsDBAResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ExecuteHookResponse instance + * @returns ExecuteMultiFetchAsDBAResponse instance */ - public static create(properties?: vtctldata.IExecuteHookResponse): vtctldata.ExecuteHookResponse; + public static create(properties?: vtctldata.IExecuteMultiFetchAsDBAResponse): vtctldata.ExecuteMultiFetchAsDBAResponse; /** - * Encodes the specified ExecuteHookResponse message. Does not implicitly {@link vtctldata.ExecuteHookResponse.verify|verify} messages. - * @param message ExecuteHookResponse message or plain object to encode + * Encodes the specified ExecuteMultiFetchAsDBAResponse message. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBAResponse.verify|verify} messages. + * @param message ExecuteMultiFetchAsDBAResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: vtctldata.IExecuteHookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: vtctldata.IExecuteMultiFetchAsDBAResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExecuteHookResponse message, length delimited. Does not implicitly {@link vtctldata.ExecuteHookResponse.verify|verify} messages. - * @param message ExecuteHookResponse message or plain object to encode + * Encodes the specified ExecuteMultiFetchAsDBAResponse message, length delimited. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBAResponse.verify|verify} messages. + * @param message ExecuteMultiFetchAsDBAResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: vtctldata.IExecuteHookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: vtctldata.IExecuteMultiFetchAsDBAResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExecuteHookResponse message from the specified reader or buffer. + * Decodes an ExecuteMultiFetchAsDBAResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExecuteHookResponse + * @returns ExecuteMultiFetchAsDBAResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vtctldata.ExecuteHookResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vtctldata.ExecuteMultiFetchAsDBAResponse; /** - * Decodes an ExecuteHookResponse message from the specified reader or buffer, length delimited. + * Decodes an ExecuteMultiFetchAsDBAResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExecuteHookResponse + * @returns ExecuteMultiFetchAsDBAResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vtctldata.ExecuteHookResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vtctldata.ExecuteMultiFetchAsDBAResponse; /** - * Verifies an ExecuteHookResponse message. + * Verifies an ExecuteMultiFetchAsDBAResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ExecuteHookResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteMultiFetchAsDBAResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExecuteHookResponse + * @returns ExecuteMultiFetchAsDBAResponse */ - public static fromObject(object: { [k: string]: any }): vtctldata.ExecuteHookResponse; + public static fromObject(object: { [k: string]: any }): vtctldata.ExecuteMultiFetchAsDBAResponse; /** - * Creates a plain object from an ExecuteHookResponse message. Also converts values to other types if specified. - * @param message ExecuteHookResponse + * Creates a plain object from an ExecuteMultiFetchAsDBAResponse message. Also converts values to other types if specified. + * @param message ExecuteMultiFetchAsDBAResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: vtctldata.ExecuteHookResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: vtctldata.ExecuteMultiFetchAsDBAResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExecuteHookResponse to JSON. + * Converts this ExecuteMultiFetchAsDBAResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ExecuteHookResponse + * Gets the default type url for ExecuteMultiFetchAsDBAResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ diff --git a/web/vtadmin/src/proto/vtadmin.js b/web/vtadmin/src/proto/vtadmin.js index ef2e4c40b1e..b8b9d910091 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -124832,28 +124832,25 @@ export const vtctldata = $root.vtctldata = (() => { return ExecuteFetchAsDBAResponse; })(); - vtctldata.ExecuteMultiFetchAsDBARequest = (function() { + vtctldata.ExecuteHookRequest = (function() { /** - * Properties of an ExecuteMultiFetchAsDBARequest. + * Properties of an ExecuteHookRequest. * @memberof vtctldata - * @interface IExecuteMultiFetchAsDBARequest - * @property {topodata.ITabletAlias|null} [tablet_alias] ExecuteMultiFetchAsDBARequest tablet_alias - * @property {string|null} [sql] ExecuteMultiFetchAsDBARequest sql - * @property {number|Long|null} [max_rows] ExecuteMultiFetchAsDBARequest max_rows - * @property {boolean|null} [disable_binlogs] ExecuteMultiFetchAsDBARequest disable_binlogs - * @property {boolean|null} [reload_schema] ExecuteMultiFetchAsDBARequest reload_schema + * @interface IExecuteHookRequest + * @property {topodata.ITabletAlias|null} [tablet_alias] ExecuteHookRequest tablet_alias + * @property {tabletmanagerdata.IExecuteHookRequest|null} [tablet_hook_request] ExecuteHookRequest tablet_hook_request */ /** - * Constructs a new ExecuteMultiFetchAsDBARequest. + * Constructs a new ExecuteHookRequest. * @memberof vtctldata - * @classdesc Represents an ExecuteMultiFetchAsDBARequest. - * @implements IExecuteMultiFetchAsDBARequest + * @classdesc Represents an ExecuteHookRequest. + * @implements IExecuteHookRequest * @constructor - * @param {vtctldata.IExecuteMultiFetchAsDBARequest=} [properties] Properties to set + * @param {vtctldata.IExecuteHookRequest=} [properties] Properties to set */ - function ExecuteMultiFetchAsDBARequest(properties) { + function ExecuteHookRequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -124861,110 +124858,80 @@ export const vtctldata = $root.vtctldata = (() => { } /** - * ExecuteMultiFetchAsDBARequest tablet_alias. + * ExecuteHookRequest tablet_alias. * @member {topodata.ITabletAlias|null|undefined} tablet_alias - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest - * @instance - */ - ExecuteMultiFetchAsDBARequest.prototype.tablet_alias = null; - - /** - * ExecuteMultiFetchAsDBARequest sql. - * @member {string} sql - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest - * @instance - */ - ExecuteMultiFetchAsDBARequest.prototype.sql = ""; - - /** - * ExecuteMultiFetchAsDBARequest max_rows. - * @member {number|Long} max_rows - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest - * @instance - */ - ExecuteMultiFetchAsDBARequest.prototype.max_rows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ExecuteMultiFetchAsDBARequest disable_binlogs. - * @member {boolean} disable_binlogs - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * @memberof vtctldata.ExecuteHookRequest * @instance */ - ExecuteMultiFetchAsDBARequest.prototype.disable_binlogs = false; + ExecuteHookRequest.prototype.tablet_alias = null; /** - * ExecuteMultiFetchAsDBARequest reload_schema. - * @member {boolean} reload_schema - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * ExecuteHookRequest tablet_hook_request. + * @member {tabletmanagerdata.IExecuteHookRequest|null|undefined} tablet_hook_request + * @memberof vtctldata.ExecuteHookRequest * @instance */ - ExecuteMultiFetchAsDBARequest.prototype.reload_schema = false; + ExecuteHookRequest.prototype.tablet_hook_request = null; /** - * Creates a new ExecuteMultiFetchAsDBARequest instance using the specified properties. + * Creates a new ExecuteHookRequest instance using the specified properties. * @function create - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * @memberof vtctldata.ExecuteHookRequest * @static - * @param {vtctldata.IExecuteMultiFetchAsDBARequest=} [properties] Properties to set - * @returns {vtctldata.ExecuteMultiFetchAsDBARequest} ExecuteMultiFetchAsDBARequest instance + * @param {vtctldata.IExecuteHookRequest=} [properties] Properties to set + * @returns {vtctldata.ExecuteHookRequest} ExecuteHookRequest instance */ - ExecuteMultiFetchAsDBARequest.create = function create(properties) { - return new ExecuteMultiFetchAsDBARequest(properties); + ExecuteHookRequest.create = function create(properties) { + return new ExecuteHookRequest(properties); }; /** - * Encodes the specified ExecuteMultiFetchAsDBARequest message. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBARequest.verify|verify} messages. + * Encodes the specified ExecuteHookRequest message. Does not implicitly {@link vtctldata.ExecuteHookRequest.verify|verify} messages. * @function encode - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * @memberof vtctldata.ExecuteHookRequest * @static - * @param {vtctldata.IExecuteMultiFetchAsDBARequest} message ExecuteMultiFetchAsDBARequest message or plain object to encode + * @param {vtctldata.IExecuteHookRequest} message ExecuteHookRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteMultiFetchAsDBARequest.encode = function encode(message, writer) { + ExecuteHookRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.tablet_alias != null && Object.hasOwnProperty.call(message, "tablet_alias")) $root.topodata.TabletAlias.encode(message.tablet_alias, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sql); - if (message.max_rows != null && Object.hasOwnProperty.call(message, "max_rows")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.max_rows); - if (message.disable_binlogs != null && Object.hasOwnProperty.call(message, "disable_binlogs")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disable_binlogs); - if (message.reload_schema != null && Object.hasOwnProperty.call(message, "reload_schema")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reload_schema); + if (message.tablet_hook_request != null && Object.hasOwnProperty.call(message, "tablet_hook_request")) + $root.tabletmanagerdata.ExecuteHookRequest.encode(message.tablet_hook_request, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ExecuteMultiFetchAsDBARequest message, length delimited. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBARequest.verify|verify} messages. + * Encodes the specified ExecuteHookRequest message, length delimited. Does not implicitly {@link vtctldata.ExecuteHookRequest.verify|verify} messages. * @function encodeDelimited - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * @memberof vtctldata.ExecuteHookRequest * @static - * @param {vtctldata.IExecuteMultiFetchAsDBARequest} message ExecuteMultiFetchAsDBARequest message or plain object to encode + * @param {vtctldata.IExecuteHookRequest} message ExecuteHookRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteMultiFetchAsDBARequest.encodeDelimited = function encodeDelimited(message, writer) { + ExecuteHookRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExecuteMultiFetchAsDBARequest message from the specified reader or buffer. + * Decodes an ExecuteHookRequest message from the specified reader or buffer. * @function decode - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * @memberof vtctldata.ExecuteHookRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {vtctldata.ExecuteMultiFetchAsDBARequest} ExecuteMultiFetchAsDBARequest + * @returns {vtctldata.ExecuteHookRequest} ExecuteHookRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExecuteMultiFetchAsDBARequest.decode = function decode(reader, length) { + ExecuteHookRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vtctldata.ExecuteMultiFetchAsDBARequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vtctldata.ExecuteHookRequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { @@ -124973,19 +124940,7 @@ export const vtctldata = $root.vtctldata = (() => { break; } case 2: { - message.sql = reader.string(); - break; - } - case 3: { - message.max_rows = reader.int64(); - break; - } - case 4: { - message.disable_binlogs = reader.bool(); - break; - } - case 5: { - message.reload_schema = reader.bool(); + message.tablet_hook_request = $root.tabletmanagerdata.ExecuteHookRequest.decode(reader, reader.uint32()); break; } default: @@ -124997,30 +124952,30 @@ export const vtctldata = $root.vtctldata = (() => { }; /** - * Decodes an ExecuteMultiFetchAsDBARequest message from the specified reader or buffer, length delimited. + * Decodes an ExecuteHookRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * @memberof vtctldata.ExecuteHookRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {vtctldata.ExecuteMultiFetchAsDBARequest} ExecuteMultiFetchAsDBARequest + * @returns {vtctldata.ExecuteHookRequest} ExecuteHookRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExecuteMultiFetchAsDBARequest.decodeDelimited = function decodeDelimited(reader) { + ExecuteHookRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExecuteMultiFetchAsDBARequest message. + * Verifies an ExecuteHookRequest message. * @function verify - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * @memberof vtctldata.ExecuteHookRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExecuteMultiFetchAsDBARequest.verify = function verify(message) { + ExecuteHookRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.tablet_alias != null && message.hasOwnProperty("tablet_alias")) { @@ -125028,144 +124983,110 @@ export const vtctldata = $root.vtctldata = (() => { if (error) return "tablet_alias." + error; } - if (message.sql != null && message.hasOwnProperty("sql")) - if (!$util.isString(message.sql)) - return "sql: string expected"; - if (message.max_rows != null && message.hasOwnProperty("max_rows")) - if (!$util.isInteger(message.max_rows) && !(message.max_rows && $util.isInteger(message.max_rows.low) && $util.isInteger(message.max_rows.high))) - return "max_rows: integer|Long expected"; - if (message.disable_binlogs != null && message.hasOwnProperty("disable_binlogs")) - if (typeof message.disable_binlogs !== "boolean") - return "disable_binlogs: boolean expected"; - if (message.reload_schema != null && message.hasOwnProperty("reload_schema")) - if (typeof message.reload_schema !== "boolean") - return "reload_schema: boolean expected"; + if (message.tablet_hook_request != null && message.hasOwnProperty("tablet_hook_request")) { + let error = $root.tabletmanagerdata.ExecuteHookRequest.verify(message.tablet_hook_request); + if (error) + return "tablet_hook_request." + error; + } return null; }; /** - * Creates an ExecuteMultiFetchAsDBARequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteHookRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * @memberof vtctldata.ExecuteHookRequest * @static * @param {Object.} object Plain object - * @returns {vtctldata.ExecuteMultiFetchAsDBARequest} ExecuteMultiFetchAsDBARequest + * @returns {vtctldata.ExecuteHookRequest} ExecuteHookRequest */ - ExecuteMultiFetchAsDBARequest.fromObject = function fromObject(object) { - if (object instanceof $root.vtctldata.ExecuteMultiFetchAsDBARequest) + ExecuteHookRequest.fromObject = function fromObject(object) { + if (object instanceof $root.vtctldata.ExecuteHookRequest) return object; - let message = new $root.vtctldata.ExecuteMultiFetchAsDBARequest(); + let message = new $root.vtctldata.ExecuteHookRequest(); if (object.tablet_alias != null) { if (typeof object.tablet_alias !== "object") - throw TypeError(".vtctldata.ExecuteMultiFetchAsDBARequest.tablet_alias: object expected"); + throw TypeError(".vtctldata.ExecuteHookRequest.tablet_alias: object expected"); message.tablet_alias = $root.topodata.TabletAlias.fromObject(object.tablet_alias); } - if (object.sql != null) - message.sql = String(object.sql); - if (object.max_rows != null) - if ($util.Long) - (message.max_rows = $util.Long.fromValue(object.max_rows)).unsigned = false; - else if (typeof object.max_rows === "string") - message.max_rows = parseInt(object.max_rows, 10); - else if (typeof object.max_rows === "number") - message.max_rows = object.max_rows; - else if (typeof object.max_rows === "object") - message.max_rows = new $util.LongBits(object.max_rows.low >>> 0, object.max_rows.high >>> 0).toNumber(); - if (object.disable_binlogs != null) - message.disable_binlogs = Boolean(object.disable_binlogs); - if (object.reload_schema != null) - message.reload_schema = Boolean(object.reload_schema); + if (object.tablet_hook_request != null) { + if (typeof object.tablet_hook_request !== "object") + throw TypeError(".vtctldata.ExecuteHookRequest.tablet_hook_request: object expected"); + message.tablet_hook_request = $root.tabletmanagerdata.ExecuteHookRequest.fromObject(object.tablet_hook_request); + } return message; }; /** - * Creates a plain object from an ExecuteMultiFetchAsDBARequest message. Also converts values to other types if specified. + * Creates a plain object from an ExecuteHookRequest message. Also converts values to other types if specified. * @function toObject - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * @memberof vtctldata.ExecuteHookRequest * @static - * @param {vtctldata.ExecuteMultiFetchAsDBARequest} message ExecuteMultiFetchAsDBARequest + * @param {vtctldata.ExecuteHookRequest} message ExecuteHookRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecuteMultiFetchAsDBARequest.toObject = function toObject(message, options) { + ExecuteHookRequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.defaults) { object.tablet_alias = null; - object.sql = ""; - if ($util.Long) { - let long = new $util.Long(0, 0, false); - object.max_rows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.max_rows = options.longs === String ? "0" : 0; - object.disable_binlogs = false; - object.reload_schema = false; + object.tablet_hook_request = null; } if (message.tablet_alias != null && message.hasOwnProperty("tablet_alias")) object.tablet_alias = $root.topodata.TabletAlias.toObject(message.tablet_alias, options); - if (message.sql != null && message.hasOwnProperty("sql")) - object.sql = message.sql; - if (message.max_rows != null && message.hasOwnProperty("max_rows")) - if (typeof message.max_rows === "number") - object.max_rows = options.longs === String ? String(message.max_rows) : message.max_rows; - else - object.max_rows = options.longs === String ? $util.Long.prototype.toString.call(message.max_rows) : options.longs === Number ? new $util.LongBits(message.max_rows.low >>> 0, message.max_rows.high >>> 0).toNumber() : message.max_rows; - if (message.disable_binlogs != null && message.hasOwnProperty("disable_binlogs")) - object.disable_binlogs = message.disable_binlogs; - if (message.reload_schema != null && message.hasOwnProperty("reload_schema")) - object.reload_schema = message.reload_schema; + if (message.tablet_hook_request != null && message.hasOwnProperty("tablet_hook_request")) + object.tablet_hook_request = $root.tabletmanagerdata.ExecuteHookRequest.toObject(message.tablet_hook_request, options); return object; }; /** - * Converts this ExecuteMultiFetchAsDBARequest to JSON. + * Converts this ExecuteHookRequest to JSON. * @function toJSON - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * @memberof vtctldata.ExecuteHookRequest * @instance * @returns {Object.} JSON object */ - ExecuteMultiFetchAsDBARequest.prototype.toJSON = function toJSON() { + ExecuteHookRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExecuteMultiFetchAsDBARequest + * Gets the default type url for ExecuteHookRequest * @function getTypeUrl - * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * @memberof vtctldata.ExecuteHookRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExecuteMultiFetchAsDBARequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExecuteHookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/vtctldata.ExecuteMultiFetchAsDBARequest"; + return typeUrlPrefix + "/vtctldata.ExecuteHookRequest"; }; - return ExecuteMultiFetchAsDBARequest; + return ExecuteHookRequest; })(); - vtctldata.ExecuteMultiFetchAsDBAResponse = (function() { + vtctldata.ExecuteHookResponse = (function() { /** - * Properties of an ExecuteMultiFetchAsDBAResponse. + * Properties of an ExecuteHookResponse. * @memberof vtctldata - * @interface IExecuteMultiFetchAsDBAResponse - * @property {Array.|null} [results] ExecuteMultiFetchAsDBAResponse results + * @interface IExecuteHookResponse + * @property {tabletmanagerdata.IExecuteHookResponse|null} [hook_result] ExecuteHookResponse hook_result */ /** - * Constructs a new ExecuteMultiFetchAsDBAResponse. + * Constructs a new ExecuteHookResponse. * @memberof vtctldata - * @classdesc Represents an ExecuteMultiFetchAsDBAResponse. - * @implements IExecuteMultiFetchAsDBAResponse + * @classdesc Represents an ExecuteHookResponse. + * @implements IExecuteHookResponse * @constructor - * @param {vtctldata.IExecuteMultiFetchAsDBAResponse=} [properties] Properties to set + * @param {vtctldata.IExecuteHookResponse=} [properties] Properties to set */ - function ExecuteMultiFetchAsDBAResponse(properties) { - this.results = []; + function ExecuteHookResponse(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -125173,78 +125094,75 @@ export const vtctldata = $root.vtctldata = (() => { } /** - * ExecuteMultiFetchAsDBAResponse results. - * @member {Array.} results - * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse + * ExecuteHookResponse hook_result. + * @member {tabletmanagerdata.IExecuteHookResponse|null|undefined} hook_result + * @memberof vtctldata.ExecuteHookResponse * @instance */ - ExecuteMultiFetchAsDBAResponse.prototype.results = $util.emptyArray; + ExecuteHookResponse.prototype.hook_result = null; /** - * Creates a new ExecuteMultiFetchAsDBAResponse instance using the specified properties. + * Creates a new ExecuteHookResponse instance using the specified properties. * @function create - * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse + * @memberof vtctldata.ExecuteHookResponse * @static - * @param {vtctldata.IExecuteMultiFetchAsDBAResponse=} [properties] Properties to set - * @returns {vtctldata.ExecuteMultiFetchAsDBAResponse} ExecuteMultiFetchAsDBAResponse instance + * @param {vtctldata.IExecuteHookResponse=} [properties] Properties to set + * @returns {vtctldata.ExecuteHookResponse} ExecuteHookResponse instance */ - ExecuteMultiFetchAsDBAResponse.create = function create(properties) { - return new ExecuteMultiFetchAsDBAResponse(properties); + ExecuteHookResponse.create = function create(properties) { + return new ExecuteHookResponse(properties); }; /** - * Encodes the specified ExecuteMultiFetchAsDBAResponse message. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBAResponse.verify|verify} messages. + * Encodes the specified ExecuteHookResponse message. Does not implicitly {@link vtctldata.ExecuteHookResponse.verify|verify} messages. * @function encode - * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse + * @memberof vtctldata.ExecuteHookResponse * @static - * @param {vtctldata.IExecuteMultiFetchAsDBAResponse} message ExecuteMultiFetchAsDBAResponse message or plain object to encode + * @param {vtctldata.IExecuteHookResponse} message ExecuteHookResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteMultiFetchAsDBAResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.results != null && message.results.length) - for (let i = 0; i < message.results.length; ++i) - $root.query.QueryResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + ExecuteHookResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hook_result != null && Object.hasOwnProperty.call(message, "hook_result")) + $root.tabletmanagerdata.ExecuteHookResponse.encode(message.hook_result, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ExecuteMultiFetchAsDBAResponse message, length delimited. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBAResponse.verify|verify} messages. + * Encodes the specified ExecuteHookResponse message, length delimited. Does not implicitly {@link vtctldata.ExecuteHookResponse.verify|verify} messages. * @function encodeDelimited - * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse + * @memberof vtctldata.ExecuteHookResponse * @static - * @param {vtctldata.IExecuteMultiFetchAsDBAResponse} message ExecuteMultiFetchAsDBAResponse message or plain object to encode + * @param {vtctldata.IExecuteHookResponse} message ExecuteHookResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteMultiFetchAsDBAResponse.encodeDelimited = function encodeDelimited(message, writer) { + ExecuteHookResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExecuteMultiFetchAsDBAResponse message from the specified reader or buffer. + * Decodes an ExecuteHookResponse message from the specified reader or buffer. * @function decode - * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse + * @memberof vtctldata.ExecuteHookResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {vtctldata.ExecuteMultiFetchAsDBAResponse} ExecuteMultiFetchAsDBAResponse + * @returns {vtctldata.ExecuteHookResponse} ExecuteHookResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExecuteMultiFetchAsDBAResponse.decode = function decode(reader, length) { + ExecuteHookResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vtctldata.ExecuteMultiFetchAsDBAResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vtctldata.ExecuteHookResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.results && message.results.length)) - message.results = []; - message.results.push($root.query.QueryResult.decode(reader, reader.uint32())); + message.hook_result = $root.tabletmanagerdata.ExecuteHookResponse.decode(reader, reader.uint32()); break; } default: @@ -125256,140 +125174,131 @@ export const vtctldata = $root.vtctldata = (() => { }; /** - * Decodes an ExecuteMultiFetchAsDBAResponse message from the specified reader or buffer, length delimited. + * Decodes an ExecuteHookResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse + * @memberof vtctldata.ExecuteHookResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {vtctldata.ExecuteMultiFetchAsDBAResponse} ExecuteMultiFetchAsDBAResponse + * @returns {vtctldata.ExecuteHookResponse} ExecuteHookResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExecuteMultiFetchAsDBAResponse.decodeDelimited = function decodeDelimited(reader) { + ExecuteHookResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExecuteMultiFetchAsDBAResponse message. + * Verifies an ExecuteHookResponse message. * @function verify - * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse + * @memberof vtctldata.ExecuteHookResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExecuteMultiFetchAsDBAResponse.verify = function verify(message) { + ExecuteHookResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.results != null && message.hasOwnProperty("results")) { - if (!Array.isArray(message.results)) - return "results: array expected"; - for (let i = 0; i < message.results.length; ++i) { - let error = $root.query.QueryResult.verify(message.results[i]); - if (error) - return "results." + error; - } + if (message.hook_result != null && message.hasOwnProperty("hook_result")) { + let error = $root.tabletmanagerdata.ExecuteHookResponse.verify(message.hook_result); + if (error) + return "hook_result." + error; } return null; }; /** - * Creates an ExecuteMultiFetchAsDBAResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteHookResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse + * @memberof vtctldata.ExecuteHookResponse * @static * @param {Object.} object Plain object - * @returns {vtctldata.ExecuteMultiFetchAsDBAResponse} ExecuteMultiFetchAsDBAResponse + * @returns {vtctldata.ExecuteHookResponse} ExecuteHookResponse */ - ExecuteMultiFetchAsDBAResponse.fromObject = function fromObject(object) { - if (object instanceof $root.vtctldata.ExecuteMultiFetchAsDBAResponse) + ExecuteHookResponse.fromObject = function fromObject(object) { + if (object instanceof $root.vtctldata.ExecuteHookResponse) return object; - let message = new $root.vtctldata.ExecuteMultiFetchAsDBAResponse(); - if (object.results) { - if (!Array.isArray(object.results)) - throw TypeError(".vtctldata.ExecuteMultiFetchAsDBAResponse.results: array expected"); - message.results = []; - for (let i = 0; i < object.results.length; ++i) { - if (typeof object.results[i] !== "object") - throw TypeError(".vtctldata.ExecuteMultiFetchAsDBAResponse.results: object expected"); - message.results[i] = $root.query.QueryResult.fromObject(object.results[i]); - } + let message = new $root.vtctldata.ExecuteHookResponse(); + if (object.hook_result != null) { + if (typeof object.hook_result !== "object") + throw TypeError(".vtctldata.ExecuteHookResponse.hook_result: object expected"); + message.hook_result = $root.tabletmanagerdata.ExecuteHookResponse.fromObject(object.hook_result); } return message; }; /** - * Creates a plain object from an ExecuteMultiFetchAsDBAResponse message. Also converts values to other types if specified. + * Creates a plain object from an ExecuteHookResponse message. Also converts values to other types if specified. * @function toObject - * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse + * @memberof vtctldata.ExecuteHookResponse * @static - * @param {vtctldata.ExecuteMultiFetchAsDBAResponse} message ExecuteMultiFetchAsDBAResponse + * @param {vtctldata.ExecuteHookResponse} message ExecuteHookResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecuteMultiFetchAsDBAResponse.toObject = function toObject(message, options) { + ExecuteHookResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.arrays || options.defaults) - object.results = []; - if (message.results && message.results.length) { - object.results = []; - for (let j = 0; j < message.results.length; ++j) - object.results[j] = $root.query.QueryResult.toObject(message.results[j], options); - } + if (options.defaults) + object.hook_result = null; + if (message.hook_result != null && message.hasOwnProperty("hook_result")) + object.hook_result = $root.tabletmanagerdata.ExecuteHookResponse.toObject(message.hook_result, options); return object; }; /** - * Converts this ExecuteMultiFetchAsDBAResponse to JSON. + * Converts this ExecuteHookResponse to JSON. * @function toJSON - * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse + * @memberof vtctldata.ExecuteHookResponse * @instance * @returns {Object.} JSON object */ - ExecuteMultiFetchAsDBAResponse.prototype.toJSON = function toJSON() { + ExecuteHookResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExecuteMultiFetchAsDBAResponse + * Gets the default type url for ExecuteHookResponse * @function getTypeUrl - * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse + * @memberof vtctldata.ExecuteHookResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExecuteMultiFetchAsDBAResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExecuteHookResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/vtctldata.ExecuteMultiFetchAsDBAResponse"; + return typeUrlPrefix + "/vtctldata.ExecuteHookResponse"; }; - return ExecuteMultiFetchAsDBAResponse; + return ExecuteHookResponse; })(); - vtctldata.ExecuteHookRequest = (function() { + vtctldata.ExecuteMultiFetchAsDBARequest = (function() { /** - * Properties of an ExecuteHookRequest. + * Properties of an ExecuteMultiFetchAsDBARequest. * @memberof vtctldata - * @interface IExecuteHookRequest - * @property {topodata.ITabletAlias|null} [tablet_alias] ExecuteHookRequest tablet_alias - * @property {tabletmanagerdata.IExecuteHookRequest|null} [tablet_hook_request] ExecuteHookRequest tablet_hook_request + * @interface IExecuteMultiFetchAsDBARequest + * @property {topodata.ITabletAlias|null} [tablet_alias] ExecuteMultiFetchAsDBARequest tablet_alias + * @property {string|null} [sql] ExecuteMultiFetchAsDBARequest sql + * @property {number|Long|null} [max_rows] ExecuteMultiFetchAsDBARequest max_rows + * @property {boolean|null} [disable_binlogs] ExecuteMultiFetchAsDBARequest disable_binlogs + * @property {boolean|null} [reload_schema] ExecuteMultiFetchAsDBARequest reload_schema */ /** - * Constructs a new ExecuteHookRequest. + * Constructs a new ExecuteMultiFetchAsDBARequest. * @memberof vtctldata - * @classdesc Represents an ExecuteHookRequest. - * @implements IExecuteHookRequest + * @classdesc Represents an ExecuteMultiFetchAsDBARequest. + * @implements IExecuteMultiFetchAsDBARequest * @constructor - * @param {vtctldata.IExecuteHookRequest=} [properties] Properties to set + * @param {vtctldata.IExecuteMultiFetchAsDBARequest=} [properties] Properties to set */ - function ExecuteHookRequest(properties) { + function ExecuteMultiFetchAsDBARequest(properties) { if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -125397,80 +125306,110 @@ export const vtctldata = $root.vtctldata = (() => { } /** - * ExecuteHookRequest tablet_alias. + * ExecuteMultiFetchAsDBARequest tablet_alias. * @member {topodata.ITabletAlias|null|undefined} tablet_alias - * @memberof vtctldata.ExecuteHookRequest + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest * @instance */ - ExecuteHookRequest.prototype.tablet_alias = null; + ExecuteMultiFetchAsDBARequest.prototype.tablet_alias = null; /** - * ExecuteHookRequest tablet_hook_request. - * @member {tabletmanagerdata.IExecuteHookRequest|null|undefined} tablet_hook_request - * @memberof vtctldata.ExecuteHookRequest + * ExecuteMultiFetchAsDBARequest sql. + * @member {string} sql + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest * @instance */ - ExecuteHookRequest.prototype.tablet_hook_request = null; + ExecuteMultiFetchAsDBARequest.prototype.sql = ""; /** - * Creates a new ExecuteHookRequest instance using the specified properties. + * ExecuteMultiFetchAsDBARequest max_rows. + * @member {number|Long} max_rows + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * @instance + */ + ExecuteMultiFetchAsDBARequest.prototype.max_rows = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ExecuteMultiFetchAsDBARequest disable_binlogs. + * @member {boolean} disable_binlogs + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * @instance + */ + ExecuteMultiFetchAsDBARequest.prototype.disable_binlogs = false; + + /** + * ExecuteMultiFetchAsDBARequest reload_schema. + * @member {boolean} reload_schema + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest + * @instance + */ + ExecuteMultiFetchAsDBARequest.prototype.reload_schema = false; + + /** + * Creates a new ExecuteMultiFetchAsDBARequest instance using the specified properties. * @function create - * @memberof vtctldata.ExecuteHookRequest + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest * @static - * @param {vtctldata.IExecuteHookRequest=} [properties] Properties to set - * @returns {vtctldata.ExecuteHookRequest} ExecuteHookRequest instance + * @param {vtctldata.IExecuteMultiFetchAsDBARequest=} [properties] Properties to set + * @returns {vtctldata.ExecuteMultiFetchAsDBARequest} ExecuteMultiFetchAsDBARequest instance */ - ExecuteHookRequest.create = function create(properties) { - return new ExecuteHookRequest(properties); + ExecuteMultiFetchAsDBARequest.create = function create(properties) { + return new ExecuteMultiFetchAsDBARequest(properties); }; /** - * Encodes the specified ExecuteHookRequest message. Does not implicitly {@link vtctldata.ExecuteHookRequest.verify|verify} messages. + * Encodes the specified ExecuteMultiFetchAsDBARequest message. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBARequest.verify|verify} messages. * @function encode - * @memberof vtctldata.ExecuteHookRequest + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest * @static - * @param {vtctldata.IExecuteHookRequest} message ExecuteHookRequest message or plain object to encode + * @param {vtctldata.IExecuteMultiFetchAsDBARequest} message ExecuteMultiFetchAsDBARequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteHookRequest.encode = function encode(message, writer) { + ExecuteMultiFetchAsDBARequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.tablet_alias != null && Object.hasOwnProperty.call(message, "tablet_alias")) $root.topodata.TabletAlias.encode(message.tablet_alias, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.tablet_hook_request != null && Object.hasOwnProperty.call(message, "tablet_hook_request")) - $root.tabletmanagerdata.ExecuteHookRequest.encode(message.tablet_hook_request, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sql); + if (message.max_rows != null && Object.hasOwnProperty.call(message, "max_rows")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.max_rows); + if (message.disable_binlogs != null && Object.hasOwnProperty.call(message, "disable_binlogs")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.disable_binlogs); + if (message.reload_schema != null && Object.hasOwnProperty.call(message, "reload_schema")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reload_schema); return writer; }; /** - * Encodes the specified ExecuteHookRequest message, length delimited. Does not implicitly {@link vtctldata.ExecuteHookRequest.verify|verify} messages. + * Encodes the specified ExecuteMultiFetchAsDBARequest message, length delimited. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBARequest.verify|verify} messages. * @function encodeDelimited - * @memberof vtctldata.ExecuteHookRequest + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest * @static - * @param {vtctldata.IExecuteHookRequest} message ExecuteHookRequest message or plain object to encode + * @param {vtctldata.IExecuteMultiFetchAsDBARequest} message ExecuteMultiFetchAsDBARequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteHookRequest.encodeDelimited = function encodeDelimited(message, writer) { + ExecuteMultiFetchAsDBARequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExecuteHookRequest message from the specified reader or buffer. + * Decodes an ExecuteMultiFetchAsDBARequest message from the specified reader or buffer. * @function decode - * @memberof vtctldata.ExecuteHookRequest + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {vtctldata.ExecuteHookRequest} ExecuteHookRequest + * @returns {vtctldata.ExecuteMultiFetchAsDBARequest} ExecuteMultiFetchAsDBARequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExecuteHookRequest.decode = function decode(reader, length) { + ExecuteMultiFetchAsDBARequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vtctldata.ExecuteHookRequest(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vtctldata.ExecuteMultiFetchAsDBARequest(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { @@ -125479,7 +125418,19 @@ export const vtctldata = $root.vtctldata = (() => { break; } case 2: { - message.tablet_hook_request = $root.tabletmanagerdata.ExecuteHookRequest.decode(reader, reader.uint32()); + message.sql = reader.string(); + break; + } + case 3: { + message.max_rows = reader.int64(); + break; + } + case 4: { + message.disable_binlogs = reader.bool(); + break; + } + case 5: { + message.reload_schema = reader.bool(); break; } default: @@ -125491,141 +125442,175 @@ export const vtctldata = $root.vtctldata = (() => { }; /** - * Decodes an ExecuteHookRequest message from the specified reader or buffer, length delimited. + * Decodes an ExecuteMultiFetchAsDBARequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof vtctldata.ExecuteHookRequest + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {vtctldata.ExecuteHookRequest} ExecuteHookRequest + * @returns {vtctldata.ExecuteMultiFetchAsDBARequest} ExecuteMultiFetchAsDBARequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExecuteHookRequest.decodeDelimited = function decodeDelimited(reader) { + ExecuteMultiFetchAsDBARequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExecuteHookRequest message. + * Verifies an ExecuteMultiFetchAsDBARequest message. * @function verify - * @memberof vtctldata.ExecuteHookRequest + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExecuteHookRequest.verify = function verify(message) { + ExecuteMultiFetchAsDBARequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tablet_alias != null && message.hasOwnProperty("tablet_alias")) { - let error = $root.topodata.TabletAlias.verify(message.tablet_alias); - if (error) - return "tablet_alias." + error; - } - if (message.tablet_hook_request != null && message.hasOwnProperty("tablet_hook_request")) { - let error = $root.tabletmanagerdata.ExecuteHookRequest.verify(message.tablet_hook_request); + if (message.tablet_alias != null && message.hasOwnProperty("tablet_alias")) { + let error = $root.topodata.TabletAlias.verify(message.tablet_alias); if (error) - return "tablet_hook_request." + error; + return "tablet_alias." + error; } + if (message.sql != null && message.hasOwnProperty("sql")) + if (!$util.isString(message.sql)) + return "sql: string expected"; + if (message.max_rows != null && message.hasOwnProperty("max_rows")) + if (!$util.isInteger(message.max_rows) && !(message.max_rows && $util.isInteger(message.max_rows.low) && $util.isInteger(message.max_rows.high))) + return "max_rows: integer|Long expected"; + if (message.disable_binlogs != null && message.hasOwnProperty("disable_binlogs")) + if (typeof message.disable_binlogs !== "boolean") + return "disable_binlogs: boolean expected"; + if (message.reload_schema != null && message.hasOwnProperty("reload_schema")) + if (typeof message.reload_schema !== "boolean") + return "reload_schema: boolean expected"; return null; }; /** - * Creates an ExecuteHookRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteMultiFetchAsDBARequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof vtctldata.ExecuteHookRequest + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest * @static * @param {Object.} object Plain object - * @returns {vtctldata.ExecuteHookRequest} ExecuteHookRequest + * @returns {vtctldata.ExecuteMultiFetchAsDBARequest} ExecuteMultiFetchAsDBARequest */ - ExecuteHookRequest.fromObject = function fromObject(object) { - if (object instanceof $root.vtctldata.ExecuteHookRequest) + ExecuteMultiFetchAsDBARequest.fromObject = function fromObject(object) { + if (object instanceof $root.vtctldata.ExecuteMultiFetchAsDBARequest) return object; - let message = new $root.vtctldata.ExecuteHookRequest(); + let message = new $root.vtctldata.ExecuteMultiFetchAsDBARequest(); if (object.tablet_alias != null) { if (typeof object.tablet_alias !== "object") - throw TypeError(".vtctldata.ExecuteHookRequest.tablet_alias: object expected"); + throw TypeError(".vtctldata.ExecuteMultiFetchAsDBARequest.tablet_alias: object expected"); message.tablet_alias = $root.topodata.TabletAlias.fromObject(object.tablet_alias); } - if (object.tablet_hook_request != null) { - if (typeof object.tablet_hook_request !== "object") - throw TypeError(".vtctldata.ExecuteHookRequest.tablet_hook_request: object expected"); - message.tablet_hook_request = $root.tabletmanagerdata.ExecuteHookRequest.fromObject(object.tablet_hook_request); - } + if (object.sql != null) + message.sql = String(object.sql); + if (object.max_rows != null) + if ($util.Long) + (message.max_rows = $util.Long.fromValue(object.max_rows)).unsigned = false; + else if (typeof object.max_rows === "string") + message.max_rows = parseInt(object.max_rows, 10); + else if (typeof object.max_rows === "number") + message.max_rows = object.max_rows; + else if (typeof object.max_rows === "object") + message.max_rows = new $util.LongBits(object.max_rows.low >>> 0, object.max_rows.high >>> 0).toNumber(); + if (object.disable_binlogs != null) + message.disable_binlogs = Boolean(object.disable_binlogs); + if (object.reload_schema != null) + message.reload_schema = Boolean(object.reload_schema); return message; }; /** - * Creates a plain object from an ExecuteHookRequest message. Also converts values to other types if specified. + * Creates a plain object from an ExecuteMultiFetchAsDBARequest message. Also converts values to other types if specified. * @function toObject - * @memberof vtctldata.ExecuteHookRequest + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest * @static - * @param {vtctldata.ExecuteHookRequest} message ExecuteHookRequest + * @param {vtctldata.ExecuteMultiFetchAsDBARequest} message ExecuteMultiFetchAsDBARequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecuteHookRequest.toObject = function toObject(message, options) { + ExecuteMultiFetchAsDBARequest.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; if (options.defaults) { object.tablet_alias = null; - object.tablet_hook_request = null; + object.sql = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.max_rows = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.max_rows = options.longs === String ? "0" : 0; + object.disable_binlogs = false; + object.reload_schema = false; } if (message.tablet_alias != null && message.hasOwnProperty("tablet_alias")) object.tablet_alias = $root.topodata.TabletAlias.toObject(message.tablet_alias, options); - if (message.tablet_hook_request != null && message.hasOwnProperty("tablet_hook_request")) - object.tablet_hook_request = $root.tabletmanagerdata.ExecuteHookRequest.toObject(message.tablet_hook_request, options); + if (message.sql != null && message.hasOwnProperty("sql")) + object.sql = message.sql; + if (message.max_rows != null && message.hasOwnProperty("max_rows")) + if (typeof message.max_rows === "number") + object.max_rows = options.longs === String ? String(message.max_rows) : message.max_rows; + else + object.max_rows = options.longs === String ? $util.Long.prototype.toString.call(message.max_rows) : options.longs === Number ? new $util.LongBits(message.max_rows.low >>> 0, message.max_rows.high >>> 0).toNumber() : message.max_rows; + if (message.disable_binlogs != null && message.hasOwnProperty("disable_binlogs")) + object.disable_binlogs = message.disable_binlogs; + if (message.reload_schema != null && message.hasOwnProperty("reload_schema")) + object.reload_schema = message.reload_schema; return object; }; /** - * Converts this ExecuteHookRequest to JSON. + * Converts this ExecuteMultiFetchAsDBARequest to JSON. * @function toJSON - * @memberof vtctldata.ExecuteHookRequest + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest * @instance * @returns {Object.} JSON object */ - ExecuteHookRequest.prototype.toJSON = function toJSON() { + ExecuteMultiFetchAsDBARequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExecuteHookRequest + * Gets the default type url for ExecuteMultiFetchAsDBARequest * @function getTypeUrl - * @memberof vtctldata.ExecuteHookRequest + * @memberof vtctldata.ExecuteMultiFetchAsDBARequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExecuteHookRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExecuteMultiFetchAsDBARequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/vtctldata.ExecuteHookRequest"; + return typeUrlPrefix + "/vtctldata.ExecuteMultiFetchAsDBARequest"; }; - return ExecuteHookRequest; + return ExecuteMultiFetchAsDBARequest; })(); - vtctldata.ExecuteHookResponse = (function() { + vtctldata.ExecuteMultiFetchAsDBAResponse = (function() { /** - * Properties of an ExecuteHookResponse. + * Properties of an ExecuteMultiFetchAsDBAResponse. * @memberof vtctldata - * @interface IExecuteHookResponse - * @property {tabletmanagerdata.IExecuteHookResponse|null} [hook_result] ExecuteHookResponse hook_result + * @interface IExecuteMultiFetchAsDBAResponse + * @property {Array.|null} [results] ExecuteMultiFetchAsDBAResponse results */ /** - * Constructs a new ExecuteHookResponse. + * Constructs a new ExecuteMultiFetchAsDBAResponse. * @memberof vtctldata - * @classdesc Represents an ExecuteHookResponse. - * @implements IExecuteHookResponse + * @classdesc Represents an ExecuteMultiFetchAsDBAResponse. + * @implements IExecuteMultiFetchAsDBAResponse * @constructor - * @param {vtctldata.IExecuteHookResponse=} [properties] Properties to set + * @param {vtctldata.IExecuteMultiFetchAsDBAResponse=} [properties] Properties to set */ - function ExecuteHookResponse(properties) { + function ExecuteMultiFetchAsDBAResponse(properties) { + this.results = []; if (properties) for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -125633,75 +125618,78 @@ export const vtctldata = $root.vtctldata = (() => { } /** - * ExecuteHookResponse hook_result. - * @member {tabletmanagerdata.IExecuteHookResponse|null|undefined} hook_result - * @memberof vtctldata.ExecuteHookResponse + * ExecuteMultiFetchAsDBAResponse results. + * @member {Array.} results + * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse * @instance */ - ExecuteHookResponse.prototype.hook_result = null; + ExecuteMultiFetchAsDBAResponse.prototype.results = $util.emptyArray; /** - * Creates a new ExecuteHookResponse instance using the specified properties. + * Creates a new ExecuteMultiFetchAsDBAResponse instance using the specified properties. * @function create - * @memberof vtctldata.ExecuteHookResponse + * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse * @static - * @param {vtctldata.IExecuteHookResponse=} [properties] Properties to set - * @returns {vtctldata.ExecuteHookResponse} ExecuteHookResponse instance + * @param {vtctldata.IExecuteMultiFetchAsDBAResponse=} [properties] Properties to set + * @returns {vtctldata.ExecuteMultiFetchAsDBAResponse} ExecuteMultiFetchAsDBAResponse instance */ - ExecuteHookResponse.create = function create(properties) { - return new ExecuteHookResponse(properties); + ExecuteMultiFetchAsDBAResponse.create = function create(properties) { + return new ExecuteMultiFetchAsDBAResponse(properties); }; /** - * Encodes the specified ExecuteHookResponse message. Does not implicitly {@link vtctldata.ExecuteHookResponse.verify|verify} messages. + * Encodes the specified ExecuteMultiFetchAsDBAResponse message. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBAResponse.verify|verify} messages. * @function encode - * @memberof vtctldata.ExecuteHookResponse + * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse * @static - * @param {vtctldata.IExecuteHookResponse} message ExecuteHookResponse message or plain object to encode + * @param {vtctldata.IExecuteMultiFetchAsDBAResponse} message ExecuteMultiFetchAsDBAResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteHookResponse.encode = function encode(message, writer) { + ExecuteMultiFetchAsDBAResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.hook_result != null && Object.hasOwnProperty.call(message, "hook_result")) - $root.tabletmanagerdata.ExecuteHookResponse.encode(message.hook_result, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.results != null && message.results.length) + for (let i = 0; i < message.results.length; ++i) + $root.query.QueryResult.encode(message.results[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ExecuteHookResponse message, length delimited. Does not implicitly {@link vtctldata.ExecuteHookResponse.verify|verify} messages. + * Encodes the specified ExecuteMultiFetchAsDBAResponse message, length delimited. Does not implicitly {@link vtctldata.ExecuteMultiFetchAsDBAResponse.verify|verify} messages. * @function encodeDelimited - * @memberof vtctldata.ExecuteHookResponse + * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse * @static - * @param {vtctldata.IExecuteHookResponse} message ExecuteHookResponse message or plain object to encode + * @param {vtctldata.IExecuteMultiFetchAsDBAResponse} message ExecuteMultiFetchAsDBAResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExecuteHookResponse.encodeDelimited = function encodeDelimited(message, writer) { + ExecuteMultiFetchAsDBAResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExecuteHookResponse message from the specified reader or buffer. + * Decodes an ExecuteMultiFetchAsDBAResponse message from the specified reader or buffer. * @function decode - * @memberof vtctldata.ExecuteHookResponse + * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {vtctldata.ExecuteHookResponse} ExecuteHookResponse + * @returns {vtctldata.ExecuteMultiFetchAsDBAResponse} ExecuteMultiFetchAsDBAResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExecuteHookResponse.decode = function decode(reader, length) { + ExecuteMultiFetchAsDBAResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vtctldata.ExecuteHookResponse(); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.vtctldata.ExecuteMultiFetchAsDBAResponse(); while (reader.pos < end) { let tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.hook_result = $root.tabletmanagerdata.ExecuteHookResponse.decode(reader, reader.uint32()); + if (!(message.results && message.results.length)) + message.results = []; + message.results.push($root.query.QueryResult.decode(reader, reader.uint32())); break; } default: @@ -125713,107 +125701,119 @@ export const vtctldata = $root.vtctldata = (() => { }; /** - * Decodes an ExecuteHookResponse message from the specified reader or buffer, length delimited. + * Decodes an ExecuteMultiFetchAsDBAResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof vtctldata.ExecuteHookResponse + * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {vtctldata.ExecuteHookResponse} ExecuteHookResponse + * @returns {vtctldata.ExecuteMultiFetchAsDBAResponse} ExecuteMultiFetchAsDBAResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExecuteHookResponse.decodeDelimited = function decodeDelimited(reader) { + ExecuteMultiFetchAsDBAResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExecuteHookResponse message. + * Verifies an ExecuteMultiFetchAsDBAResponse message. * @function verify - * @memberof vtctldata.ExecuteHookResponse + * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExecuteHookResponse.verify = function verify(message) { + ExecuteMultiFetchAsDBAResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.hook_result != null && message.hasOwnProperty("hook_result")) { - let error = $root.tabletmanagerdata.ExecuteHookResponse.verify(message.hook_result); - if (error) - return "hook_result." + error; + if (message.results != null && message.hasOwnProperty("results")) { + if (!Array.isArray(message.results)) + return "results: array expected"; + for (let i = 0; i < message.results.length; ++i) { + let error = $root.query.QueryResult.verify(message.results[i]); + if (error) + return "results." + error; + } } return null; }; /** - * Creates an ExecuteHookResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExecuteMultiFetchAsDBAResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof vtctldata.ExecuteHookResponse + * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse * @static * @param {Object.} object Plain object - * @returns {vtctldata.ExecuteHookResponse} ExecuteHookResponse + * @returns {vtctldata.ExecuteMultiFetchAsDBAResponse} ExecuteMultiFetchAsDBAResponse */ - ExecuteHookResponse.fromObject = function fromObject(object) { - if (object instanceof $root.vtctldata.ExecuteHookResponse) + ExecuteMultiFetchAsDBAResponse.fromObject = function fromObject(object) { + if (object instanceof $root.vtctldata.ExecuteMultiFetchAsDBAResponse) return object; - let message = new $root.vtctldata.ExecuteHookResponse(); - if (object.hook_result != null) { - if (typeof object.hook_result !== "object") - throw TypeError(".vtctldata.ExecuteHookResponse.hook_result: object expected"); - message.hook_result = $root.tabletmanagerdata.ExecuteHookResponse.fromObject(object.hook_result); + let message = new $root.vtctldata.ExecuteMultiFetchAsDBAResponse(); + if (object.results) { + if (!Array.isArray(object.results)) + throw TypeError(".vtctldata.ExecuteMultiFetchAsDBAResponse.results: array expected"); + message.results = []; + for (let i = 0; i < object.results.length; ++i) { + if (typeof object.results[i] !== "object") + throw TypeError(".vtctldata.ExecuteMultiFetchAsDBAResponse.results: object expected"); + message.results[i] = $root.query.QueryResult.fromObject(object.results[i]); + } } return message; }; /** - * Creates a plain object from an ExecuteHookResponse message. Also converts values to other types if specified. + * Creates a plain object from an ExecuteMultiFetchAsDBAResponse message. Also converts values to other types if specified. * @function toObject - * @memberof vtctldata.ExecuteHookResponse + * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse * @static - * @param {vtctldata.ExecuteHookResponse} message ExecuteHookResponse + * @param {vtctldata.ExecuteMultiFetchAsDBAResponse} message ExecuteMultiFetchAsDBAResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExecuteHookResponse.toObject = function toObject(message, options) { + ExecuteMultiFetchAsDBAResponse.toObject = function toObject(message, options) { if (!options) options = {}; let object = {}; - if (options.defaults) - object.hook_result = null; - if (message.hook_result != null && message.hasOwnProperty("hook_result")) - object.hook_result = $root.tabletmanagerdata.ExecuteHookResponse.toObject(message.hook_result, options); + if (options.arrays || options.defaults) + object.results = []; + if (message.results && message.results.length) { + object.results = []; + for (let j = 0; j < message.results.length; ++j) + object.results[j] = $root.query.QueryResult.toObject(message.results[j], options); + } return object; }; /** - * Converts this ExecuteHookResponse to JSON. + * Converts this ExecuteMultiFetchAsDBAResponse to JSON. * @function toJSON - * @memberof vtctldata.ExecuteHookResponse + * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse * @instance * @returns {Object.} JSON object */ - ExecuteHookResponse.prototype.toJSON = function toJSON() { + ExecuteMultiFetchAsDBAResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExecuteHookResponse + * Gets the default type url for ExecuteMultiFetchAsDBAResponse * @function getTypeUrl - * @memberof vtctldata.ExecuteHookResponse + * @memberof vtctldata.ExecuteMultiFetchAsDBAResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExecuteHookResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExecuteMultiFetchAsDBAResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/vtctldata.ExecuteHookResponse"; + return typeUrlPrefix + "/vtctldata.ExecuteMultiFetchAsDBAResponse"; }; - return ExecuteHookResponse; + return ExecuteMultiFetchAsDBAResponse; })(); vtctldata.FindAllShardsInKeyspaceRequest = (function() { From 11f2a4e60ce0429d6581c7976c6e92e5631e83c7 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Sun, 24 Mar 2024 13:13:53 -0400 Subject: [PATCH 06/22] Generate vtctldclient RPC client code from vtctlservice protobufs on make proto (#15561) Signed-off-by: Matt Lord --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 850430c36ee..6b14719ac10 100644 --- a/Makefile +++ b/Makefile @@ -257,7 +257,7 @@ PROTO_SRCS = $(wildcard proto/*.proto) PROTO_SRC_NAMES = $(basename $(notdir $(PROTO_SRCS))) PROTO_GO_OUTS = $(foreach name, $(PROTO_SRC_NAMES), go/vt/proto/$(name)/$(name).pb.go) # This rule rebuilds all the go files from the proto definitions for gRPC. -proto: $(PROTO_GO_OUTS) vtadmin_web_proto_types +proto: $(PROTO_GO_OUTS) vtadmin_web_proto_types vtctldclient ifndef NOBANNER echo $$(date): Compiling proto definitions From 54ef7b223c6e3a75bae85af565aa28d914f1e191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicent=20Mart=C3=AD?= <42793+vmg@users.noreply.github.com> Date: Mon, 25 Mar 2024 10:12:32 +0100 Subject: [PATCH 07/22] logstats: do not allocate memory while logging (#15539) Signed-off-by: Vicent Marti --- go/logstats/logger.go | 217 ++++++++++++++++++ go/vt/vtgate/logstats/logstats.go | 122 +++++----- go/vt/vtgate/logstats/logstats_test.go | 17 +- go/vt/vttablet/filelogger/filelogger_test.go | 2 +- .../sysloglogger/sysloglogger_test.go | 2 +- .../tabletserver/tabletenv/logstats.go | 106 +++++---- .../tabletserver/tabletenv/logstats_test.go | 8 +- 7 files changed, 343 insertions(+), 131 deletions(-) create mode 100644 go/logstats/logger.go diff --git a/go/logstats/logger.go b/go/logstats/logger.go new file mode 100644 index 00000000000..90e208e7703 --- /dev/null +++ b/go/logstats/logger.go @@ -0,0 +1,217 @@ +/* +Copyright 2024 The Vitess Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package logstats + +import ( + "io" + "slices" + "strconv" + "strings" + "sync" + "time" + + "vitess.io/vitess/go/hack" + "vitess.io/vitess/go/sqltypes" + querypb "vitess.io/vitess/go/vt/proto/query" +) + +type logbv struct { + Name string + BVar *querypb.BindVariable +} + +// Logger is a zero-allocation logger for logstats. +// It can output logs as JSON or as plaintext, following the commonly used +// logstats format that is shared between the tablets and the gates. +type Logger struct { + b []byte + bvars []logbv + n int + json bool +} + +func sortBVars(sorted []logbv, bvars map[string]*querypb.BindVariable) []logbv { + for k, bv := range bvars { + sorted = append(sorted, logbv{k, bv}) + } + slices.SortFunc(sorted, func(a, b logbv) int { + return strings.Compare(a.Name, b.Name) + }) + return sorted +} + +func (log *Logger) appendBVarsJSON(b []byte, bvars map[string]*querypb.BindVariable, full bool) []byte { + log.bvars = sortBVars(log.bvars[:0], bvars) + + b = append(b, '{') + for i, bv := range log.bvars { + if i > 0 { + b = append(b, ',', ' ') + } + b = strconv.AppendQuote(b, bv.Name) + b = append(b, `: {"type": `...) + b = strconv.AppendQuote(b, querypb.Type_name[int32(bv.BVar.Type)]) + b = append(b, `, "value": `...) + + if sqltypes.IsIntegral(bv.BVar.Type) || sqltypes.IsFloat(bv.BVar.Type) { + b = append(b, bv.BVar.Value...) + } else if bv.BVar.Type == sqltypes.Tuple { + b = append(b, '"') + b = strconv.AppendInt(b, int64(len(bv.BVar.Values)), 10) + b = append(b, ` items"`...) + } else { + if full { + b = strconv.AppendQuote(b, hack.String(bv.BVar.Value)) + } else { + b = append(b, '"') + b = strconv.AppendInt(b, int64(len(bv.BVar.Values)), 10) + b = append(b, ` bytes"`...) + } + } + b = append(b, '}') + } + return append(b, '}') +} + +func (log *Logger) Init(json bool) { + log.n = 0 + log.json = json + if log.json { + log.b = append(log.b, '{') + } +} + +func (log *Logger) Redacted() { + log.String("[REDACTED]") +} + +func (log *Logger) Key(key string) { + if log.json { + if log.n > 0 { + log.b = append(log.b, ',', ' ') + } + log.b = append(log.b, '"') + log.b = append(log.b, key...) + log.b = append(log.b, '"', ':', ' ') + } else { + if log.n > 0 { + log.b = append(log.b, '\t') + } + } + log.n++ +} + +func (log *Logger) StringUnquoted(value string) { + if log.json { + log.b = strconv.AppendQuote(log.b, value) + } else { + log.b = append(log.b, value...) + } +} + +func (log *Logger) TabTerminated() { + if !log.json { + log.b = append(log.b, '\t') + } +} + +func (log *Logger) String(value string) { + log.b = strconv.AppendQuote(log.b, value) +} + +func (log *Logger) StringSingleQuoted(value string) { + if log.json { + log.b = strconv.AppendQuote(log.b, value) + } else { + log.b = append(log.b, '\'') + log.b = append(log.b, value...) + log.b = append(log.b, '\'') + } +} + +func (log *Logger) Time(t time.Time) { + const timeFormat = "2006-01-02 15:04:05.000000" + if log.json { + log.b = append(log.b, '"') + log.b = t.AppendFormat(log.b, timeFormat) + log.b = append(log.b, '"') + } else { + log.b = t.AppendFormat(log.b, timeFormat) + } +} + +func (log *Logger) Duration(t time.Duration) { + log.b = strconv.AppendFloat(log.b, t.Seconds(), 'f', 6, 64) +} + +func (log *Logger) BindVariables(bvars map[string]*querypb.BindVariable, full bool) { + // the bind variables are printed as JSON in text mode because the original + // printing syntax, which was simply `fmt.Sprintf("%v")`, is not stable or + // safe to parse + log.b = log.appendBVarsJSON(log.b, bvars, full) +} + +func (log *Logger) Int(i int64) { + log.b = strconv.AppendInt(log.b, i, 10) +} + +func (log *Logger) Uint(u uint64) { + log.b = strconv.AppendUint(log.b, u, 10) +} + +func (log *Logger) Bool(b bool) { + log.b = strconv.AppendBool(log.b, b) +} + +func (log *Logger) Strings(strs []string) { + log.b = append(log.b, '[') + for i, t := range strs { + if i > 0 { + log.b = append(log.b, ',') + } + log.b = strconv.AppendQuote(log.b, t) + } + log.b = append(log.b, ']') +} + +func (log *Logger) Flush(w io.Writer) (err error) { + if log.json { + log.b = append(log.b, '}') + } + log.b = append(log.b, '\n') + _, err = w.Write(log.b) + + clear(log.bvars) + log.bvars = log.bvars[:0] + log.b = log.b[:0] + log.n = 0 + + loggerPool.Put(log) + return err +} + +var loggerPool = sync.Pool{New: func() any { + return &Logger{} +}} + +// NewLogger returns a new Logger instance to perform logstats logging. +// The logger must be initialized with (*Logger).Init before usage and +// flushed with (*Logger).Flush once all the key-values have been written +// to it. +func NewLogger() *Logger { + return loggerPool.Get().(*Logger) +} diff --git a/go/vt/vtgate/logstats/logstats.go b/go/vt/vtgate/logstats/logstats.go index 5ea7820a72e..8f8ba41e3cd 100644 --- a/go/vt/vtgate/logstats/logstats.go +++ b/go/vt/vtgate/logstats/logstats.go @@ -18,21 +18,16 @@ package logstats import ( "context" - "encoding/json" - "fmt" "io" "net/url" "time" "github.com/google/safehtml" - "vitess.io/vitess/go/sqltypes" + "vitess.io/vitess/go/logstats" "vitess.io/vitess/go/streamlog" - "vitess.io/vitess/go/tb" "vitess.io/vitess/go/vt/callerid" "vitess.io/vitess/go/vt/callinfo" - "vitess.io/vitess/go/vt/log" - querypb "vitess.io/vitess/go/vt/proto/query" ) @@ -128,69 +123,60 @@ func (stats *LogStats) Logf(w io.Writer, params url.Values) error { return nil } - // FormatBindVariables call might panic so we're going to catch it here - // and print out the stack trace for debugging. - defer func() { - if x := recover(); x != nil { - log.Errorf("Uncaught panic:\n%v\n%s", x, tb.Stack(4)) - } - }() - - formattedBindVars := "\"[REDACTED]\"" - if !streamlog.GetRedactDebugUIQueries() { - _, fullBindParams := params["full"] - formattedBindVars = sqltypes.FormatBindVariables( - stats.BindVariables, - fullBindParams, - streamlog.GetQueryLogFormat() == streamlog.QueryLogFormatJSON, - ) - } - - // TODO: remove username here we fully enforce immediate caller id + redacted := streamlog.GetRedactDebugUIQueries() + _, fullBindParams := params["full"] remoteAddr, username := stats.RemoteAddrUsername() - var fmtString string - switch streamlog.GetQueryLogFormat() { - case streamlog.QueryLogFormatText: - fmtString = "%v\t%v\t%v\t'%v'\t'%v'\t%v\t%v\t%.6f\t%.6f\t%.6f\t%.6f\t%v\t%q\t%v\t%v\t%v\t%q\t%q\t%q\t%v\t%v\t%q\n" - case streamlog.QueryLogFormatJSON: - fmtString = "{\"Method\": %q, \"RemoteAddr\": %q, \"Username\": %q, \"ImmediateCaller\": %q, \"Effective Caller\": %q, \"Start\": \"%v\", \"End\": \"%v\", \"TotalTime\": %.6f, \"PlanTime\": %v, \"ExecuteTime\": %v, \"CommitTime\": %v, \"StmtType\": %q, \"SQL\": %q, \"BindVars\": %v, \"ShardQueries\": %v, \"RowsAffected\": %v, \"Error\": %q, \"TabletType\": %q, \"SessionUUID\": %q, \"Cached Plan\": %v, \"TablesUsed\": %v, \"ActiveKeyspace\": %q}\n" - } - - tables := stats.TablesUsed - if tables == nil { - tables = []string{} - } - tablesUsed, marshalErr := json.Marshal(tables) - if marshalErr != nil { - return marshalErr + log := logstats.NewLogger() + log.Init(streamlog.GetQueryLogFormat() == streamlog.QueryLogFormatJSON) + log.Key("Method") + log.StringUnquoted(stats.Method) + log.Key("RemoteAddr") + log.StringUnquoted(remoteAddr) + log.Key("Username") + log.StringUnquoted(username) + log.Key("ImmediateCaller") + log.StringSingleQuoted(stats.ImmediateCaller()) + log.Key("Effective Caller") + log.StringSingleQuoted(stats.EffectiveCaller()) + log.Key("Start") + log.Time(stats.StartTime) + log.Key("End") + log.Time(stats.EndTime) + log.Key("TotalTime") + log.Duration(stats.TotalTime()) + log.Key("PlanTime") + log.Duration(stats.PlanTime) + log.Key("ExecuteTime") + log.Duration(stats.ExecuteTime) + log.Key("CommitTime") + log.Duration(stats.CommitTime) + log.Key("StmtType") + log.StringUnquoted(stats.StmtType) + log.Key("SQL") + log.String(stats.SQL) + log.Key("BindVars") + if redacted { + log.Redacted() + } else { + log.BindVariables(stats.BindVariables, fullBindParams) } - _, err := fmt.Fprintf( - w, - fmtString, - stats.Method, - remoteAddr, - username, - stats.ImmediateCaller(), - stats.EffectiveCaller(), - stats.StartTime.Format("2006-01-02 15:04:05.000000"), - stats.EndTime.Format("2006-01-02 15:04:05.000000"), - stats.TotalTime().Seconds(), - stats.PlanTime.Seconds(), - stats.ExecuteTime.Seconds(), - stats.CommitTime.Seconds(), - stats.StmtType, - stats.SQL, - formattedBindVars, - stats.ShardQueries, - stats.RowsAffected, - stats.ErrorStr(), - stats.TabletType, - stats.SessionUUID, - stats.CachedPlan, - string(tablesUsed), - stats.ActiveKeyspace, - ) - - return err + log.Key("ShardQueries") + log.Uint(stats.ShardQueries) + log.Key("RowsAffected") + log.Uint(stats.RowsAffected) + log.Key("Error") + log.String(stats.ErrorStr()) + log.Key("TabletType") + log.String(stats.TabletType) + log.Key("SessionUUID") + log.String(stats.SessionUUID) + log.Key("Cached Plan") + log.Bool(stats.CachedPlan) + log.Key("TablesUsed") + log.Strings(stats.TablesUsed) + log.Key("ActiveKeyspace") + log.String(stats.ActiveKeyspace) + + return log.Flush(w) } diff --git a/go/vt/vtgate/logstats/logstats_test.go b/go/vt/vtgate/logstats/logstats_test.go index dbe49b200b8..ae3c01e0f0b 100644 --- a/go/vt/vtgate/logstats/logstats_test.go +++ b/go/vt/vtgate/logstats/logstats_test.go @@ -79,7 +79,7 @@ func TestLogStatsFormat(t *testing.T) { { // 0 redact: false, format: "text", - expected: "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1\"\tmap[intVal:type:INT64 value:\"1\"]\t0\t0\t\"\"\t\"PRIMARY\"\t\"suuid\"\tfalse\t[\"ks1.tbl1\",\"ks2.tbl2\"]\t\"db\"\n", + expected: "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1\"\t{\"intVal\": {\"type\": \"INT64\", \"value\": 1}}\t0\t0\t\"\"\t\"PRIMARY\"\t\"suuid\"\tfalse\t[\"ks1.tbl1\",\"ks2.tbl2\"]\t\"db\"\n", bindVars: intBindVar, }, { // 1 redact: true, @@ -99,7 +99,7 @@ func TestLogStatsFormat(t *testing.T) { }, { // 4 redact: false, format: "text", - expected: "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1\"\tmap[strVal:type:VARCHAR value:\"abc\"]\t0\t0\t\"\"\t\"PRIMARY\"\t\"suuid\"\tfalse\t[\"ks1.tbl1\",\"ks2.tbl2\"]\t\"db\"\n", + expected: "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1\"\t{\"strVal\": {\"type\": \"VARCHAR\", \"value\": \"abc\"}}\t0\t0\t\"\"\t\"PRIMARY\"\t\"suuid\"\tfalse\t[\"ks1.tbl1\",\"ks2.tbl2\"]\t\"db\"\n", bindVars: stringBindVar, }, { // 5 redact: true, @@ -129,14 +129,13 @@ func TestLogStatsFormat(t *testing.T) { streamlog.SetQueryLogFormat(test.format) if test.format == "text" { got := testFormat(t, logStats, params) + t.Logf("got: %s", got) assert.Equal(t, test.expected, got) - for _, variable := range logStats.BindVariables { - fmt.Println("->" + fmt.Sprintf("%v", variable)) - } return } got := testFormat(t, logStats, params) + t.Logf("got: %s", got) var parsed map[string]any err := json.Unmarshal([]byte(got), &parsed) assert.NoError(t, err) @@ -157,12 +156,12 @@ func TestLogStatsFilter(t *testing.T) { params := map[string][]string{"full": {}} got := testFormat(t, logStats, params) - want := "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1 /* LOG_THIS_QUERY */\"\tmap[intVal:type:INT64 value:\"1\"]\t0\t0\t\"\"\t\"\"\t\"\"\tfalse\t[]\t\"\"\n" + want := "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1 /* LOG_THIS_QUERY */\"\t{\"intVal\": {\"type\": \"INT64\", \"value\": 1}}\t0\t0\t\"\"\t\"\"\t\"\"\tfalse\t[]\t\"\"\n" assert.Equal(t, want, got) streamlog.SetQueryLogFilterTag("LOG_THIS_QUERY") got = testFormat(t, logStats, params) - want = "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1 /* LOG_THIS_QUERY */\"\tmap[intVal:type:INT64 value:\"1\"]\t0\t0\t\"\"\t\"\"\t\"\"\tfalse\t[]\t\"\"\n" + want = "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1 /* LOG_THIS_QUERY */\"\t{\"intVal\": {\"type\": \"INT64\", \"value\": 1}}\t0\t0\t\"\"\t\"\"\t\"\"\tfalse\t[]\t\"\"\n" assert.Equal(t, want, got) streamlog.SetQueryLogFilterTag("NOT_THIS_QUERY") @@ -180,12 +179,12 @@ func TestLogStatsRowThreshold(t *testing.T) { params := map[string][]string{"full": {}} got := testFormat(t, logStats, params) - want := "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1 /* LOG_THIS_QUERY */\"\tmap[intVal:type:INT64 value:\"1\"]\t0\t0\t\"\"\t\"\"\t\"\"\tfalse\t[]\t\"\"\n" + want := "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1 /* LOG_THIS_QUERY */\"\t{\"intVal\": {\"type\": \"INT64\", \"value\": 1}}\t0\t0\t\"\"\t\"\"\t\"\"\tfalse\t[]\t\"\"\n" assert.Equal(t, want, got) streamlog.SetQueryLogRowThreshold(0) got = testFormat(t, logStats, params) - want = "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1 /* LOG_THIS_QUERY */\"\tmap[intVal:type:INT64 value:\"1\"]\t0\t0\t\"\"\t\"\"\t\"\"\tfalse\t[]\t\"\"\n" + want = "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t0.000000\t0.000000\t0.000000\t\t\"sql1 /* LOG_THIS_QUERY */\"\t{\"intVal\": {\"type\": \"INT64\", \"value\": 1}}\t0\t0\t\"\"\t\"\"\t\"\"\tfalse\t[]\t\"\"\n" assert.Equal(t, want, got) streamlog.SetQueryLogRowThreshold(1) got = testFormat(t, logStats, params) diff --git a/go/vt/vttablet/filelogger/filelogger_test.go b/go/vt/vttablet/filelogger/filelogger_test.go index 1562c9626a8..f747ebba93b 100644 --- a/go/vt/vttablet/filelogger/filelogger_test.go +++ b/go/vt/vttablet/filelogger/filelogger_test.go @@ -60,7 +60,7 @@ func TestFileLog(t *testing.T) { for i := 0; i < 10; i++ { time.Sleep(10 * time.Millisecond) - want := "\t\t\t''\t''\t0001-01-01 00:00:00.000000\t0001-01-01 00:00:00.000000\t0.000000\t\t\"test 1\"\tmap[]\t1\t\"test 1 PII\"\tmysql\t0.000000\t0.000000\t0\t0\t0\t\"\"\t\n\t\t\t''\t''\t0001-01-01 00:00:00.000000\t0001-01-01 00:00:00.000000\t0.000000\t\t\"test 2\"\tmap[]\t1\t\"test 2 PII\"\tmysql\t0.000000\t0.000000\t0\t0\t0\t\"\"\t\n" + want := "\t\t\t''\t''\t0001-01-01 00:00:00.000000\t0001-01-01 00:00:00.000000\t0.000000\t\t\"test 1\"\t{}\t1\t\"test 1 PII\"\tmysql\t0.000000\t0.000000\t0\t0\t0\t\"\"\t\n\t\t\t''\t''\t0001-01-01 00:00:00.000000\t0001-01-01 00:00:00.000000\t0.000000\t\t\"test 2\"\t{}\t1\t\"test 2 PII\"\tmysql\t0.000000\t0.000000\t0\t0\t0\t\"\"\t\n" contents, _ := os.ReadFile(logPath) got := string(contents) if want == got { diff --git a/go/vt/vttablet/sysloglogger/sysloglogger_test.go b/go/vt/vttablet/sysloglogger/sysloglogger_test.go index 7a1678638ca..3a06b98ed1c 100644 --- a/go/vt/vttablet/sysloglogger/sysloglogger_test.go +++ b/go/vt/vttablet/sysloglogger/sysloglogger_test.go @@ -87,7 +87,7 @@ func (fw *failingFakeWriter) Close() error { return nil } // expectedLogStatsText returns the results expected from the plugin processing a dummy message generated by mockLogStats(...). func expectedLogStatsText(originalSQL string) string { return fmt.Sprintf("Execute\t\t\t''\t''\t0001-01-01 00:00:00.000000\t0001-01-01 00:00:00.000000\t0.000000\tPASS_SELECT\t"+ - "\"%s\"\t%s\t1\t\"%s\"\tmysql\t0.000000\t0.000000\t0\t0\t0\t\"\"", originalSQL, "map[]", originalSQL) + "\"%s\"\t%s\t1\t\"%s\"\tmysql\t0.000000\t0.000000\t0\t0\t0\t\"\"", originalSQL, "{}", originalSQL) } // expectedRedactedLogStatsText returns the results expected from the plugin processing a dummy message generated by mockLogStats(...) diff --git a/go/vt/vttablet/tabletserver/tabletenv/logstats.go b/go/vt/vttablet/tabletserver/tabletenv/logstats.go index 962b5f0b122..ad7e09de169 100644 --- a/go/vt/vttablet/tabletserver/tabletenv/logstats.go +++ b/go/vt/vttablet/tabletserver/tabletenv/logstats.go @@ -18,7 +18,6 @@ package tabletenv import ( "context" - "fmt" "io" "net/url" "strings" @@ -26,6 +25,7 @@ import ( "github.com/google/safehtml" + "vitess.io/vitess/go/logstats" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/streamlog" "vitess.io/vitess/go/vt/callerid" @@ -181,55 +181,65 @@ func (stats *LogStats) Logf(w io.Writer, params url.Values) error { return nil } - rewrittenSQL := "[REDACTED]" - formattedBindVars := "\"[REDACTED]\"" - - if !streamlog.GetRedactDebugUIQueries() { - rewrittenSQL = stats.RewrittenSQL() - - _, fullBindParams := params["full"] - formattedBindVars = sqltypes.FormatBindVariables( - stats.BindVariables, - fullBindParams, - streamlog.GetQueryLogFormat() == streamlog.QueryLogFormatJSON, - ) - } - + redacted := streamlog.GetRedactDebugUIQueries() + _, fullBindParams := params["full"] // TODO: remove username here we fully enforce immediate caller id callInfo, username := stats.CallInfo() - // Valid options for the QueryLogFormat are text or json - var fmtString string - switch streamlog.GetQueryLogFormat() { - case streamlog.QueryLogFormatText: - fmtString = "%v\t%v\t%v\t'%v'\t'%v'\t%v\t%v\t%.6f\t%v\t%q\t%v\t%v\t%q\t%v\t%.6f\t%.6f\t%v\t%v\t%v\t%q\t\n" - case streamlog.QueryLogFormatJSON: - fmtString = "{\"Method\": %q, \"CallInfo\": %q, \"Username\": %q, \"ImmediateCaller\": %q, \"Effective Caller\": %q, \"Start\": \"%v\", \"End\": \"%v\", \"TotalTime\": %.6f, \"PlanType\": %q, \"OriginalSQL\": %q, \"BindVars\": %v, \"Queries\": %v, \"RewrittenSQL\": %q, \"QuerySources\": %q, \"MysqlTime\": %.6f, \"ConnWaitTime\": %.6f, \"RowsAffected\": %v,\"TransactionID\": %v,\"ResponseSize\": %v, \"Error\": %q}\n" + log := logstats.NewLogger() + log.Init(streamlog.GetQueryLogFormat() == streamlog.QueryLogFormatJSON) + log.Key("Method") + log.StringUnquoted(stats.Method) + log.Key("CallInfo") + log.StringUnquoted(callInfo) + log.Key("Username") + log.StringUnquoted(username) + log.Key("ImmediateCaller") + log.StringSingleQuoted(stats.ImmediateCaller()) + log.Key("Effective Caller") + log.StringSingleQuoted(stats.EffectiveCaller()) + log.Key("Start") + log.Time(stats.StartTime) + log.Key("End") + log.Time(stats.EndTime) + log.Key("TotalTime") + log.Duration(stats.TotalTime()) + log.Key("PlanType") + log.StringUnquoted(stats.PlanType) + log.Key("OriginalSQL") + log.String(stats.OriginalSQL) + log.Key("BindVars") + if redacted { + log.Redacted() + } else { + log.BindVariables(stats.BindVariables, fullBindParams) } - - _, err := fmt.Fprintf( - w, - fmtString, - stats.Method, - callInfo, - username, - stats.ImmediateCaller(), - stats.EffectiveCaller(), - stats.StartTime.Format("2006-01-02 15:04:05.000000"), - stats.EndTime.Format("2006-01-02 15:04:05.000000"), - stats.TotalTime().Seconds(), - stats.PlanType, - stats.OriginalSQL, - formattedBindVars, - stats.NumberOfQueries, - rewrittenSQL, - stats.FmtQuerySources(), - stats.MysqlResponseTime.Seconds(), - stats.WaitingForConnection.Seconds(), - stats.RowsAffected, - stats.TransactionID, - stats.SizeOfResponse(), - stats.ErrorStr(), - ) - return err + log.Key("Queries") + log.Int(int64(stats.NumberOfQueries)) + log.Key("RewrittenSQL") + if redacted { + log.Redacted() + } else { + log.String(stats.RewrittenSQL()) + } + log.Key("QuerySources") + log.StringUnquoted(stats.FmtQuerySources()) + log.Key("MysqlTime") + log.Duration(stats.MysqlResponseTime) + log.Key("ConnWaitTime") + log.Duration(stats.WaitingForConnection) + log.Key("RowsAffected") + log.Uint(uint64(stats.RowsAffected)) + log.Key("TransactionID") + log.Int(stats.TransactionID) + log.Key("ResponseSize") + log.Int(int64(stats.SizeOfResponse())) + log.Key("Error") + log.String(stats.ErrorStr()) + + // logstats from the vttablet are always tab-terminated; keep this for backwards + // compatibility for existing parsers + log.TabTerminated() + + return log.Flush(w) } diff --git a/go/vt/vttablet/tabletserver/tabletenv/logstats_test.go b/go/vt/vttablet/tabletserver/tabletenv/logstats_test.go index 51e056687b5..7412a0a436c 100644 --- a/go/vt/vttablet/tabletserver/tabletenv/logstats_test.go +++ b/go/vt/vttablet/tabletserver/tabletenv/logstats_test.go @@ -73,7 +73,7 @@ func TestLogStatsFormat(t *testing.T) { streamlog.SetRedactDebugUIQueries(false) streamlog.SetQueryLogFormat("text") got := testFormat(logStats, url.Values(params)) - want := "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t\t\"sql\"\tmap[intVal:type:INT64 value:\"1\"]\t1\t\"sql with pii\"\tmysql\t0.000000\t0.000000\t0\t12345\t1\t\"\"\t\n" + want := "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t\t\"sql\"\t{\"intVal\": {\"type\": \"INT64\", \"value\": 1}}\t1\t\"sql with pii\"\tmysql\t0.000000\t0.000000\t0\t12345\t1\t\"\"\t\n" if got != want { t.Errorf("logstats format: got:\n%q\nwant:\n%q\n", got, want) } @@ -127,7 +127,7 @@ func TestLogStatsFormat(t *testing.T) { streamlog.SetQueryLogFormat("text") got = testFormat(logStats, url.Values(params)) - want = "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t\t\"sql\"\tmap[strVal:type:VARCHAR value:\"abc\"]\t1\t\"sql with pii\"\tmysql\t0.000000\t0.000000\t0\t12345\t1\t\"\"\t\n" + want = "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t\t\"sql\"\t{\"strVal\": {\"type\": \"VARCHAR\", \"value\": \"abc\"}}\t1\t\"sql with pii\"\tmysql\t0.000000\t0.000000\t0\t12345\t1\t\"\"\t\n" if got != want { t.Errorf("logstats format: got:\n%q\nwant:\n%q\n", got, want) } @@ -164,14 +164,14 @@ func TestLogStatsFilter(t *testing.T) { params := map[string][]string{"full": {}} got := testFormat(logStats, url.Values(params)) - want := "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t\t\"sql /* LOG_THIS_QUERY */\"\tmap[intVal:type:INT64 value:\"1\"]\t1\t\"sql with pii\"\tmysql\t0.000000\t0.000000\t0\t0\t1\t\"\"\t\n" + want := "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t\t\"sql /* LOG_THIS_QUERY */\"\t{\"intVal\": {\"type\": \"INT64\", \"value\": 1}}\t1\t\"sql with pii\"\tmysql\t0.000000\t0.000000\t0\t0\t1\t\"\"\t\n" if got != want { t.Errorf("logstats format: got:\n%q\nwant:\n%q\n", got, want) } streamlog.SetQueryLogFilterTag("LOG_THIS_QUERY") got = testFormat(logStats, url.Values(params)) - want = "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t\t\"sql /* LOG_THIS_QUERY */\"\tmap[intVal:type:INT64 value:\"1\"]\t1\t\"sql with pii\"\tmysql\t0.000000\t0.000000\t0\t0\t1\t\"\"\t\n" + want = "test\t\t\t''\t''\t2017-01-01 01:02:03.000000\t2017-01-01 01:02:04.000001\t1.000001\t\t\"sql /* LOG_THIS_QUERY */\"\t{\"intVal\": {\"type\": \"INT64\", \"value\": 1}}\t1\t\"sql with pii\"\tmysql\t0.000000\t0.000000\t0\t0\t1\t\"\"\t\n" if got != want { t.Errorf("logstats format: got:\n%q\nwant:\n%q\n", got, want) } From b3d45fdb5be936f3815ff8e3efcb3af4c1afe06d Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Mon, 25 Mar 2024 12:19:58 +0200 Subject: [PATCH 08/22] Configurable incremental restore files path (#15451) Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/flags/endtoend/vtbackup.txt | 1 + go/flags/endtoend/vtcombo.txt | 1 + go/flags/endtoend/vtctld.txt | 1 + go/flags/endtoend/vttablet.txt | 1 + go/flags/endtoend/vttestserver.txt | 1 + go/vt/mysqlctl/builtinbackupengine.go | 9 ++++++++- 6 files changed, 13 insertions(+), 1 deletion(-) diff --git a/go/flags/endtoend/vtbackup.txt b/go/flags/endtoend/vtbackup.txt index 1b9f5aca61f..a814cd80342 100644 --- a/go/flags/endtoend/vtbackup.txt +++ b/go/flags/endtoend/vtbackup.txt @@ -58,6 +58,7 @@ Flags: --bind-address string Bind address for the server. If empty, the server will listen on all available unicast and anycast IP addresses of the local system. --builtinbackup-file-read-buffer-size uint read files using an IO buffer of this many bytes. Golang defaults are used when set to 0. --builtinbackup-file-write-buffer-size uint write files using an IO buffer of this many bytes. Golang defaults are used when set to 0. (default 2097152) + --builtinbackup-incremental-restore-path string the directory where incremental restore files, namely binlog files, are extracted to. In k8s environments, this should be set to a directory that is shared between the vttablet and mysqld pods. The path should exist. When empty, the default OS temp dir is assumed. --builtinbackup_mysqld_timeout duration how long to wait for mysqld to shutdown at the start of the backup. (default 10m0s) --builtinbackup_progress duration how often to send progress updates when backing up large files. (default 5s) --ceph_backup_storage_config string Path to JSON config file for ceph backup storage. (default "ceph_backup_config.json") diff --git a/go/flags/endtoend/vtcombo.txt b/go/flags/endtoend/vtcombo.txt index ee759218d9c..763f91b0ca9 100644 --- a/go/flags/endtoend/vtcombo.txt +++ b/go/flags/endtoend/vtcombo.txt @@ -38,6 +38,7 @@ Flags: --buffer_window duration Duration for how long a request should be buffered at most. (default 10s) --builtinbackup-file-read-buffer-size uint read files using an IO buffer of this many bytes. Golang defaults are used when set to 0. --builtinbackup-file-write-buffer-size uint write files using an IO buffer of this many bytes. Golang defaults are used when set to 0. (default 2097152) + --builtinbackup-incremental-restore-path string the directory where incremental restore files, namely binlog files, are extracted to. In k8s environments, this should be set to a directory that is shared between the vttablet and mysqld pods. The path should exist. When empty, the default OS temp dir is assumed. --builtinbackup_mysqld_timeout duration how long to wait for mysqld to shutdown at the start of the backup. (default 10m0s) --builtinbackup_progress duration how often to send progress updates when backing up large files. (default 5s) --catch-sigpipe catch and ignore SIGPIPE on stdout and stderr if specified diff --git a/go/flags/endtoend/vtctld.txt b/go/flags/endtoend/vtctld.txt index e0f552d2b00..969e4f9774e 100644 --- a/go/flags/endtoend/vtctld.txt +++ b/go/flags/endtoend/vtctld.txt @@ -37,6 +37,7 @@ Flags: --bind-address string Bind address for the server. If empty, the server will listen on all available unicast and anycast IP addresses of the local system. --builtinbackup-file-read-buffer-size uint read files using an IO buffer of this many bytes. Golang defaults are used when set to 0. --builtinbackup-file-write-buffer-size uint write files using an IO buffer of this many bytes. Golang defaults are used when set to 0. (default 2097152) + --builtinbackup-incremental-restore-path string the directory where incremental restore files, namely binlog files, are extracted to. In k8s environments, this should be set to a directory that is shared between the vttablet and mysqld pods. The path should exist. When empty, the default OS temp dir is assumed. --builtinbackup_mysqld_timeout duration how long to wait for mysqld to shutdown at the start of the backup. (default 10m0s) --builtinbackup_progress duration how often to send progress updates when backing up large files. (default 5s) --catch-sigpipe catch and ignore SIGPIPE on stdout and stderr if specified diff --git a/go/flags/endtoend/vttablet.txt b/go/flags/endtoend/vttablet.txt index 9f089275aba..86883ec544b 100644 --- a/go/flags/endtoend/vttablet.txt +++ b/go/flags/endtoend/vttablet.txt @@ -72,6 +72,7 @@ Flags: --binlog_user string PITR restore parameter: username of binlog server. --builtinbackup-file-read-buffer-size uint read files using an IO buffer of this many bytes. Golang defaults are used when set to 0. --builtinbackup-file-write-buffer-size uint write files using an IO buffer of this many bytes. Golang defaults are used when set to 0. (default 2097152) + --builtinbackup-incremental-restore-path string the directory where incremental restore files, namely binlog files, are extracted to. In k8s environments, this should be set to a directory that is shared between the vttablet and mysqld pods. The path should exist. When empty, the default OS temp dir is assumed. --builtinbackup_mysqld_timeout duration how long to wait for mysqld to shutdown at the start of the backup. (default 10m0s) --builtinbackup_progress duration how often to send progress updates when backing up large files. (default 5s) --catch-sigpipe catch and ignore SIGPIPE on stdout and stderr if specified diff --git a/go/flags/endtoend/vttestserver.txt b/go/flags/endtoend/vttestserver.txt index 7c0df363c15..2683fb70171 100644 --- a/go/flags/endtoend/vttestserver.txt +++ b/go/flags/endtoend/vttestserver.txt @@ -13,6 +13,7 @@ Flags: --backup_storage_number_blocks int if backup_storage_compress is true, backup_storage_number_blocks sets the number of blocks that can be processed, in parallel, before the writer blocks, during compression (default is 2). It should be equal to the number of CPUs available for compression. (default 2) --builtinbackup-file-read-buffer-size uint read files using an IO buffer of this many bytes. Golang defaults are used when set to 0. --builtinbackup-file-write-buffer-size uint write files using an IO buffer of this many bytes. Golang defaults are used when set to 0. (default 2097152) + --builtinbackup-incremental-restore-path string the directory where incremental restore files, namely binlog files, are extracted to. In k8s environments, this should be set to a directory that is shared between the vttablet and mysqld pods. The path should exist. When empty, the default OS temp dir is assumed. --builtinbackup_mysqld_timeout duration how long to wait for mysqld to shutdown at the start of the backup. (default 10m0s) --builtinbackup_progress duration how often to send progress updates when backing up large files. (default 5s) --catch-sigpipe catch and ignore SIGPIPE on stdout and stderr if specified diff --git a/go/vt/mysqlctl/builtinbackupengine.go b/go/vt/mysqlctl/builtinbackupengine.go index 0ffcd1aba76..5cdf39084da 100644 --- a/go/vt/mysqlctl/builtinbackupengine.go +++ b/go/vt/mysqlctl/builtinbackupengine.go @@ -80,6 +80,12 @@ var ( // engines during backups. The backupstorage may be a physical file, // network, or something else. builtinBackupStorageWriteBufferSize = 2 * 1024 * 1024 /* 2 MiB */ + + // The directory where incremental restore files, namely binlog files, are extracted to. + // In k8s environments, this should be set to a directory that is shared between the vttablet and mysqld pods. + // The path should exist. + // When empty, the default OS temp dir is assumed. + builtinIncrementalRestorePath = "" ) // BuiltinBackupEngine encapsulates the logic of the builtin engine @@ -157,6 +163,7 @@ func registerBuiltinBackupEngineFlags(fs *pflag.FlagSet) { fs.DurationVar(&builtinBackupProgress, "builtinbackup_progress", builtinBackupProgress, "how often to send progress updates when backing up large files.") fs.UintVar(&builtinBackupFileReadBufferSize, "builtinbackup-file-read-buffer-size", builtinBackupFileReadBufferSize, "read files using an IO buffer of this many bytes. Golang defaults are used when set to 0.") fs.UintVar(&builtinBackupFileWriteBufferSize, "builtinbackup-file-write-buffer-size", builtinBackupFileWriteBufferSize, "write files using an IO buffer of this many bytes. Golang defaults are used when set to 0.") + fs.StringVar(&builtinIncrementalRestorePath, "builtinbackup-incremental-restore-path", builtinIncrementalRestorePath, "the directory where incremental restore files, namely binlog files, are extracted to. In k8s environments, this should be set to a directory that is shared between the vttablet and mysqld pods. The path should exist. When empty, the default OS temp dir is assumed.") } // fullPath returns the full path of the entry, based on its type @@ -1006,7 +1013,7 @@ func (be *BuiltinBackupEngine) restoreFiles(ctx context.Context, params RestoreP } if bm.Incremental { - createdDir, err = os.MkdirTemp("", "restore-incremental-*") + createdDir, err = os.MkdirTemp(builtinIncrementalRestorePath, "restore-incremental-*") if err != nil { return "", err } From 6a181783b66b0fffd80a5250863b01e824a5acd4 Mon Sep 17 00:00:00 2001 From: Manan Gupta <35839558+GuptaManan100@users.noreply.github.com> Date: Tue, 26 Mar 2024 09:53:24 +0530 Subject: [PATCH 09/22] Filter tablet map using valid candidates before reparenting to intermediate source (#15540) --- .../reparentutil/emergency_reparenter.go | 11 +- .../reparentutil/emergency_reparenter_test.go | 180 +++++++++++++++++- 2 files changed, 188 insertions(+), 3 deletions(-) diff --git a/go/vt/vtctl/reparentutil/emergency_reparenter.go b/go/vt/vtctl/reparentutil/emergency_reparenter.go index 607fec700b5..631ea709016 100644 --- a/go/vt/vtctl/reparentutil/emergency_reparenter.go +++ b/go/vt/vtctl/reparentutil/emergency_reparenter.go @@ -449,9 +449,16 @@ func (erp *EmergencyReparenter) promoteIntermediateSource( validCandidateTablets []*topodatapb.Tablet, opts EmergencyReparentOptions, ) ([]*topodatapb.Tablet, error) { - // we reparent all the other tablets to start replication from our new source + // Create a tablet map from all the valid replicas + validTabletMap := map[string]*topo.TabletInfo{} + for _, candidate := range validCandidateTablets { + alias := topoproto.TabletAliasString(candidate.Alias) + validTabletMap[alias] = tabletMap[alias] + } + + // we reparent all the other valid tablets to start replication from our new source // we wait for all the replicas so that we can choose a better candidate from the ones that started replication later - reachableTablets, err := erp.reparentReplicas(ctx, ev, source, tabletMap, statusMap, opts, true /* waitForAllReplicas */, false /* populateReparentJournal */) + reachableTablets, err := erp.reparentReplicas(ctx, ev, source, validTabletMap, statusMap, opts, true /* waitForAllReplicas */, false /* populateReparentJournal */) if err != nil { return nil, err } diff --git a/go/vt/vtctl/reparentutil/emergency_reparenter_test.go b/go/vt/vtctl/reparentutil/emergency_reparenter_test.go index 8e793bcf6d5..8976a8d1b8f 100644 --- a/go/vt/vtctl/reparentutil/emergency_reparenter_test.go +++ b/go/vt/vtctl/reparentutil/emergency_reparenter_test.go @@ -3715,6 +3715,184 @@ func TestEmergencyReparenter_promoteIntermediateSource(t *testing.T) { }, Hostname: "requires force start", }, + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 404, + }, + }, + }, + }, + { + name: "success - filter with valid tablets before", + emergencyReparentOps: EmergencyReparentOptions{}, + tmc: &testutil.TabletManagerClient{ + PopulateReparentJournalResults: map[string]error{ + "zone1-0000000100": nil, + }, + PrimaryPositionResults: map[string]struct { + Position string + Error error + }{ + "zone1-0000000100": { + Error: nil, + }, + }, + SetReplicationSourceResults: map[string]error{ + "zone1-0000000101": nil, + }, + }, + newSourceTabletAlias: "zone1-0000000100", + tabletMap: map[string]*topo.TabletInfo{ + "zone1-0000000100": { + Tablet: &topodatapb.Tablet{ + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Hostname: "primary-elect", + }, + }, + "zone1-0000000101": { + Tablet: &topodatapb.Tablet{ + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 101, + }, + }, + }, + "zone1-0000000102": { + Tablet: &topodatapb.Tablet{ + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 102, + }, + Hostname: "requires force start", + }, + }, + "zone1-0000000404": { + Tablet: &topodatapb.Tablet{ + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 404, + }, + Hostname: "ignored tablet", + }, + }, + }, + statusMap: map[string]*replicationdatapb.StopReplicationStatus{ + "zone1-0000000101": { // forceStart = false + Before: &replicationdatapb.Status{ + IoState: int32(replication.ReplicationStateStopped), + SqlState: int32(replication.ReplicationStateStopped), + }, + }, + }, + keyspace: "testkeyspace", + shard: "-", + shouldErr: false, + result: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Hostname: "primary-elect", + }, { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 101, + }, + }, + }, + validCandidateTablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Hostname: "primary-elect", + }, { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 101, + }, + }, + }, + }, { + name: "success - only 2 tablets and they error", + emergencyReparentOps: EmergencyReparentOptions{}, + tmc: &testutil.TabletManagerClient{ + PopulateReparentJournalResults: map[string]error{ + "zone1-0000000100": nil, + }, + PrimaryPositionResults: map[string]struct { + Position string + Error error + }{ + "zone1-0000000100": { + Error: nil, + }, + }, + SetReplicationSourceResults: map[string]error{ + "zone1-0000000101": fmt.Errorf("An error"), + }, + }, + newSourceTabletAlias: "zone1-0000000100", + tabletMap: map[string]*topo.TabletInfo{ + "zone1-0000000100": { + Tablet: &topodatapb.Tablet{ + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Hostname: "primary-elect", + }, + }, + "zone1-0000000101": { + Tablet: &topodatapb.Tablet{ + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 101, + }, + }, + }, + "zone1-0000000102": { + Tablet: &topodatapb.Tablet{ + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 102, + }, + Hostname: "requires force start", + }, + }, + }, + statusMap: map[string]*replicationdatapb.StopReplicationStatus{}, + keyspace: "testkeyspace", + shard: "-", + shouldErr: false, + result: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Hostname: "primary-elect", + }, + }, + validCandidateTablets: []*topodatapb.Tablet{ + { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 100, + }, + Hostname: "primary-elect", + }, { + Alias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 101, + }, + }, }, }, { @@ -3757,7 +3935,7 @@ func TestEmergencyReparenter_promoteIntermediateSource(t *testing.T) { }, }, }, - "zone1-00000000102": { + "zone1-0000000102": { Tablet: &topodatapb.Tablet{ Alias: &topodatapb.TabletAlias{ Cell: "zone1", From 90c005775353401710768899f3b77257696f0c15 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Tue, 26 Mar 2024 08:14:09 +0200 Subject: [PATCH 10/22] Dedicated poolDialer logic for VTOrc, throttler (#15562) Signed-off-by: Manan Gupta Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Co-authored-by: Manan Gupta --- go/test/endtoend/vtorc/general/vtorc_test.go | 73 ++++++++ go/test/endtoend/vtorc/utils/utils.go | 2 +- go/vt/vttablet/grpctmclient/client.go | 79 ++++++++- go/vt/vttablet/grpctmclient/client_test.go | 177 +++++++++++++++++++ 4 files changed, 321 insertions(+), 10 deletions(-) create mode 100644 go/vt/vttablet/grpctmclient/client_test.go diff --git a/go/test/endtoend/vtorc/general/vtorc_test.go b/go/test/endtoend/vtorc/general/vtorc_test.go index d79e2964f3e..38bc5f34df9 100644 --- a/go/test/endtoend/vtorc/general/vtorc_test.go +++ b/go/test/endtoend/vtorc/general/vtorc_test.go @@ -495,3 +495,76 @@ func TestDurabilityPolicySetLater(t *testing.T) { assert.NotNil(t, primary, "should have elected a primary") utils.CheckReplication(t, newCluster, primary, shard0.Vttablets, 10*time.Second) } + +func TestFullStatusConnectionPooling(t *testing.T) { + defer utils.PrintVTOrcLogsOnFailure(t, clusterInfo.ClusterInstance) + defer cluster.PanicHandler(t) + utils.SetupVttabletsAndVTOrcs(t, clusterInfo, 4, 0, []string{ + "--tablet_manager_grpc_concurrency=1", + }, cluster.VTOrcConfiguration{ + PreventCrossDataCenterPrimaryFailover: true, + }, 1, "") + keyspace := &clusterInfo.ClusterInstance.Keyspaces[0] + shard0 := &keyspace.Shards[0] + vtorc := clusterInfo.ClusterInstance.VTOrcProcesses[0] + + // find primary from topo + curPrimary := utils.ShardPrimaryTablet(t, clusterInfo, keyspace, shard0) + assert.NotNil(t, curPrimary, "should have elected a primary") + vtOrcProcess := clusterInfo.ClusterInstance.VTOrcProcesses[0] + utils.WaitForSuccessfulRecoveryCount(t, vtOrcProcess, logic.ElectNewPrimaryRecoveryName, 1) + utils.WaitForSuccessfulPRSCount(t, vtOrcProcess, keyspace.Name, shard0.Name, 1) + + // Kill the current primary. + _ = curPrimary.VttabletProcess.Kill() + + // Wait until VTOrc notices some problems + status, resp := utils.MakeAPICallRetry(t, vtorc, "/api/replication-analysis", func(_ int, response string) bool { + return response == "null" + }) + assert.Equal(t, 200, status) + assert.Contains(t, resp, "UnreachablePrimary") + + time.Sleep(1 * time.Minute) + + // Change the primaries ports and restart it. + curPrimary.VttabletProcess.Port = clusterInfo.ClusterInstance.GetAndReservePort() + curPrimary.VttabletProcess.GrpcPort = clusterInfo.ClusterInstance.GetAndReservePort() + err := curPrimary.VttabletProcess.Setup() + require.NoError(t, err) + + // See that VTOrc eventually reports no errors. + // Wait until there are no problems and the api endpoint returns null + status, resp = utils.MakeAPICallRetry(t, vtorc, "/api/replication-analysis", func(_ int, response string) bool { + return response != "null" + }) + assert.Equal(t, 200, status) + assert.Equal(t, "null", resp) + + // REPEATED + // Kill the current primary. + _ = curPrimary.VttabletProcess.Kill() + + // Wait until VTOrc notices some problems + status, resp = utils.MakeAPICallRetry(t, vtorc, "/api/replication-analysis", func(_ int, response string) bool { + return response == "null" + }) + assert.Equal(t, 200, status) + assert.Contains(t, resp, "UnreachablePrimary") + + time.Sleep(1 * time.Minute) + + // Change the primaries ports back to original and restart it. + curPrimary.VttabletProcess.Port = curPrimary.HTTPPort + curPrimary.VttabletProcess.GrpcPort = curPrimary.GrpcPort + err = curPrimary.VttabletProcess.Setup() + require.NoError(t, err) + + // See that VTOrc eventually reports no errors. + // Wait until there are no problems and the api endpoint returns null + status, resp = utils.MakeAPICallRetry(t, vtorc, "/api/replication-analysis", func(_ int, response string) bool { + return response != "null" + }) + assert.Equal(t, 200, status) + assert.Equal(t, "null", resp) +} diff --git a/go/test/endtoend/vtorc/utils/utils.go b/go/test/endtoend/vtorc/utils/utils.go index dca2c7b1e26..00f75740338 100644 --- a/go/test/endtoend/vtorc/utils/utils.go +++ b/go/test/endtoend/vtorc/utils/utils.go @@ -733,7 +733,7 @@ func MakeAPICall(t *testing.T, vtorc *cluster.VTOrcProcess, url string) (status // The function provided takes in the status and response and returns if we should continue to retry or not func MakeAPICallRetry(t *testing.T, vtorc *cluster.VTOrcProcess, url string, retry func(int, string) bool) (status int, response string) { t.Helper() - timeout := time.After(10 * time.Second) + timeout := time.After(30 * time.Second) for { select { case <-timeout: diff --git a/go/vt/vttablet/grpctmclient/client.go b/go/vt/vttablet/grpctmclient/client.go index d8ae032bd74..dac6c7e0822 100644 --- a/go/vt/vttablet/grpctmclient/client.go +++ b/go/vt/vttablet/grpctmclient/client.go @@ -45,6 +45,15 @@ import ( topodatapb "vitess.io/vitess/go/vt/proto/topodata" ) +type DialPoolGroup int + +const ( + dialPoolGroupThrottler DialPoolGroup = iota + dialPoolGroupVTOrc +) + +type invalidatorFunc func() + var ( concurrency = 8 cert string @@ -92,14 +101,17 @@ type tmc struct { client tabletmanagerservicepb.TabletManagerClient } +type addrTmcMap map[string]*tmc + // grpcClient implements both dialer and poolDialer. type grpcClient struct { // This cache of connections is to maximize QPS for ExecuteFetchAs{Dba,App}, // CheckThrottler and FullStatus. Note we'll keep the clients open and close them upon Close() only. // But that's OK because usually the tasks that use them are one-purpose only. // The map is protected by the mutex. - mu sync.Mutex - rpcClientMap map[string]chan *tmc + mu sync.Mutex + rpcClientMap map[string]chan *tmc + rpcDialPoolMap map[DialPoolGroup]addrTmcMap } type dialer interface { @@ -109,6 +121,7 @@ type dialer interface { type poolDialer interface { dialPool(ctx context.Context, tablet *topodatapb.Tablet) (tabletmanagerservicepb.TabletManagerClient, error) + dialDedicatedPool(ctx context.Context, dialPoolGroup DialPoolGroup, tablet *topodatapb.Tablet) (tabletmanagerservicepb.TabletManagerClient, invalidatorFunc, error) } // Client implements tmclient.TabletManagerClient. @@ -152,6 +165,17 @@ func (client *grpcClient) dial(ctx context.Context, tablet *topodatapb.Tablet) ( return tabletmanagerservicepb.NewTabletManagerClient(cc), cc, nil } +func (client *grpcClient) createTmc(addr string, opt grpc.DialOption) (*tmc, error) { + cc, err := grpcclient.Dial(addr, grpcclient.FailFast(false), opt) + if err != nil { + return nil, err + } + return &tmc{ + cc: cc, + client: tabletmanagerservicepb.NewTabletManagerClient(cc), + }, nil +} + func (client *grpcClient) dialPool(ctx context.Context, tablet *topodatapb.Tablet) (tabletmanagerservicepb.TabletManagerClient, error) { addr := netutil.JoinHostPort(tablet.Hostname, int32(tablet.PortMap["grpc"])) opt, err := grpcclient.SecureDialOption(cert, key, ca, crl, name) @@ -170,14 +194,11 @@ func (client *grpcClient) dialPool(ctx context.Context, tablet *topodatapb.Table client.mu.Unlock() for i := 0; i < cap(c); i++ { - cc, err := grpcclient.Dial(addr, grpcclient.FailFast(false), opt) + tm, err := client.createTmc(addr, opt) if err != nil { return nil, err } - c <- &tmc{ - cc: cc, - client: tabletmanagerservicepb.NewTabletManagerClient(cc), - } + c <- tm } } else { client.mu.Unlock() @@ -188,6 +209,38 @@ func (client *grpcClient) dialPool(ctx context.Context, tablet *topodatapb.Table return result.client, nil } +func (client *grpcClient) dialDedicatedPool(ctx context.Context, dialPoolGroup DialPoolGroup, tablet *topodatapb.Tablet) (tabletmanagerservicepb.TabletManagerClient, invalidatorFunc, error) { + addr := netutil.JoinHostPort(tablet.Hostname, int32(tablet.PortMap["grpc"])) + opt, err := grpcclient.SecureDialOption(cert, key, ca, crl, name) + if err != nil { + return nil, nil, err + } + + client.mu.Lock() + defer client.mu.Unlock() + if client.rpcDialPoolMap == nil { + client.rpcDialPoolMap = make(map[DialPoolGroup]addrTmcMap) + } + if _, ok := client.rpcDialPoolMap[dialPoolGroup]; !ok { + client.rpcDialPoolMap[dialPoolGroup] = make(addrTmcMap) + } + m := client.rpcDialPoolMap[dialPoolGroup] + if _, ok := m[addr]; !ok { + tm, err := client.createTmc(addr, opt) + if err != nil { + return nil, nil, err + } + m[addr] = tm + } + invalidator := func() { + client.mu.Lock() + defer client.mu.Unlock() + m[addr].cc.Close() + delete(m, addr) + } + return m[addr].client, invalidator, nil +} + // Close is part of the tmclient.TabletManagerClient interface. func (client *grpcClient) Close() { client.mu.Lock() @@ -611,9 +664,10 @@ func (client *Client) ReplicationStatus(ctx context.Context, tablet *topodatapb. // and dialing the other tablet every time is not practical. func (client *Client) FullStatus(ctx context.Context, tablet *topodatapb.Tablet) (*replicationdatapb.FullStatus, error) { var c tabletmanagerservicepb.TabletManagerClient + var invalidator invalidatorFunc var err error if poolDialer, ok := client.dialer.(poolDialer); ok { - c, err = poolDialer.dialPool(ctx, tablet) + c, invalidator, err = poolDialer.dialDedicatedPool(ctx, dialPoolGroupVTOrc, tablet) if err != nil { return nil, err } @@ -630,6 +684,9 @@ func (client *Client) FullStatus(ctx context.Context, tablet *topodatapb.Tablet) response, err := c.FullStatus(ctx, &tabletmanagerdatapb.FullStatusRequest{}) if err != nil { + if invalidator != nil { + invalidator() + } return nil, err } return response.Status, nil @@ -1101,9 +1158,10 @@ func (client *Client) Backup(ctx context.Context, tablet *topodatapb.Tablet, req // and dialing the other tablet every time is not practical. func (client *Client) CheckThrottler(ctx context.Context, tablet *topodatapb.Tablet, req *tabletmanagerdatapb.CheckThrottlerRequest) (*tabletmanagerdatapb.CheckThrottlerResponse, error) { var c tabletmanagerservicepb.TabletManagerClient + var invalidator invalidatorFunc var err error if poolDialer, ok := client.dialer.(poolDialer); ok { - c, err = poolDialer.dialPool(ctx, tablet) + c, invalidator, err = poolDialer.dialDedicatedPool(ctx, dialPoolGroupThrottler, tablet) if err != nil { return nil, err } @@ -1120,6 +1178,9 @@ func (client *Client) CheckThrottler(ctx context.Context, tablet *topodatapb.Tab response, err := c.CheckThrottler(ctx, req) if err != nil { + if invalidator != nil { + invalidator() + } return nil, err } return response, nil diff --git a/go/vt/vttablet/grpctmclient/client_test.go b/go/vt/vttablet/grpctmclient/client_test.go new file mode 100644 index 00000000000..f842b216d8c --- /dev/null +++ b/go/vt/vttablet/grpctmclient/client_test.go @@ -0,0 +1,177 @@ +/* +Copyright 2024 The Vitess Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package grpctmclient + +import ( + "context" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "google.golang.org/grpc/connectivity" + + "vitess.io/vitess/go/netutil" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" +) + +func TestDialDedicatedPool(t *testing.T) { + ctx := context.Background() + client := NewClient() + tablet := &topodatapb.Tablet{ + Hostname: "localhost", + PortMap: map[string]int32{ + "grpc": 15991, + }, + } + addr := netutil.JoinHostPort(tablet.Hostname, int32(tablet.PortMap["grpc"])) + t.Run("dialPool", func(t *testing.T) { + poolDialer, ok := client.dialer.(poolDialer) + require.True(t, ok) + + cli, invalidator, err := poolDialer.dialDedicatedPool(ctx, dialPoolGroupThrottler, tablet) + assert.NoError(t, err) + assert.NotNil(t, invalidator) + assert.NotNil(t, cli) + }) + + var cachedTmc *tmc + t.Run("maps", func(t *testing.T) { + rpcClient, ok := client.dialer.(*grpcClient) + require.True(t, ok) + assert.NotEmpty(t, rpcClient.rpcDialPoolMap) + assert.NotEmpty(t, rpcClient.rpcDialPoolMap[dialPoolGroupThrottler]) + assert.Empty(t, rpcClient.rpcDialPoolMap[dialPoolGroupVTOrc]) + + c := rpcClient.rpcDialPoolMap[dialPoolGroupThrottler][addr] + assert.NotNil(t, c) + assert.Contains(t, []connectivity.State{connectivity.Connecting, connectivity.TransientFailure}, c.cc.GetState()) + + cachedTmc = c + }) + + t.Run("CheckThrottler", func(t *testing.T) { + ctx, cancel := context.WithTimeout(ctx, time.Second) + defer cancel() + + req := &tabletmanagerdatapb.CheckThrottlerRequest{} + _, err := client.CheckThrottler(ctx, tablet, req) + assert.Error(t, err) + }) + t.Run("empty map", func(t *testing.T) { + rpcClient, ok := client.dialer.(*grpcClient) + require.True(t, ok) + assert.NotEmpty(t, rpcClient.rpcDialPoolMap) + assert.Empty(t, rpcClient.rpcDialPoolMap[dialPoolGroupThrottler]) + assert.Empty(t, rpcClient.rpcDialPoolMap[dialPoolGroupVTOrc]) + + assert.Equal(t, connectivity.Shutdown, cachedTmc.cc.GetState()) + }) +} + +func TestDialPool(t *testing.T) { + ctx := context.Background() + client := NewClient() + tablet := &topodatapb.Tablet{ + Hostname: "localhost", + PortMap: map[string]int32{ + "grpc": 15991, + }, + } + addr := netutil.JoinHostPort(tablet.Hostname, int32(tablet.PortMap["grpc"])) + t.Run("dialPool", func(t *testing.T) { + poolDialer, ok := client.dialer.(poolDialer) + require.True(t, ok) + + cli, err := poolDialer.dialPool(ctx, tablet) + assert.NoError(t, err) + assert.NotNil(t, cli) + }) + + var cachedTmc *tmc + t.Run("maps", func(t *testing.T) { + rpcClient, ok := client.dialer.(*grpcClient) + require.True(t, ok) + assert.Empty(t, rpcClient.rpcDialPoolMap) + assert.Empty(t, rpcClient.rpcDialPoolMap[dialPoolGroupThrottler]) + assert.Empty(t, rpcClient.rpcDialPoolMap[dialPoolGroupVTOrc]) + + assert.NotEmpty(t, rpcClient.rpcClientMap) + assert.NotEmpty(t, rpcClient.rpcClientMap[addr]) + + ch := rpcClient.rpcClientMap[addr] + cachedTmc = <-ch + ch <- cachedTmc + + assert.NotNil(t, cachedTmc) + assert.Contains(t, []connectivity.State{connectivity.Connecting, connectivity.TransientFailure}, cachedTmc.cc.GetState()) + }) + + t.Run("CheckThrottler", func(t *testing.T) { + ctx, cancel := context.WithTimeout(ctx, time.Second) + defer cancel() + + req := &tabletmanagerdatapb.CheckThrottlerRequest{} + _, err := client.CheckThrottler(ctx, tablet, req) + assert.Error(t, err) + }) + t.Run("post throttler maps", func(t *testing.T) { + rpcClient, ok := client.dialer.(*grpcClient) + require.True(t, ok) + + rpcClient.mu.Lock() + defer rpcClient.mu.Unlock() + + assert.NotEmpty(t, rpcClient.rpcDialPoolMap) + assert.Empty(t, rpcClient.rpcDialPoolMap[dialPoolGroupThrottler]) + assert.Empty(t, rpcClient.rpcDialPoolMap[dialPoolGroupVTOrc]) + + assert.NotEmpty(t, rpcClient.rpcClientMap) + assert.NotEmpty(t, rpcClient.rpcClientMap[addr]) + + assert.Contains(t, []connectivity.State{connectivity.Connecting, connectivity.TransientFailure}, cachedTmc.cc.GetState()) + }) + t.Run("ExecuteFetchAsDba", func(t *testing.T) { + ctx, cancel := context.WithTimeout(ctx, time.Second) + defer cancel() + + req := &tabletmanagerdatapb.ExecuteFetchAsDbaRequest{} + _, err := client.ExecuteFetchAsDba(ctx, tablet, true, req) + assert.Error(t, err) + }) + + t.Run("post ExecuteFetchAsDba maps", func(t *testing.T) { + + rpcClient, ok := client.dialer.(*grpcClient) + require.True(t, ok) + + rpcClient.mu.Lock() + defer rpcClient.mu.Unlock() + + assert.NotEmpty(t, rpcClient.rpcDialPoolMap) + assert.Empty(t, rpcClient.rpcDialPoolMap[dialPoolGroupThrottler]) + assert.Empty(t, rpcClient.rpcDialPoolMap[dialPoolGroupVTOrc]) + + // The default pools are unaffected. Invalidator does not run, connections are not closed. + assert.NotEmpty(t, rpcClient.rpcClientMap) + assert.NotEmpty(t, rpcClient.rpcClientMap[addr]) + + assert.NotNil(t, cachedTmc) + assert.Contains(t, []connectivity.State{connectivity.Connecting, connectivity.TransientFailure}, cachedTmc.cc.GetState()) + }) +} From e9c8d529179a67c262ca1f5715620e3430919970 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Tue, 26 Mar 2024 10:34:24 +0100 Subject: [PATCH 11/22] Add types to Go SQL driver (#15569) Signed-off-by: Dirkjan Bussink --- go/vt/vitessdriver/rows.go | 77 ++++++++++++++++++++ go/vt/vitessdriver/rows_test.go | 120 ++++++++++++++++++++++++++++++++ 2 files changed, 197 insertions(+) diff --git a/go/vt/vitessdriver/rows.go b/go/vt/vitessdriver/rows.go index a2438bb891c..1af88e64ec3 100644 --- a/go/vt/vitessdriver/rows.go +++ b/go/vt/vitessdriver/rows.go @@ -119,3 +119,80 @@ func (ri *rows) ColumnTypeScanType(index int) reflect.Type { return typeUnknown } } + +func (ri *rows) ColumnTypeDatabaseTypeName(index int) string { + field := ri.qr.Fields[index] + switch field.GetType() { + case query.Type_INT8: + return "TINYINT" + case query.Type_UINT8: + return "UNSIGNED TINYINT" + case query.Type_INT16: + return "SMALLINT" + case query.Type_UINT16: + return "UNSIGNED SMALLINT" + case query.Type_YEAR: + return "YEAR" + case query.Type_INT24: + return "MEDIUMINT" + case query.Type_UINT24: + return "UNSIGNED MEDIUMINT" + case query.Type_INT32: + return "INT" + case query.Type_UINT32: + return "UNSIGNED INT" + case query.Type_INT64: + return "BIGINT" + case query.Type_UINT64: + return "UNSIGNED BIGINT" + case query.Type_FLOAT32: + return "FLOAT" + case query.Type_FLOAT64: + return "DOUBLE" + case query.Type_DECIMAL: + return "DECIMAL" + case query.Type_VARCHAR: + return "VARCHAR" + case query.Type_TEXT: + return "TEXT" + case query.Type_BLOB: + return "BLOB" + case query.Type_VARBINARY: + return "VARBINARY" + case query.Type_CHAR: + return "CHAR" + case query.Type_BINARY: + return "BINARY" + case query.Type_BIT: + return "BIT" + case query.Type_ENUM: + return "ENUM" + case query.Type_SET: + return "SET" + case query.Type_HEXVAL: + return "VARBINARY" + case query.Type_HEXNUM: + return "VARBINARY" + case query.Type_BITNUM: + return "VARBINARY" + case query.Type_GEOMETRY: + return "GEOMETRY" + case query.Type_JSON: + return "JSON" + case query.Type_TIMESTAMP: + return "TIMESTAMP" + case query.Type_DATE: + return "DATE" + case query.Type_TIME: + return "TIME" + case query.Type_DATETIME: + return "DATETIME" + default: + return "" + } +} + +func (ri *rows) ColumnTypeNullable(index int) (nullable, ok bool) { + field := ri.qr.Fields[index] + return field.GetFlags()&uint32(query.MySqlFlag_NOT_NULL_FLAG) == 0, true +} diff --git a/go/vt/vitessdriver/rows_test.go b/go/vt/vitessdriver/rows_test.go index 13584e70dd8..bb196da30c3 100644 --- a/go/vt/vitessdriver/rows_test.go +++ b/go/vt/vitessdriver/rows_test.go @@ -226,3 +226,123 @@ func TestColumnTypeScanType(t *testing.T) { assert.Equal(t, ri.ColumnTypeScanType(i), wantTypes[i], fmt.Sprintf("unexpected type %v, wanted %v", ri.ColumnTypeScanType(i), wantTypes[i])) } } + +// Test that the ColumnTypeScanType function returns the correct reflection type for each +// sql type. The sql type in turn comes from a table column's type. +func TestColumnTypeDatabaseTypeName(t *testing.T) { + var r = sqltypes.Result{ + Fields: []*querypb.Field{ + { + Name: "field1", + Type: sqltypes.Int8, + }, + { + Name: "field2", + Type: sqltypes.Uint8, + }, + { + Name: "field3", + Type: sqltypes.Int16, + }, + { + Name: "field4", + Type: sqltypes.Uint16, + }, + { + Name: "field5", + Type: sqltypes.Int24, + }, + { + Name: "field6", + Type: sqltypes.Uint24, + }, + { + Name: "field7", + Type: sqltypes.Int32, + }, + { + Name: "field8", + Type: sqltypes.Uint32, + }, + { + Name: "field9", + Type: sqltypes.Int64, + }, + { + Name: "field10", + Type: sqltypes.Uint64, + }, + { + Name: "field11", + Type: sqltypes.Float32, + }, + { + Name: "field12", + Type: sqltypes.Float64, + }, + { + Name: "field13", + Type: sqltypes.VarBinary, + }, + { + Name: "field14", + Type: sqltypes.Datetime, + }, + }, + } + + ri := newRows(&r, &converter{}).(driver.RowsColumnTypeDatabaseTypeName) + defer ri.Close() + + wantTypes := []string{ + "TINYINT", + "UNSIGNED TINYINT", + "SMALLINT", + "UNSIGNED SMALLINT", + "MEDIUMINT", + "UNSIGNED MEDIUMINT", + "INT", + "UNSIGNED INT", + "BIGINT", + "UNSIGNED BIGINT", + "FLOAT", + "DOUBLE", + "VARBINARY", + "DATETIME", + } + + for i := 0; i < len(wantTypes); i++ { + assert.Equal(t, ri.ColumnTypeDatabaseTypeName(i), wantTypes[i], fmt.Sprintf("unexpected type %v, wanted %v", ri.ColumnTypeDatabaseTypeName(i), wantTypes[i])) + } +} + +// Test that the ColumnTypeScanType function returns the correct reflection type for each +// sql type. The sql type in turn comes from a table column's type. +func TestColumnTypeNullable(t *testing.T) { + var r = sqltypes.Result{ + Fields: []*querypb.Field{ + { + Name: "field1", + Type: sqltypes.Int64, + Flags: uint32(querypb.MySqlFlag_NOT_NULL_FLAG), + }, + { + Name: "field2", + Type: sqltypes.Int64, + }, + }, + } + + ri := newRows(&r, &converter{}).(driver.RowsColumnTypeNullable) + defer ri.Close() + + nullable := []bool{ + false, + true, + } + + for i := 0; i < len(nullable); i++ { + null, _ := ri.ColumnTypeNullable(i) + assert.Equal(t, null, nullable[i], fmt.Sprintf("unexpected type %v, wanted %v", null, nullable[i])) + } +} From 7355d997004c44c0d261795cf7a8bcfcc63c7bd0 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Tue, 26 Mar 2024 15:32:23 +0200 Subject: [PATCH 12/22] Throttler: refactor stats variables (#15574) Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- go/vt/vttablet/tabletserver/throttle/check.go | 9 +++++++-- go/vt/vttablet/tabletserver/throttle/throttler.go | 12 +++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/go/vt/vttablet/tabletserver/throttle/check.go b/go/vt/vttablet/tabletserver/throttle/check.go index 85952a496d1..98d887e8342 100644 --- a/go/vt/vttablet/tabletserver/throttle/check.go +++ b/go/vt/vttablet/tabletserver/throttle/check.go @@ -58,6 +58,11 @@ const ( selfCheckInterval = 250 * time.Millisecond ) +var ( + statsThrottlerCheckAnyTotal = stats.NewCounter("ThrottlerCheckAnyTotal", "total number of checks") + statsThrottlerCheckAnyError = stats.GetOrNewCounter("ThrottlerCheckAnyError", "total number of failed checks") +) + // CheckFlags provide hints for a check type CheckFlags struct { ReadCheck bool @@ -151,11 +156,11 @@ func (check *ThrottlerCheck) Check(ctx context.Context, appName string, storeTyp check.throttler.markRecentApp(appName, remoteAddr) if !throttlerapp.VitessName.Equals(appName) { go func(statusCode int) { - stats.GetOrNewCounter("ThrottlerCheckAnyTotal", "total number of checks").Add(1) + statsThrottlerCheckAnyTotal.Add(1) stats.GetOrNewCounter(fmt.Sprintf("ThrottlerCheckAny%s%sTotal", textutil.SingleWordCamel(storeType), textutil.SingleWordCamel(storeName)), "").Add(1) if statusCode != http.StatusOK { - stats.GetOrNewCounter("ThrottlerCheckAnyError", "total number of failed checks").Add(1) + statsThrottlerCheckAnyError.Add(1) stats.GetOrNewCounter(fmt.Sprintf("ThrottlerCheckAny%s%sError", textutil.SingleWordCamel(storeType), textutil.SingleWordCamel(storeName)), "").Add(1) } }(checkResult.StatusCode) diff --git a/go/vt/vttablet/tabletserver/throttle/throttler.go b/go/vt/vttablet/tabletserver/throttle/throttler.go index 3a35818cb61..d59a7c92e7c 100644 --- a/go/vt/vttablet/tabletserver/throttle/throttler.go +++ b/go/vt/vttablet/tabletserver/throttle/throttler.go @@ -111,6 +111,12 @@ var ( throttleTabletTypes = "replica" ) +var ( + statsThrottlerHeartbeatRequests = stats.NewCounter("ThrottlerHeartbeatRequests", "heartbeat requests") + statsThrottlerRecentlyChecked = stats.NewCounter("ThrottlerRecentlyChecked", "recently checked") + statsThrottlerProbeRecentlyChecked = stats.NewCounter("ThrottlerProbeRecentlyChecked", "probe recently checked") +) + func init() { servenv.OnParseFor("vtcombo", registerThrottlerFlags) servenv.OnParseFor("vttablet", registerThrottlerFlags) @@ -577,7 +583,7 @@ func (throttler *Throttler) requestHeartbeats() { return } go throttler.heartbeatWriter.RequestHeartbeats() - go stats.GetOrNewCounter("ThrottlerHeartbeatRequests", "heartbeat requests").Add(1) + statsThrottlerHeartbeatRequests.Add(1) } // stimulatePrimaryThrottler sends a check request to the primary tablet in the shard, to stimulate @@ -852,7 +858,7 @@ func (throttler *Throttler) generateTabletProbeFunction(ctx context.Context, clu // We have just probed a tablet, and it reported back that someone just recently "check"ed it. // We therefore renew the heartbeats lease. throttler.requestHeartbeats() - go stats.GetOrNewCounter("ThrottlerProbeRecentlyChecked", "probe recently checked").Add(1) + statsThrottlerProbeRecentlyChecked.Add(1) } return mySQLThrottleMetric } @@ -1256,7 +1262,7 @@ func (throttler *Throttler) checkStore(ctx context.Context, appName string, stor // We mark the fact that someone just made a check. If this is a REPLICA or RDONLY tables, this will be reported back // to the PRIMARY so that it knows it must renew the heartbeat lease. checkResult.RecentlyChecked = true - go stats.GetOrNewCounter("ThrottlerRecentlyChecked", "recently checked").Add(1) + statsThrottlerRecentlyChecked.Add(1) } return checkResult From 6976baa21e4fa5f095a361234ce2867e516279c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Taylor?= Date: Tue, 26 Mar 2024 15:54:07 +0100 Subject: [PATCH 13/22] cleanup: make sure we use the right Offset (#15576) --- go/vt/vtgate/planbuilder/operators/projection.go | 5 ++++- go/vt/vtgate/planbuilder/operators/projection_pushing.go | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/go/vt/vtgate/planbuilder/operators/projection.go b/go/vt/vtgate/planbuilder/operators/projection.go index f3604a30620..787d3a3b1de 100644 --- a/go/vt/vtgate/planbuilder/operators/projection.go +++ b/go/vt/vtgate/planbuilder/operators/projection.go @@ -553,7 +553,10 @@ func (p *Projection) planOffsets(ctx *plancontext.PlanningContext) Operator { for _, pe := range ap { switch pe.Info.(type) { - case *Offset, *EvalEngine: + case Offset: + pe.EvalExpr = useOffsets(ctx, pe.EvalExpr, p) + continue + case *EvalEngine: continue } diff --git a/go/vt/vtgate/planbuilder/operators/projection_pushing.go b/go/vt/vtgate/planbuilder/operators/projection_pushing.go index 6df1caee5de..c1118184e06 100644 --- a/go/vt/vtgate/planbuilder/operators/projection_pushing.go +++ b/go/vt/vtgate/planbuilder/operators/projection_pushing.go @@ -144,7 +144,7 @@ func pushProjectionToOuter(ctx *plancontext.PlanningContext, p *Projection, sq * outer := TableID(sq.Outer) for _, pe := range ap { - _, isOffset := pe.Info.(*Offset) + _, isOffset := pe.Info.(Offset) if isOffset { continue } @@ -186,7 +186,7 @@ func pushProjectionToOuterContainer(ctx *plancontext.PlanningContext, p *Project outer := TableID(src.Outer) for _, pe := range ap { - _, isOffset := pe.Info.(*Offset) + _, isOffset := pe.Info.(Offset) if isOffset { continue } From bec2180333a720b25cfe8177a705a4693f7e79d0 Mon Sep 17 00:00:00 2001 From: Manan Gupta <35839558+GuptaManan100@users.noreply.github.com> Date: Tue, 26 Mar 2024 20:41:55 +0530 Subject: [PATCH 14/22] Use a throttled logger for exceeded memory warnings (#15424) Signed-off-by: Manan Gupta Signed-off-by: Florent Poinsard Co-authored-by: Florent Poinsard --- go/vt/vtgate/executor.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/go/vt/vtgate/executor.go b/go/vt/vtgate/executor.go index 9f14888c846..70f53bcd769 100644 --- a/go/vt/vtgate/executor.go +++ b/go/vt/vtgate/executor.go @@ -33,6 +33,7 @@ import ( "vitess.io/vitess/go/acl" "vitess.io/vitess/go/cache/theine" "vitess.io/vitess/go/mysql/collations" + "vitess.io/vitess/go/mysql/sqlerror" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/stats" "vitess.io/vitess/go/streamlog" @@ -40,6 +41,7 @@ import ( "vitess.io/vitess/go/vt/callerid" "vitess.io/vitess/go/vt/key" "vitess.io/vitess/go/vt/log" + "vitess.io/vitess/go/vt/logutil" binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" querypb "vitess.io/vitess/go/vt/proto/query" topodatapb "vitess.io/vitess/go/vt/proto/topodata" @@ -73,6 +75,8 @@ var ( queriesProcessedByTable = stats.NewCountersWithMultiLabels("QueriesProcessedByTable", "Queries processed at vtgate by plan type, keyspace and table", []string{"Plan", "Keyspace", "Table"}) queriesRoutedByTable = stats.NewCountersWithMultiLabels("QueriesRoutedByTable", "Queries routed from vtgate to vttablet by plan type, keyspace and table", []string{"Plan", "Keyspace", "Table"}) + + exceedMemoryRowsLogger = logutil.NewThrottledLogger("ExceedMemoryRows", 1*time.Minute) ) const ( @@ -231,7 +235,12 @@ func (e *Executor) Execute(ctx context.Context, mysqlCtx vtgateservice.MySQLConn if err != nil { piiSafeSQL = logStats.StmtType } - log.Warningf("%q exceeds warning threshold of max memory rows: %v. Actual memory rows: %v", piiSafeSQL, warnMemoryRows, len(result.Rows)) + warningMsg := fmt.Sprintf("%q exceeds warning threshold of max memory rows: %v. Actual memory rows: %v", piiSafeSQL, warnMemoryRows, len(result.Rows)) + exceedMemoryRowsLogger.Warningf(warningMsg) + safeSession.RecordWarning(&querypb.QueryWarning{ + Code: uint32(sqlerror.EROutOfMemory), + Message: warningMsg, + }) } logStats.SaveEndTime() @@ -365,7 +374,12 @@ func (e *Executor) StreamExecute( if err != nil { piiSafeSQL = logStats.StmtType } - log.Warningf("%q exceeds warning threshold of max memory rows: %v. Actual memory rows: %v", piiSafeSQL, warnMemoryRows, srr.rowsReturned) + warningMsg := fmt.Sprintf("%q exceeds warning threshold of max memory rows: %v. Actual memory rows: %v", piiSafeSQL, warnMemoryRows, srr.rowsReturned) + exceedMemoryRowsLogger.Warningf(warningMsg) + safeSession.RecordWarning(&querypb.QueryWarning{ + Code: uint32(sqlerror.EROutOfMemory), + Message: warningMsg, + }) } logStats.SaveEndTime() From 37e5c4ac9b1b93e1e363cb8470ecedc2b80c195d Mon Sep 17 00:00:00 2001 From: crazeteam <164632007+crazeteam@users.noreply.github.com> Date: Wed, 27 Mar 2024 01:08:21 +0800 Subject: [PATCH 15/22] Fix misorganized annotations (#15566) Signed-off-by: crazeteam Signed-off-by: Matt Lord Co-authored-by: Matt Lord --- go/vt/wrangler/vexec_plan.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go/vt/wrangler/vexec_plan.go b/go/vt/wrangler/vexec_plan.go index e9ea1daf5c3..1878c25441c 100644 --- a/go/vt/wrangler/vexec_plan.go +++ b/go/vt/wrangler/vexec_plan.go @@ -279,7 +279,7 @@ func (vx *vexec) buildUpdatePlan(ctx context.Context, planner vexecPlanner, upd }, nil } -// buildUpdatePlan builds a plan for a DELETE query +// buildDeletePlan builds a plan for a DELETE query func (vx *vexec) buildDeletePlan(ctx context.Context, planner vexecPlanner, del *sqlparser.Delete) (*vexecPlan, error) { if del.Targets != nil { return nil, fmt.Errorf("unsupported construct: %v", sqlparser.String(del)) @@ -330,7 +330,7 @@ func (vx *vexec) buildInsertPlan(ctx context.Context, planner vexecPlanner, ins }, nil } -// buildUpdatePlan builds a plan for a SELECT query +// buildSelectPlan builds a plan for a SELECT query func (vx *vexec) buildSelectPlan(ctx context.Context, planner vexecPlanner, sel *sqlparser.Select) (*vexecPlan, error) { sel.Where = vx.addDefaultWheres(planner, sel.Where) buf := sqlparser.NewTrackedBuffer(nil) From ae83a659ce3c2e788745319145bb1495a0d5e917 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Mar 2024 15:46:19 -0600 Subject: [PATCH 16/22] Upgrade the Golang Dependencies (#15496) Signed-off-by: Florent Poinsard Co-authored-by: Florent Poinsard --- go.mod | 44 ++++++++++++------------ go.sum | 103 ++++++++++++++++++++++++++++++++------------------------- 2 files changed, 80 insertions(+), 67 deletions(-) diff --git a/go.mod b/go.mod index b38c3e71541..dd8bc975d53 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,14 @@ module vitess.io/vitess go 1.22.1 require ( - cloud.google.com/go/storage v1.39.0 + cloud.google.com/go/storage v1.39.1 github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 github.com/Azure/azure-pipeline-go v0.2.3 github.com/Azure/azure-storage-blob-go v0.15.0 github.com/HdrHistogram/hdrhistogram-go v0.9.0 // indirect github.com/aquarapid/vaultlib v0.5.1 github.com/armon/go-metrics v0.4.1 // indirect - github.com/aws/aws-sdk-go v1.50.32 + github.com/aws/aws-sdk-go v1.51.8 github.com/buger/jsonparser v1.1.1 github.com/cespare/xxhash/v2 v2.2.0 github.com/corpix/uarand v0.1.1 // indirect @@ -50,7 +50,7 @@ require ( github.com/planetscale/pargzip v0.0.0-20201116224723-90c7fc03ea8a github.com/planetscale/vtprotobuf v0.5.0 github.com/prometheus/client_golang v1.19.0 - github.com/prometheus/common v0.49.0 + github.com/prometheus/common v0.51.1 github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 github.com/sjmudd/stopwatch v0.1.1 github.com/soheilhy/cmux v0.1.5 @@ -78,13 +78,13 @@ require ( golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 golang.org/x/tools v0.19.0 - google.golang.org/api v0.168.0 - google.golang.org/genproto v0.0.0-20240304212257-790db918fca8 // indirect + google.golang.org/api v0.171.0 + google.golang.org/genproto v0.0.0-20240325203815-454cdb8f5daa // indirect google.golang.org/grpc v1.62.1 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 google.golang.org/grpc/examples v0.0.0-20210430044426-28078834f35b google.golang.org/protobuf v1.33.0 - gopkg.in/DataDog/dd-trace-go.v1 v1.61.0 + gopkg.in/DataDog/dd-trace-go.v1 v1.62.0 gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect gopkg.in/ldap.v2 v2.5.1 sigs.k8s.io/yaml v1.4.0 @@ -92,7 +92,7 @@ require ( require ( github.com/DataDog/datadog-go/v5 v5.5.0 - github.com/Shopify/toxiproxy/v2 v2.8.0 + github.com/Shopify/toxiproxy/v2 v2.9.0 github.com/bndr/gotabulate v1.1.2 github.com/gammazero/deque v0.2.1 github.com/google/safehtml v0.1.0 @@ -105,29 +105,29 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 github.com/xlab/treeprint v1.2.0 go.uber.org/goleak v1.3.0 - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 + golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 golang.org/x/sync v0.6.0 gonum.org/v1/gonum v0.14.0 - modernc.org/sqlite v1.29.2 + modernc.org/sqlite v1.29.5 ) require ( cloud.google.com/go v0.112.1 // indirect - cloud.google.com/go/compute v1.25.0 // indirect + cloud.google.com/go/compute v1.25.1 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v1.1.6 // indirect + cloud.google.com/go/iam v1.1.7 // indirect github.com/DataDog/appsec-internal-go v1.5.0 // indirect - github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1 // indirect - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1 // indirect - github.com/DataDog/go-libddwaf/v2 v2.3.2 // indirect + github.com/DataDog/datadog-agent/pkg/obfuscate v0.52.0 // indirect + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.52.0 // indirect + github.com/DataDog/go-libddwaf/v2 v2.4.2 // indirect github.com/DataDog/go-sqllexer v0.0.11 // indirect - github.com/DataDog/go-tuf v1.0.4-0.5.2-debug // indirect + github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect github.com/DataDog/sketches-go v1.4.4 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/ebitengine/purego v0.6.1 // indirect @@ -139,7 +139,7 @@ require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/google/s2a-go v0.1.7 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect - github.com/googleapis/gax-go/v2 v2.12.2 // indirect + github.com/googleapis/gax-go/v2 v2.12.3 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-hclog v1.6.2 // indirect @@ -158,10 +158,10 @@ require ( github.com/onsi/ginkgo v1.16.5 // indirect github.com/onsi/gomega v1.23.0 // indirect github.com/outcaste-io/ristretto v0.2.3 // indirect - github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect @@ -185,13 +185,13 @@ require ( go.uber.org/zap v1.27.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240304212257-790db918fca8 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b // indirect - modernc.org/libc v1.41.0 // indirect + modernc.org/libc v1.48.0 // indirect modernc.org/mathutil v1.6.0 // indirect modernc.org/memory v1.7.2 // indirect modernc.org/strutil v1.2.0 // indirect diff --git a/go.sum b/go.sum index 1b5dad57678..9499dbf0a8f 100644 --- a/go.sum +++ b/go.sum @@ -2,14 +2,14 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.112.1 h1:uJSeirPke5UNZHIb4SxfZklVSiWWVqW4oXlETwZziwM= cloud.google.com/go v0.112.1/go.mod h1:+Vbu+Y1UU+I1rjmzeMOb/8RfkKJK2Gyxi1X6jJCZLo4= -cloud.google.com/go/compute v1.25.0 h1:H1/4SqSUhjPFE7L5ddzHOfY2bCAvjwNRZPNl6Ni5oYU= -cloud.google.com/go/compute v1.25.0/go.mod h1:GR7F0ZPZH8EhChlMo9FkLd7eUTwEymjqQagxzilIxIE= +cloud.google.com/go/compute v1.25.1 h1:ZRpHJedLtTpKgr3RV1Fx23NuaAEN1Zfx9hw1u4aJdjU= +cloud.google.com/go/compute v1.25.1/go.mod h1:oopOIR53ly6viBYxaDhBfJwzUAxf1zE//uf3IB011ls= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= -cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= -cloud.google.com/go/storage v1.39.0 h1:brbjUa4hbDHhpQf48tjqMaXEV+f1OGoaTmQau9tmCsA= -cloud.google.com/go/storage v1.39.0/go.mod h1:OAEj/WZwUYjA3YHQ10/YcN9ttGuEpLwvaoyBXIPikEk= +cloud.google.com/go/iam v1.1.7 h1:z4VHOhwKLF/+UYXAJDFwGtNF0b6gjsW1Pk9Ml0U/IoM= +cloud.google.com/go/iam v1.1.7/go.mod h1:J4PMPg8TtyurAUvSmPj8FF3EDgY1SPRZxcUGrn7WXGA= +cloud.google.com/go/storage v1.39.1 h1:MvraqHKhogCOTXTlct/9C3K3+Uy2jBmFYb3/Sp6dVtY= +cloud.google.com/go/storage v1.39.1/go.mod h1:xK6xZmxZmo+fyP7+DEF6FhNc24/JAe95OLyOHCXFH1o= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/Azure/azure-pipeline-go v0.2.3 h1:7U9HBg1JFK3jHl5qmo4CTZKFTVgMwdFHMVtCdfBE21U= @@ -30,19 +30,19 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/appsec-internal-go v1.5.0 h1:8kS5zSx5T49uZ8dZTdT19QVAvC/B8ByyZdhQKYQWHno= github.com/DataDog/appsec-internal-go v1.5.0/go.mod h1:pEp8gjfNLtEOmz+iZqC8bXhu0h4k7NUsW/qiQb34k1U= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1 h1:5KgWxn74KcraNhbJoq1xWZMXoebZ5bPKwKHTjrDUfzM= -github.com/DataDog/datadog-agent/pkg/obfuscate v0.51.1/go.mod h1:Ai57GjsZUn9AOo4L9ZOdu5uTuGaAxXMh0kin544Lgw0= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1 h1:jISM64qEVHEuelutAkXAOWjn6RsTajhzYnADmpIlThA= -github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.51.1/go.mod h1:Vc+snp0Bey4MrrJyiV2tVxxJb6BmLomPvN1RgAvjGaQ= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.52.0 h1:J2iRNRgtKsLq3L55NJzZMQqTqbm8+ps8iKCwjkCph9E= +github.com/DataDog/datadog-agent/pkg/obfuscate v0.52.0/go.mod h1:AVPQWekk3h9AOC7+plBlNB68Sy6UIGFoMMVUDeSoNoI= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.52.0 h1:AoE7kw6PRbhVTER+Y6mROgy/5H9nwy58Ta9FHWiIOro= +github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.52.0/go.mod h1:JhAilx32dkIgoDkFXquCTfaWDsAOfe+vfBaxbiZoPI0= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go/v5 v5.5.0 h1:G5KHeB8pWBNXT4Jtw0zAkhdxEAWSpWH00geHI6LDrKU= github.com/DataDog/datadog-go/v5 v5.5.0/go.mod h1:K9kcYBlxkcPP8tvvjZZKs/m1edNAUFzBbdpTUKfCsuw= -github.com/DataDog/go-libddwaf/v2 v2.3.2 h1:pdi9xjWW57IpOpTeOyPuNveEDFLmmInsHDeuZk3TY34= -github.com/DataDog/go-libddwaf/v2 v2.3.2/go.mod h1:gsCdoijYQfj8ce/T2bEDNPZFIYnmHluAgVDpuQOWMZE= +github.com/DataDog/go-libddwaf/v2 v2.4.2 h1:ilquGKUmN9/Ty0sIxiEyznVRxP3hKfmH15Y1SMq5gjA= +github.com/DataDog/go-libddwaf/v2 v2.4.2/go.mod h1:gsCdoijYQfj8ce/T2bEDNPZFIYnmHluAgVDpuQOWMZE= github.com/DataDog/go-sqllexer v0.0.11 h1:OfPBjmayreblOXreszbrOTICNZ3qWrA6Bg4sypvxpbw= github.com/DataDog/go-sqllexer v0.0.11/go.mod h1:KwkYhpFEVIq+BfobkTC1vfqm4gTi65skV/DpDBXtexc= -github.com/DataDog/go-tuf v1.0.4-0.5.2-debug h1:U6GQc541lWIwqHDwoGHegGFHW7HLjHRaLp4Y8Wwhy4A= -github.com/DataDog/go-tuf v1.0.4-0.5.2-debug/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= +github.com/DataDog/go-tuf v1.1.0-0.5.2 h1:4CagiIekonLSfL8GMHRHcHudo1fQnxELS9g4tiAupQ4= +github.com/DataDog/go-tuf v1.1.0-0.5.2/go.mod h1:zBcq6f654iVqmkk8n2Cx81E1JnNTMOAx1UEO/wZR+P0= github.com/DataDog/gostackparse v0.7.0 h1:i7dLkXHvYzHV308hnkvVGDL3BR4FWl7IsXNPz/IGQh4= github.com/DataDog/gostackparse v0.7.0/go.mod h1:lTfqcJKqS9KnXQGnyQMCugq3u1FP6UZMfWR0aitKFMM= github.com/DataDog/sketches-go v1.4.4 h1:dF52vzXRFSPOj2IjXSWLvXq3jubL4CI69kwYjJ1w5Z8= @@ -55,8 +55,8 @@ github.com/Masterminds/vcs v1.13.0/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHS github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/Shopify/toxiproxy/v2 v2.8.0 h1:d7OzvAc0Rco3QO8jVsDSfadQ1up0Ca42hK+EGEpnQWs= -github.com/Shopify/toxiproxy/v2 v2.8.0/go.mod h1:k0V84e/dLQmVNuI6S0G7TpXCl611OSRYdptoxm0XTzA= +github.com/Shopify/toxiproxy/v2 v2.9.0 h1:DIaDZG2/r/kv3Em6UxYBUVnnWl1mHlYTGFv+sTPV7VI= +github.com/Shopify/toxiproxy/v2 v2.9.0/go.mod h1:2uPRyxR46fsx2yUr9i8zcejzdkWfK7p6G23jV/X6YNs= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -69,8 +69,8 @@ github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJ github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aws/aws-sdk-go v1.50.32 h1:POt81DvegnpQKM4DMDLlHz1CO6OBnEoQ1gRhYFd7QRY= -github.com/aws/aws-sdk-go v1.50.32/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.51.8 h1:tD7gQq5XKuKdhA6UMEH26ZNQH0s+HbL95rzv/ACz5TQ= +github.com/aws/aws-sdk-go v1.51.8/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -96,8 +96,9 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8 github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/corpix/uarand v0.1.1 h1:RMr1TWc9F4n5jiPDzFHtmaUXLKLNUFK0SgCLo4BhX/U= github.com/corpix/uarand v0.1.1/go.mod h1:SFKZvkcRoLqVRFZ4u25xPmp6m9ktANfbpXZ7SJ0/FNU= -github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/dave/jennifer v1.7.0 h1:uRbSBH9UTS64yXbh4FrMHfgfY762RD+C7bUPKODpSJE= github.com/dave/jennifer v1.7.0/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc= @@ -212,8 +213,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs= github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0= -github.com/googleapis/gax-go/v2 v2.12.2 h1:mhN09QQW1jEWeMF74zGR81R30z4VJzjZsfkUhuHF+DA= -github.com/googleapis/gax-go/v2 v2.12.2/go.mod h1:61M8vcyyXR2kqKFxKrfA22jaA8JGF7Dc8App1U3H6jc= +github.com/googleapis/gax-go/v2 v2.12.3 h1:5/zPPDvw8Q1SuXjrqrZslrqT7dL/uJT2CQii/cLCKqA= +github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= @@ -326,8 +327,8 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= +github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= @@ -378,8 +379,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= -github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= -github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.2.0 h1:QLgLl2yMN7N+ruc31VynXs1vhMZa7CeHHejIeBAsoHo= +github.com/pelletier/go-toml/v2 v2.2.0/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw= github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0= github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= @@ -413,13 +414,13 @@ github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZ github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.49.0 h1:ToNTdK4zSnPVJmh698mGFkDor9wBI/iGaJy5dbH1EgI= -github.com/prometheus/common v0.49.0/go.mod h1:Kxm+EULxRbUkjGU6WFsQqo3ORzB4tyKvlWFOE9mB2sE= +github.com/prometheus/common v0.51.1 h1:eIjN50Bwglz6a/c3hAgSMcofL3nD+nFQkV6Dd4DsQCw= +github.com/prometheus/common v0.51.1/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= @@ -562,8 +563,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 h1:aAcj0Da7eBAtrTp03QXWvm88pSyOt+UgdZw2BFZ+lEw= +golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -693,8 +694,8 @@ golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSm golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0= gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU= -google.golang.org/api v0.168.0 h1:MBRe+Ki4mMN93jhDDbpuRLjRddooArz4FeSObvUMmjY= -google.golang.org/api v0.168.0/go.mod h1:gpNOiMA2tZ4mf5R9Iwf4rK/Dcz0fbdIgWYWVoxmsyLg= +google.golang.org/api v0.171.0 h1:w174hnBPqut76FzW5Qaupt7zY8Kql6fiVjgys4f58sU= +google.golang.org/api v0.171.0/go.mod h1:Hnq5AHm4OTMt2BUVjael2CWZFD6vksJdWCWiUAmjC9o= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= @@ -704,12 +705,12 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20240304212257-790db918fca8 h1:Fe8QycXyEd9mJgnwB9kmw00WgB43eQ/xYO5C6gceybQ= -google.golang.org/genproto v0.0.0-20240304212257-790db918fca8/go.mod h1:yA7a1bW1kwl459Ol0m0lV4hLTfrL/7Bkk4Mj2Ir1mWI= -google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8 h1:8eadJkXbwDEMNwcB5O0s5Y5eCfyuCLdvaiOIaGTrWmQ= -google.golang.org/genproto/googleapis/api v0.0.0-20240304212257-790db918fca8/go.mod h1:O1cOfN1Cy6QEYr7VxtjOyP5AdAuR0aJ/MYZaaof623Y= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240304212257-790db918fca8 h1:IR+hp6ypxjH24bkMfEJ0yHR21+gwPWdV+/IBrPQyn3k= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240304212257-790db918fca8/go.mod h1:UCOku4NytXMJuLQE5VuqA5lX3PcHCBo8pxNyvkf4xBs= +google.golang.org/genproto v0.0.0-20240325203815-454cdb8f5daa h1:ePqxpG3LVx+feAUOx8YmR5T7rc0rdzK8DyxM8cQ9zq0= +google.golang.org/genproto v0.0.0-20240325203815-454cdb8f5daa/go.mod h1:CnZenrTdRJb7jc+jOm0Rkywq+9wh0QC4U8tyiRbEPPM= +google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa h1:Jt1XW5PaLXF1/ePZrznsh/aAUvI7Adfc3LY1dAKlzRs= +google.golang.org/genproto/googleapis/api v0.0.0-20240325203815-454cdb8f5daa/go.mod h1:K4kfzHtI0kqWA79gecJarFtDn/Mls+GxQcg3Zox91Ac= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa h1:RBgMaUMP+6soRkik4VoN8ojR2nex2TqZwjSSogic+eo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240325203815-454cdb8f5daa/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -739,8 +740,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/DataDog/dd-trace-go.v1 v1.61.0 h1:XKO91GwTjpIRhd56Xif/BZ2YgHkQufVTOvtkbRYSPi8= -gopkg.in/DataDog/dd-trace-go.v1 v1.61.0/go.mod h1:NHKX1t9eKmajySb6H+zLdgZizCFzbt5iKvrTyxEyy8w= +gopkg.in/DataDog/dd-trace-go.v1 v1.62.0 h1:jeZxE4ZlfAc+R0zO5TEmJBwOLet3NThsOfYJeSQg1x0= +gopkg.in/DataDog/dd-trace-go.v1 v1.62.0/go.mod h1:YTvYkk3PTsfw0OWrRFxV/IQ5Gy4nZ5TRvxTAP3JcIzs= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= @@ -773,16 +774,28 @@ honnef.co/go/gotraceui v0.2.0 h1:dmNsfQ9Vl3GwbiVD7Z8d/osC6WtGGrasyrC2suc4ZIQ= honnef.co/go/gotraceui v0.2.0/go.mod h1:qHo4/W75cA3bX0QQoSvDjbJa4R8mAyyFjbWAj63XElc= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +modernc.org/cc/v4 v4.19.5 h1:QlsZyQ1zf78DGeqnQ9ILi9hXyMdoC5e1qoGNUyBjHQw= +modernc.org/cc/v4 v4.19.5/go.mod h1:HM7VJTZbUCR3rV8EYBi9wxnJ0ZBRiGE5OeGXNA0IsLQ= +modernc.org/ccgo/v4 v4.13.1 h1:qBttaSxEHNze36VBivw1/vkHuyjMDN3RY5wQX+p1Oxg= +modernc.org/ccgo/v4 v4.13.1/go.mod h1:Td6RI9W9G2ZpKHaJ7UeGEiB2aIpoDqLBnm4wtkbJTbQ= +modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= +modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= +modernc.org/gc/v2 v2.4.1 h1:9cNzOqPyMJBvrUipmynX0ZohMhcxPtMccYgGOJdOiBw= +modernc.org/gc/v2 v2.4.1/go.mod h1:wzN5dK1AzVGoH6XOzc3YZ+ey/jPgYHLuVckd62P0GYU= modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b h1:BnN1t+pb1cy61zbvSUV7SeI0PwosMhlAEi/vBY4qxp8= modernc.org/gc/v3 v3.0.0-20240304020402-f0dba7c97c2b/go.mod h1:Qz0X07sNOR1jWYCrJMEnbW/X55x206Q7Vt4mz6/wHp4= -modernc.org/libc v1.41.0 h1:g9YAc6BkKlgORsUWj+JwqoB1wU3o4DE3bM3yvA3k+Gk= -modernc.org/libc v1.41.0/go.mod h1:w0eszPsiXoOnoMJgrXjglgLuDy/bt5RR4y3QzUUeodY= +modernc.org/libc v1.48.0 h1:oUpL2nS3JThobTzDordRHtMqVllhMGJktGOWdnTuReA= +modernc.org/libc v1.48.0/go.mod h1:DNz0lgQgT6FPIPm8rHtjFj0FL5/YOr/NYFXWYBcSxMw= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E= modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E= -modernc.org/sqlite v1.29.2 h1:xgBSyA3gemwgP31PWFfFjtBorQNYpeypGdoSDjXhrgI= -modernc.org/sqlite v1.29.2/go.mod h1:hG41jCYxOAOoO6BRK66AdRlmOcDzXf7qnwlwjUIOqa0= +modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= +modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= +modernc.org/sortutil v1.2.0 h1:jQiD3PfS2REGJNzNCMMaLSp/wdMNieTbKX920Cqdgqc= +modernc.org/sortutil v1.2.0/go.mod h1:TKU2s7kJMf1AE84OoiGppNHJwvB753OYfNl2WRb++Ss= +modernc.org/sqlite v1.29.5 h1:8l/SQKAjDtZFo9lkJLdk8g9JEOeYRG4/ghStDCCTiTE= +modernc.org/sqlite v1.29.5/go.mod h1:S02dvcmm7TnTRvGhv8IGYyLnIt7AS2KPaB1F/71p75U= modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= From 308f1fc5f0feac229f817bb30ef3b6fd0fe1fca9 Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Tue, 26 Mar 2024 22:48:51 +0100 Subject: [PATCH 17/22] mysqlctld: setup a different default for onterm_timeout (#15575) Signed-off-by: Dirkjan Bussink --- changelog/20.0/20.0.0/summary.md | 7 ++++ go/cmd/mysqlctld/cli/mysqlctld.go | 8 ++++- go/cmd/vtbackup/cli/vtbackup.go | 2 +- go/cmd/vtcombo/cli/main.go | 14 ++++---- go/flags/endtoend/mysqlctld.txt | 2 +- go/vt/mysqlctl/grpcmysqlctlserver/server.go | 5 +-- go/vt/mysqlctl/mycnf.go | 2 ++ go/vt/servenv/run.go | 8 ++--- go/vt/servenv/servenv.go | 37 +++++++++++++++++---- go/vt/vttablet/tabletmanager/tm_init.go | 2 +- 10 files changed, 61 insertions(+), 26 deletions(-) diff --git a/changelog/20.0/20.0.0/summary.md b/changelog/20.0/20.0.0/summary.md index 15455ef502c..49642dc8734 100644 --- a/changelog/20.0/20.0.0/summary.md +++ b/changelog/20.0/20.0.0/summary.md @@ -6,6 +6,7 @@ - **[Breaking changes](#breaking-changes)** - [`shutdown_grace_period` Default Change](#shutdown-grace-period-default) - [New `unmanaged` Flag and `disable_active_reparents` deprecation](#unmanaged-flag) + - [`mysqlctld` `onterm-timeout` Default Change](#mysqlctld-onterm-timeout) - **[Query Compatibility](#query-compatibility)** - [Vindex Hints](#vindex-hints) - [Update with Limit Support](#update-limit) @@ -38,6 +39,12 @@ New flag `--unmanaged` has been introduced in this release to make it easier to Starting this release, all unmanaged tablets should specify this flag. +#### `mysqlctld` `onterm_timeout` Default Change + +The `--onterm_timeout` flag default value has changed for `mysqlctld`. It now is by default long enough to be able to wait for the default `--shutdown-wait-time` when shutting down on a `TERM` signal. + +This is necessary since otherwise MySQL would never shut down cleanly with the old defaults, since `mysqlctld` would shut down already after 10 seconds by default. + ### Query Compatibility #### Vindex Hints diff --git a/go/cmd/mysqlctld/cli/mysqlctld.go b/go/cmd/mysqlctld/cli/mysqlctld.go index 2dff7da0f7f..8dacf8d9d9f 100644 --- a/go/cmd/mysqlctld/cli/mysqlctld.go +++ b/go/cmd/mysqlctld/cli/mysqlctld.go @@ -71,12 +71,18 @@ var ( PreRunE: servenv.CobraPreRunE, RunE: run, } + + timeouts = &servenv.TimeoutFlags{ + LameduckPeriod: 50 * time.Millisecond, + OnTermTimeout: shutdownWaitTime + 10*time.Second, + OnCloseTimeout: 10 * time.Second, + } ) func init() { servenv.RegisterDefaultFlags() servenv.RegisterDefaultSocketFileFlags() - servenv.RegisterFlags() + servenv.RegisterFlagsWithTimeouts(timeouts) servenv.RegisterGRPCServerFlags() servenv.RegisterGRPCServerAuthFlags() servenv.RegisterServiceMapFlag() diff --git a/go/cmd/vtbackup/cli/vtbackup.go b/go/cmd/vtbackup/cli/vtbackup.go index 1f6f62f7ad1..3afc21bda7f 100644 --- a/go/cmd/vtbackup/cli/vtbackup.go +++ b/go/cmd/vtbackup/cli/vtbackup.go @@ -87,7 +87,7 @@ var ( mysqlPort = 3306 mysqlSocket string mysqlTimeout = 5 * time.Minute - mysqlShutdownTimeout = 5 * time.Minute + mysqlShutdownTimeout = mysqlctl.DefaultShutdownTimeout initDBSQLFile string detachedMode bool keepAliveTimeout time.Duration diff --git a/go/cmd/vtcombo/cli/main.go b/go/cmd/vtcombo/cli/main.go index 16e625a6ae6..d18c22ddfbb 100644 --- a/go/cmd/vtcombo/cli/main.go +++ b/go/cmd/vtcombo/cli/main.go @@ -168,8 +168,6 @@ func startMysqld(uid uint32) (mysqld *mysqlctl.Mysqld, cnf *mysqlctl.Mycnf, err return mysqld, cnf, nil } -const mysqlShutdownTimeout = 5 * time.Minute - func run(cmd *cobra.Command, args []string) (err error) { // Stash away a copy of the topology that vtcombo was started with. // @@ -218,9 +216,9 @@ func run(cmd *cobra.Command, args []string) (err error) { return err } servenv.OnClose(func() { - ctx, cancel := context.WithTimeout(context.Background(), mysqlShutdownTimeout+10*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), mysqlctl.DefaultShutdownTimeout+10*time.Second) defer cancel() - mysqld.Shutdown(ctx, cnf, true, mysqlShutdownTimeout) + mysqld.Shutdown(ctx, cnf, true, mysqlctl.DefaultShutdownTimeout) }) // We want to ensure we can write to this database mysqld.SetReadOnly(false) @@ -242,9 +240,9 @@ func run(cmd *cobra.Command, args []string) (err error) { if err != nil { // ensure we start mysql in the event we fail here if startMysql { - ctx, cancel := context.WithTimeout(context.Background(), mysqlShutdownTimeout+10*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), mysqlctl.DefaultShutdownTimeout+10*time.Second) defer cancel() - mysqld.Shutdown(ctx, cnf, true, mysqlShutdownTimeout) + mysqld.Shutdown(ctx, cnf, true, mysqlctl.DefaultShutdownTimeout) } return fmt.Errorf("initTabletMapProto failed: %w", err) @@ -291,9 +289,9 @@ func run(cmd *cobra.Command, args []string) (err error) { err := topotools.RebuildKeyspace(context.Background(), logutil.NewConsoleLogger(), ts, ks.GetName(), tpb.Cells, false) if err != nil { if startMysql { - ctx, cancel := context.WithTimeout(context.Background(), mysqlShutdownTimeout+10*time.Second) + ctx, cancel := context.WithTimeout(context.Background(), mysqlctl.DefaultShutdownTimeout+10*time.Second) defer cancel() - mysqld.Shutdown(ctx, cnf, true, mysqlShutdownTimeout) + mysqld.Shutdown(ctx, cnf, true, mysqlctl.DefaultShutdownTimeout) } return fmt.Errorf("Couldn't build srv keyspace for (%v: %v). Got error: %w", ks, tpb.Cells, err) diff --git a/go/flags/endtoend/mysqlctld.txt b/go/flags/endtoend/mysqlctld.txt index 0dde59e0d7d..6bb1beb5bae 100644 --- a/go/flags/endtoend/mysqlctld.txt +++ b/go/flags/endtoend/mysqlctld.txt @@ -103,7 +103,7 @@ Flags: --mysqlctl_mycnf_template string template file to use for generating the my.cnf file during server init --mysqlctl_socket string socket file to use for remote mysqlctl actions (empty for local actions) --onclose_timeout duration wait no more than this for OnClose handlers before stopping (default 10s) - --onterm_timeout duration wait no more than this for OnTermSync handlers before stopping (default 10s) + --onterm_timeout duration wait no more than this for OnTermSync handlers before stopping (default 5m10s) --pid_file string If set, the process will write its pid to the named file, and delete it on graceful shutdown. --pool_hostname_resolve_interval duration if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled) --port int port for the server diff --git a/go/vt/mysqlctl/grpcmysqlctlserver/server.go b/go/vt/mysqlctl/grpcmysqlctlserver/server.go index 38ce4b2b2df..2a703a50a84 100644 --- a/go/vt/mysqlctl/grpcmysqlctlserver/server.go +++ b/go/vt/mysqlctl/grpcmysqlctlserver/server.go @@ -22,7 +22,6 @@ package grpcmysqlctlserver import ( "context" - "time" "google.golang.org/grpc" @@ -43,8 +42,6 @@ func (s *server) Start(ctx context.Context, request *mysqlctlpb.StartRequest) (* return &mysqlctlpb.StartResponse{}, s.mysqld.Start(ctx, s.cnf, request.MysqldArgs...) } -const mysqlShutdownTimeout = 5 * time.Minute - // Shutdown implements the server side of the MysqlctlClient interface. func (s *server) Shutdown(ctx context.Context, request *mysqlctlpb.ShutdownRequest) (*mysqlctlpb.ShutdownResponse, error) { timeout, ok, err := protoutil.DurationFromProto(request.MysqlShutdownTimeout) @@ -52,7 +49,7 @@ func (s *server) Shutdown(ctx context.Context, request *mysqlctlpb.ShutdownReque return nil, err } if !ok { - timeout = mysqlShutdownTimeout + timeout = mysqlctl.DefaultShutdownTimeout } return &mysqlctlpb.ShutdownResponse{}, s.mysqld.Shutdown(ctx, s.cnf, request.WaitForMysqld, timeout) } diff --git a/go/vt/mysqlctl/mycnf.go b/go/vt/mysqlctl/mycnf.go index 7ae2d5d0aa9..c4ee062348b 100644 --- a/go/vt/mysqlctl/mycnf.go +++ b/go/vt/mysqlctl/mycnf.go @@ -31,6 +31,8 @@ import ( "time" ) +const DefaultShutdownTimeout = 5 * time.Minute + // Mycnf is a memory structure that contains a bunch of interesting // parameters to start mysqld. It can be used to generate standard // my.cnf files from a server id and mysql port. It can also be diff --git a/go/vt/servenv/run.go b/go/vt/servenv/run.go index 6f028786eaf..29b15a40008 100644 --- a/go/vt/servenv/run.go +++ b/go/vt/servenv/run.go @@ -62,18 +62,18 @@ func Run(bindAddress string, port int) { l.Close() startTime := time.Now() - log.Infof("Entering lameduck mode for at least %v", lameduckPeriod) + log.Infof("Entering lameduck mode for at least %v", timeouts.LameduckPeriod) log.Infof("Firing asynchronous OnTerm hooks") go onTermHooks.Fire() - fireOnTermSyncHooks(onTermTimeout) - if remain := lameduckPeriod - time.Since(startTime); remain > 0 { + fireOnTermSyncHooks(timeouts.OnTermTimeout) + if remain := timeouts.LameduckPeriod - time.Since(startTime); remain > 0 { log.Infof("Sleeping an extra %v after OnTermSync to finish lameduck period", remain) time.Sleep(remain) } log.Info("Shutting down gracefully") - fireOnCloseHooks(onCloseTimeout) + fireOnCloseHooks(timeouts.OnCloseTimeout) ListeningURL = url.URL{} } diff --git a/go/vt/servenv/servenv.go b/go/vt/servenv/servenv.go index 6a7898501f8..4aa9818eb7d 100644 --- a/go/vt/servenv/servenv.go +++ b/go/vt/servenv/servenv.go @@ -75,24 +75,33 @@ var ( // Flags specific to Init, Run, and RunDefault functions. var ( - lameduckPeriod = 50 * time.Millisecond - onTermTimeout = 10 * time.Second - onCloseTimeout = 10 * time.Second catchSigpipe bool maxStackSize = 64 * 1024 * 1024 initStartTime time.Time // time when tablet init started: for debug purposes to time how long a tablet init takes tableRefreshInterval int ) +type TimeoutFlags struct { + LameduckPeriod time.Duration + OnTermTimeout time.Duration + OnCloseTimeout time.Duration +} + +var timeouts = &TimeoutFlags{ + LameduckPeriod: 50 * time.Millisecond, + OnTermTimeout: 10 * time.Second, + OnCloseTimeout: 10 * time.Second, +} + // RegisterFlags installs the flags used by Init, Run, and RunDefault. // // This must be called before servenv.ParseFlags if using any of those // functions. func RegisterFlags() { OnParse(func(fs *pflag.FlagSet) { - fs.DurationVar(&lameduckPeriod, "lameduck-period", lameduckPeriod, "keep running at least this long after SIGTERM before stopping") - fs.DurationVar(&onTermTimeout, "onterm_timeout", onTermTimeout, "wait no more than this for OnTermSync handlers before stopping") - fs.DurationVar(&onCloseTimeout, "onclose_timeout", onCloseTimeout, "wait no more than this for OnClose handlers before stopping") + fs.DurationVar(&timeouts.LameduckPeriod, "lameduck-period", timeouts.LameduckPeriod, "keep running at least this long after SIGTERM before stopping") + fs.DurationVar(&timeouts.OnTermTimeout, "onterm_timeout", timeouts.OnTermTimeout, "wait no more than this for OnTermSync handlers before stopping") + fs.DurationVar(&timeouts.OnCloseTimeout, "onclose_timeout", timeouts.OnCloseTimeout, "wait no more than this for OnClose handlers before stopping") fs.BoolVar(&catchSigpipe, "catch-sigpipe", catchSigpipe, "catch and ignore SIGPIPE on stdout and stderr if specified") fs.IntVar(&maxStackSize, "max-stack-size", maxStackSize, "configure the maximum stack size in bytes") fs.IntVar(&tableRefreshInterval, "table-refresh-interval", tableRefreshInterval, "interval in milliseconds to refresh tables in status page with refreshRequired class") @@ -102,6 +111,22 @@ func RegisterFlags() { }) } +func RegisterFlagsWithTimeouts(tf *TimeoutFlags) { + OnParse(func(fs *pflag.FlagSet) { + fs.DurationVar(&tf.LameduckPeriod, "lameduck-period", tf.LameduckPeriod, "keep running at least this long after SIGTERM before stopping") + fs.DurationVar(&tf.OnTermTimeout, "onterm_timeout", tf.OnTermTimeout, "wait no more than this for OnTermSync handlers before stopping") + fs.DurationVar(&tf.OnCloseTimeout, "onclose_timeout", tf.OnCloseTimeout, "wait no more than this for OnClose handlers before stopping") + fs.BoolVar(&catchSigpipe, "catch-sigpipe", catchSigpipe, "catch and ignore SIGPIPE on stdout and stderr if specified") + fs.IntVar(&maxStackSize, "max-stack-size", maxStackSize, "configure the maximum stack size in bytes") + fs.IntVar(&tableRefreshInterval, "table-refresh-interval", tableRefreshInterval, "interval in milliseconds to refresh tables in status page with refreshRequired class") + + // pid_file.go + fs.StringVar(&pidFile, "pid_file", pidFile, "If set, the process will write its pid to the named file, and delete it on graceful shutdown.") + + timeouts = tf + }) +} + func GetInitStartTime() time.Time { mu.Lock() defer mu.Unlock() diff --git a/go/vt/vttablet/tabletmanager/tm_init.go b/go/vt/vttablet/tabletmanager/tm_init.go index 6a1a4f1b730..efb6c5e878f 100644 --- a/go/vt/vttablet/tabletmanager/tm_init.go +++ b/go/vt/vttablet/tabletmanager/tm_init.go @@ -92,7 +92,7 @@ var ( initTags flagutil.StringMapValue initTimeout = 1 * time.Minute - mysqlShutdownTimeout = 5 * time.Minute + mysqlShutdownTimeout = mysqlctl.DefaultShutdownTimeout ) func registerInitFlags(fs *pflag.FlagSet) { From 7aec15f390f9a5df401733b7bab72729a108f85e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Taylor?= Date: Wed, 27 Mar 2024 07:02:01 +0100 Subject: [PATCH 18/22] Handle panics during parallel execution (#15450) Signed-off-by: Andres Taylor Signed-off-by: Harshit Gangal Co-authored-by: Harshit Gangal --- go/vt/vtgate/scatter_conn.go | 21 ++++++ go/vt/vtgate/scatter_conn_test.go | 82 +++++++++++++++++++++++ go/vt/vttablet/sandboxconn/sandboxconn.go | 28 ++++++++ 3 files changed, 131 insertions(+) diff --git a/go/vt/vtgate/scatter_conn.go b/go/vt/vtgate/scatter_conn.go index ede88e2d9b8..2b37c865187 100644 --- a/go/vt/vtgate/scatter_conn.go +++ b/go/vt/vtgate/scatter_conn.go @@ -19,7 +19,9 @@ package vtgate import ( "context" "io" + "runtime/debug" "sync" + "sync/atomic" "time" "vitess.io/vitess/go/mysql/sqlerror" @@ -603,6 +605,12 @@ func (stc *ScatterConn) multiGo( return allErrors } +// panicData is used to capture panics during parallel execution. +type panicData struct { + p any + trace []byte +} + // multiGoTransaction performs the requested 'action' on the specified // ResolvedShards in parallel. For each shard, if the requested // session is in a transaction, it opens a new transactions on the connection, @@ -660,15 +668,28 @@ func (stc *ScatterConn) multiGoTransaction( oneShard(rs, i) } } else { + var panicRecord atomic.Value var wg sync.WaitGroup for i, rs := range rss { wg.Add(1) go func(rs *srvtopo.ResolvedShard, i int) { defer wg.Done() + defer func() { + if r := recover(); r != nil { + panicRecord.Store(&panicData{ + p: r, + trace: debug.Stack(), + }) + } + }() oneShard(rs, i) }(rs, i) } wg.Wait() + if pr, ok := panicRecord.Load().(*panicData); ok { + log.Errorf("caught a panic during parallel execution:\n%s", string(pr.trace)) + panic(pr.p) // rethrow the captured panic in the main thread + } } if session.MustRollback() { diff --git a/go/vt/vtgate/scatter_conn_test.go b/go/vt/vtgate/scatter_conn_test.go index 6e57c10bbbd..0e863805d9c 100644 --- a/go/vt/vtgate/scatter_conn_test.go +++ b/go/vt/vtgate/scatter_conn_test.go @@ -17,8 +17,11 @@ limitations under the License. package vtgate import ( + "fmt" "testing" + "vitess.io/vitess/go/vt/log" + "vitess.io/vitess/go/mysql/sqlerror" vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" @@ -105,6 +108,85 @@ func TestExecuteFailOnAutocommit(t *testing.T) { utils.MustMatch(t, []*querypb.BoundQuery{queries[1]}, sbc1.Queries, "") } +func TestExecutePanic(t *testing.T) { + ctx := utils.LeakCheckContext(t) + + createSandbox("TestExecutePanic") + hc := discovery.NewFakeHealthCheck(nil) + sc := newTestScatterConn(ctx, hc, newSandboxForCells(ctx, []string{"aa"}), "aa") + sbc0 := hc.AddTestTablet("aa", "0", 1, "TestExecutePanic", "0", topodatapb.TabletType_PRIMARY, true, 1, nil) + sbc1 := hc.AddTestTablet("aa", "1", 1, "TestExecutePanic", "1", topodatapb.TabletType_PRIMARY, true, 1, nil) + sbc0.SetPanic(42) + sbc1.SetPanic(42) + rss := []*srvtopo.ResolvedShard{ + { + Target: &querypb.Target{ + Keyspace: "TestExecutePanic", + Shard: "0", + TabletType: topodatapb.TabletType_PRIMARY, + }, + Gateway: sbc0, + }, + { + Target: &querypb.Target{ + Keyspace: "TestExecutePanic", + Shard: "1", + TabletType: topodatapb.TabletType_PRIMARY, + }, + Gateway: sbc1, + }, + } + queries := []*querypb.BoundQuery{ + { + // This will fail to go to shard. It will be rejected at vtgate. + Sql: "query1", + BindVariables: map[string]*querypb.BindVariable{ + "bv0": sqltypes.Int64BindVariable(0), + }, + }, + { + // This will go to shard. + Sql: "query2", + BindVariables: map[string]*querypb.BindVariable{ + "bv1": sqltypes.Int64BindVariable(1), + }, + }, + } + // shard 0 - has transaction + // shard 1 - does not have transaction. + session := &vtgatepb.Session{ + InTransaction: true, + ShardSessions: []*vtgatepb.Session_ShardSession{ + { + Target: &querypb.Target{Keyspace: "TestExecutePanic", Shard: "0", TabletType: topodatapb.TabletType_PRIMARY, Cell: "aa"}, + TransactionId: 123, + TabletAlias: nil, + }, + }, + Autocommit: false, + } + + original := log.Errorf + defer func() { + log.Errorf = original + }() + + var logMessage string + log.Errorf = func(format string, args ...any) { + logMessage = fmt.Sprintf(format, args...) + } + + defer func() { + r := recover() + require.NotNil(t, r, "The code did not panic") + // assert we are seeing the stack trace + require.Contains(t, logMessage, "(*ScatterConn).multiGoTransaction") + }() + + _, _ = sc.ExecuteMultiShard(ctx, nil, rss, queries, NewSafeSession(session), true /*autocommit*/, false) + +} + func TestReservedOnMultiReplica(t *testing.T) { ctx := utils.LeakCheckContext(t) diff --git a/go/vt/vttablet/sandboxconn/sandboxconn.go b/go/vt/vttablet/sandboxconn/sandboxconn.go index ad9c1b3702f..2d0f5d9fff1 100644 --- a/go/vt/vttablet/sandboxconn/sandboxconn.go +++ b/go/vt/vttablet/sandboxconn/sandboxconn.go @@ -125,6 +125,9 @@ type SandboxConn struct { // this error will only happen once EphemeralShardErr error + // if this is not nil, any calls will panic the tablet + panicThis interface{} + NotServing bool getSchemaResult []map[string]string @@ -206,6 +209,7 @@ func (sbc *SandboxConn) SetSchemaResult(r []map[string]string) { // Execute is part of the QueryService interface. func (sbc *SandboxConn) Execute(ctx context.Context, target *querypb.Target, query string, bindVars map[string]*querypb.BindVariable, transactionID, reservedID int64, options *querypb.ExecuteOptions) (*sqltypes.Result, error) { + sbc.panicIfNeeded() sbc.execMu.Lock() defer sbc.execMu.Unlock() sbc.ExecCount.Add(1) @@ -238,6 +242,7 @@ func (sbc *SandboxConn) Execute(ctx context.Context, target *querypb.Target, que // StreamExecute is part of the QueryService interface. func (sbc *SandboxConn) StreamExecute(ctx context.Context, target *querypb.Target, query string, bindVars map[string]*querypb.BindVariable, transactionID int64, reservedID int64, options *querypb.ExecuteOptions, callback func(*sqltypes.Result) error) error { + sbc.panicIfNeeded() sbc.sExecMu.Lock() sbc.ExecCount.Add(1) bv := make(map[string]*querypb.BindVariable) @@ -278,6 +283,7 @@ func (sbc *SandboxConn) StreamExecute(ctx context.Context, target *querypb.Targe // Begin is part of the QueryService interface. func (sbc *SandboxConn) Begin(ctx context.Context, target *querypb.Target, options *querypb.ExecuteOptions) (queryservice.TransactionState, error) { + sbc.panicIfNeeded() return sbc.begin(ctx, target, nil, 0, options) } @@ -303,6 +309,7 @@ func (sbc *SandboxConn) begin(ctx context.Context, target *querypb.Target, preQu // Commit is part of the QueryService interface. func (sbc *SandboxConn) Commit(ctx context.Context, target *querypb.Target, transactionID int64) (int64, error) { + sbc.panicIfNeeded() sbc.CommitCount.Add(1) reservedID := sbc.getTxReservedID(transactionID) if reservedID != 0 { @@ -323,6 +330,7 @@ func (sbc *SandboxConn) Rollback(ctx context.Context, target *querypb.Target, tr // Prepare prepares the specified transaction. func (sbc *SandboxConn) Prepare(ctx context.Context, target *querypb.Target, transactionID int64, dtid string) (err error) { + sbc.panicIfNeeded() sbc.PrepareCount.Add(1) if sbc.MustFailPrepare > 0 { sbc.MustFailPrepare-- @@ -333,6 +341,7 @@ func (sbc *SandboxConn) Prepare(ctx context.Context, target *querypb.Target, tra // CommitPrepared commits the prepared transaction. func (sbc *SandboxConn) CommitPrepared(ctx context.Context, target *querypb.Target, dtid string) (err error) { + sbc.panicIfNeeded() sbc.CommitPreparedCount.Add(1) if sbc.MustFailCommitPrepared > 0 { sbc.MustFailCommitPrepared-- @@ -343,6 +352,7 @@ func (sbc *SandboxConn) CommitPrepared(ctx context.Context, target *querypb.Targ // RollbackPrepared rolls back the prepared transaction. func (sbc *SandboxConn) RollbackPrepared(ctx context.Context, target *querypb.Target, dtid string, originalID int64) (err error) { + sbc.panicIfNeeded() sbc.RollbackPreparedCount.Add(1) if sbc.MustFailRollbackPrepared > 0 { sbc.MustFailRollbackPrepared-- @@ -364,6 +374,7 @@ func (sbc *SandboxConn) CreateTransaction(ctx context.Context, target *querypb.T // StartCommit atomically commits the transaction along with the // decision to commit the associated 2pc transaction. func (sbc *SandboxConn) StartCommit(ctx context.Context, target *querypb.Target, transactionID int64, dtid string) (err error) { + sbc.panicIfNeeded() sbc.StartCommitCount.Add(1) if sbc.MustFailStartCommit > 0 { sbc.MustFailStartCommit-- @@ -375,6 +386,7 @@ func (sbc *SandboxConn) StartCommit(ctx context.Context, target *querypb.Target, // SetRollback transitions the 2pc transaction to the Rollback state. // If a transaction id is provided, that transaction is also rolled back. func (sbc *SandboxConn) SetRollback(ctx context.Context, target *querypb.Target, dtid string, transactionID int64) (err error) { + sbc.panicIfNeeded() sbc.SetRollbackCount.Add(1) if sbc.MustFailSetRollback > 0 { sbc.MustFailSetRollback-- @@ -410,6 +422,7 @@ func (sbc *SandboxConn) ReadTransaction(ctx context.Context, target *querypb.Tar // BeginExecute is part of the QueryService interface. func (sbc *SandboxConn) BeginExecute(ctx context.Context, target *querypb.Target, preQueries []string, query string, bindVars map[string]*querypb.BindVariable, reservedID int64, options *querypb.ExecuteOptions) (queryservice.TransactionState, *sqltypes.Result, error) { + sbc.panicIfNeeded() state, err := sbc.begin(ctx, target, preQueries, reservedID, options) if state.TransactionID != 0 { sbc.setTxReservedID(state.TransactionID, reservedID) @@ -423,6 +436,7 @@ func (sbc *SandboxConn) BeginExecute(ctx context.Context, target *querypb.Target // BeginStreamExecute is part of the QueryService interface. func (sbc *SandboxConn) BeginStreamExecute(ctx context.Context, target *querypb.Target, preQueries []string, sql string, bindVariables map[string]*querypb.BindVariable, reservedID int64, options *querypb.ExecuteOptions, callback func(*sqltypes.Result) error) (queryservice.TransactionState, error) { + sbc.panicIfNeeded() state, err := sbc.begin(ctx, target, preQueries, reservedID, options) if state.TransactionID != 0 { sbc.setTxReservedID(state.TransactionID, reservedID) @@ -567,6 +581,7 @@ func (sbc *SandboxConn) HandlePanic(err *error) { // ReserveBeginExecute implements the QueryService interface func (sbc *SandboxConn) ReserveBeginExecute(ctx context.Context, target *querypb.Target, preQueries []string, postBeginQueries []string, sql string, bindVariables map[string]*querypb.BindVariable, options *querypb.ExecuteOptions) (queryservice.ReservedTransactionState, *sqltypes.Result, error) { + sbc.panicIfNeeded() reservedID := sbc.reserve(ctx, target, preQueries, bindVariables, 0, options) state, result, err := sbc.BeginExecute(ctx, target, postBeginQueries, sql, bindVariables, reservedID, options) if state.TransactionID != 0 { @@ -581,6 +596,7 @@ func (sbc *SandboxConn) ReserveBeginExecute(ctx context.Context, target *querypb // ReserveBeginStreamExecute is part of the QueryService interface. func (sbc *SandboxConn) ReserveBeginStreamExecute(ctx context.Context, target *querypb.Target, preQueries []string, postBeginQueries []string, sql string, bindVariables map[string]*querypb.BindVariable, options *querypb.ExecuteOptions, callback func(*sqltypes.Result) error) (queryservice.ReservedTransactionState, error) { + sbc.panicIfNeeded() reservedID := sbc.reserve(ctx, target, preQueries, bindVariables, 0, options) state, err := sbc.BeginStreamExecute(ctx, target, postBeginQueries, sql, bindVariables, reservedID, options, callback) if state.TransactionID != 0 { @@ -595,6 +611,7 @@ func (sbc *SandboxConn) ReserveBeginStreamExecute(ctx context.Context, target *q // ReserveExecute implements the QueryService interface func (sbc *SandboxConn) ReserveExecute(ctx context.Context, target *querypb.Target, preQueries []string, sql string, bindVariables map[string]*querypb.BindVariable, transactionID int64, options *querypb.ExecuteOptions) (queryservice.ReservedState, *sqltypes.Result, error) { + sbc.panicIfNeeded() reservedID := sbc.reserve(ctx, target, preQueries, bindVariables, transactionID, options) result, err := sbc.Execute(ctx, target, sql, bindVariables, transactionID, reservedID, options) if transactionID != 0 { @@ -608,6 +625,7 @@ func (sbc *SandboxConn) ReserveExecute(ctx context.Context, target *querypb.Targ // ReserveStreamExecute is part of the QueryService interface. func (sbc *SandboxConn) ReserveStreamExecute(ctx context.Context, target *querypb.Target, preQueries []string, sql string, bindVariables map[string]*querypb.BindVariable, transactionID int64, options *querypb.ExecuteOptions, callback func(*sqltypes.Result) error) (queryservice.ReservedState, error) { + sbc.panicIfNeeded() reservedID := sbc.reserve(ctx, target, preQueries, bindVariables, transactionID, options) err := sbc.StreamExecute(ctx, target, sql, bindVariables, transactionID, reservedID, options, callback) if transactionID != 0 { @@ -769,3 +787,13 @@ var StreamRowResult = &sqltypes.Result{ sqltypes.NewVarChar("foo"), }}, } + +func (sbc *SandboxConn) SetPanic(i interface{}) { + sbc.panicThis = i +} + +func (sbc *SandboxConn) panicIfNeeded() { + if sbc.panicThis != nil { + panic(sbc.panicThis) + } +} From 2b478cdc24854304e0b7b8765b1f7111da7899bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Taylor?= Date: Wed, 27 Mar 2024 14:42:42 +0100 Subject: [PATCH 19/22] chore: use interface instead of struct for tests (#15581) --- go/test/endtoend/utils/cmp.go | 17 +++++++++++++---- go/test/endtoend/utils/mysql.go | 18 ++++++++---------- go/test/endtoend/utils/utils.go | 2 +- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/go/test/endtoend/utils/cmp.go b/go/test/endtoend/utils/cmp.go index 8d0b56ac6b3..678f4499f45 100644 --- a/go/test/endtoend/utils/cmp.go +++ b/go/test/endtoend/utils/cmp.go @@ -29,12 +29,17 @@ import ( "vitess.io/vitess/go/sqltypes" ) +type TestingT interface { + require.TestingT + Helper() +} + type MySQLCompare struct { - t *testing.T + t TestingT MySQLConn, VtConn *mysql.Conn } -func NewMySQLCompare(t *testing.T, vtParams, mysqlParams mysql.ConnParams) (MySQLCompare, error) { +func NewMySQLCompare(t TestingT, vtParams, mysqlParams mysql.ConnParams) (MySQLCompare, error) { ctx := context.Background() vtConn, err := mysql.Connect(ctx, &vtParams) if err != nil { @@ -53,6 +58,10 @@ func NewMySQLCompare(t *testing.T, vtParams, mysqlParams mysql.ConnParams) (MySQ }, nil } +func (mcmp *MySQLCompare) AsT() *testing.T { + return mcmp.t.(*testing.T) +} + func (mcmp *MySQLCompare) Close() { mcmp.VtConn.Close() mcmp.MySQLConn.Close() @@ -73,7 +82,7 @@ func (mcmp *MySQLCompare) AssertMatches(query, expected string) { // SkipIfBinaryIsBelowVersion should be used instead of using utils.SkipIfBinaryIsBelowVersion(t, // This is because we might be inside a Run block that has a different `t` variable func (mcmp *MySQLCompare) SkipIfBinaryIsBelowVersion(majorVersion int, binary string) { - SkipIfBinaryIsBelowVersion(mcmp.t, majorVersion, binary) + SkipIfBinaryIsBelowVersion(mcmp.t.(*testing.T), majorVersion, binary) } // AssertMatchesAny ensures the given query produces any one of the expected results. @@ -264,7 +273,7 @@ func (mcmp *MySQLCompare) ExecAndIgnore(query string) (*sqltypes.Result, error) } func (mcmp *MySQLCompare) Run(query string, f func(mcmp *MySQLCompare)) { - mcmp.t.Run(query, func(t *testing.T) { + mcmp.AsT().Run(query, func(t *testing.T) { inner := &MySQLCompare{ t: t, MySQLConn: mcmp.MySQLConn, diff --git a/go/test/endtoend/utils/mysql.go b/go/test/endtoend/utils/mysql.go index 41a70e2dfa4..790e1fc4ba1 100644 --- a/go/test/endtoend/utils/mysql.go +++ b/go/test/endtoend/utils/mysql.go @@ -22,7 +22,6 @@ import ( "fmt" "os" "path" - "testing" "time" "github.com/stretchr/testify/assert" @@ -169,18 +168,18 @@ func prepareMySQLWithSchema(params mysql.ConnParams, sql string) error { return nil } -func compareVitessAndMySQLResults(t *testing.T, query string, vtConn *mysql.Conn, vtQr, mysqlQr *sqltypes.Result, compareColumnNames bool) error { +func compareVitessAndMySQLResults(t TestingT, query string, vtConn *mysql.Conn, vtQr, mysqlQr *sqltypes.Result, compareColumnNames bool) error { t.Helper() if vtQr == nil && mysqlQr == nil { return nil } if vtQr == nil { - t.Error("Vitess result is 'nil' while MySQL's is not.") + t.Errorf("Vitess result is 'nil' while MySQL's is not.") return errors.New("Vitess result is 'nil' while MySQL's is not.\n") } if mysqlQr == nil { - t.Error("MySQL result is 'nil' while Vitess' is not.") + t.Errorf("MySQL result is 'nil' while Vitess' is not.") return errors.New("MySQL result is 'nil' while Vitess' is not.\n") } @@ -209,7 +208,7 @@ func compareVitessAndMySQLResults(t *testing.T, query string, vtConn *mysql.Conn stmt, err := sqlparser.NewTestParser().Parse(query) if err != nil { - t.Error(err) + t.Errorf(err.Error()) return err } orderBy := false @@ -237,11 +236,11 @@ func compareVitessAndMySQLResults(t *testing.T, query string, vtConn *mysql.Conn errStr += fmt.Sprintf("query plan: \n%s\n", qr.Rows[0][0].ToString()) } } - t.Error(errStr) + t.Errorf(errStr) return errors.New(errStr) } -func checkFields(t *testing.T, columnName string, vtField, myField *querypb.Field) { +func checkFields(t TestingT, columnName string, vtField, myField *querypb.Field) { t.Helper() if vtField.Type != myField.Type { t.Errorf("for column %s field types do not match\nNot equal: \nMySQL: %v\nVitess: %v\n", columnName, myField.Type.String(), vtField.Type.String()) @@ -255,10 +254,9 @@ func checkFields(t *testing.T, columnName string, vtField, myField *querypb.Fiel } } -func compareVitessAndMySQLErrors(t *testing.T, vtErr, mysqlErr error) { +func compareVitessAndMySQLErrors(t TestingT, vtErr, mysqlErr error) { if vtErr != nil && mysqlErr != nil || vtErr == nil && mysqlErr == nil { return } - out := fmt.Sprintf("Vitess and MySQL are not erroring the same way.\nVitess error: %v\nMySQL error: %v", vtErr, mysqlErr) - t.Error(out) + t.Errorf("Vitess and MySQL are not erroring the same way.\nVitess error: %v\nMySQL error: %v", vtErr, mysqlErr) } diff --git a/go/test/endtoend/utils/utils.go b/go/test/endtoend/utils/utils.go index d94da27377e..6098fc63eb6 100644 --- a/go/test/endtoend/utils/utils.go +++ b/go/test/endtoend/utils/utils.go @@ -187,7 +187,7 @@ func ExecCompareMySQL(t *testing.T, vtConn, mysqlConn *mysql.Conn, query string) // ExecAllowError executes the given query without failing the test if it produces // an error. The error is returned to the client, along with the result set. -func ExecAllowError(t testing.TB, conn *mysql.Conn, query string) (*sqltypes.Result, error) { +func ExecAllowError(t TestingT, conn *mysql.Conn, query string) (*sqltypes.Result, error) { t.Helper() return conn.ExecuteFetch(query, 1000, true) } From df1285ca4c695e6e349d70202abbfe65725fcce0 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Wed, 27 Mar 2024 13:18:24 -0400 Subject: [PATCH 20/22] VReplication: Move the Reshard v2 workflow to vtctldclient (#15579) Signed-off-by: Matt Lord --- .../vreplication/common/switchtraffic.go | 1 + go/streamlog/streamlog_test.go | 8 +- go/test/endtoend/cluster/vttablet_process.go | 1 + go/test/endtoend/vreplication/helper_test.go | 13 +- .../vreplication/movetables_buffering_test.go | 3 +- .../partial_movetables_seq_test.go | 9 +- .../resharding_workflows_v2_test.go | 132 +++++++++++------- .../endtoend/vreplication/wrappers_test.go | 6 +- go/vt/vtctl/workflow/server.go | 33 ++--- go/vt/vtctl/workflow/traffic_switcher.go | 43 +++--- .../tabletmanager/rpc_vreplication.go | 2 +- test/config.json | 26 ++-- 12 files changed, 151 insertions(+), 126 deletions(-) diff --git a/go/cmd/vtctldclient/command/vreplication/common/switchtraffic.go b/go/cmd/vtctldclient/command/vreplication/common/switchtraffic.go index 019367fe82b..4004afc0ac0 100644 --- a/go/cmd/vtctldclient/command/vreplication/common/switchtraffic.go +++ b/go/cmd/vtctldclient/command/vreplication/common/switchtraffic.go @@ -91,6 +91,7 @@ func commandSwitchTraffic(cmd *cobra.Command, args []string) error { req := &vtctldatapb.WorkflowSwitchTrafficRequest{ Keyspace: BaseOptions.TargetKeyspace, Workflow: BaseOptions.Workflow, + Cells: SwitchTrafficOptions.Cells, TabletTypes: SwitchTrafficOptions.TabletTypes, MaxReplicationLagAllowed: protoutil.DurationToProto(SwitchTrafficOptions.MaxReplicationLagAllowed), Timeout: protoutil.DurationToProto(SwitchTrafficOptions.Timeout), diff --git a/go/streamlog/streamlog_test.go b/go/streamlog/streamlog_test.go index ab01dd4ccb2..538cae99b54 100644 --- a/go/streamlog/streamlog_test.go +++ b/go/streamlog/streamlog_test.go @@ -216,7 +216,7 @@ func TestFile(t *testing.T) { logger.Send(&logMessage{"test 2"}) // Allow time for propagation - time.Sleep(10 * time.Millisecond) + time.Sleep(100 * time.Millisecond) want := "test 1\ntest 2\n" contents, _ := os.ReadFile(logPath) @@ -230,7 +230,7 @@ func TestFile(t *testing.T) { os.Rename(logPath, rotatedPath) logger.Send(&logMessage{"test 3"}) - time.Sleep(10 * time.Millisecond) + time.Sleep(100 * time.Millisecond) want = "test 1\ntest 2\ntest 3\n" contents, _ = os.ReadFile(rotatedPath) @@ -244,10 +244,10 @@ func TestFile(t *testing.T) { if err := syscall.Kill(syscall.Getpid(), syscall.SIGUSR2); err != nil { t.Logf("failed to send streamlog rotate signal: %v", err) } - time.Sleep(10 * time.Millisecond) + time.Sleep(100 * time.Millisecond) logger.Send(&logMessage{"test 4"}) - time.Sleep(10 * time.Millisecond) + time.Sleep(100 * time.Millisecond) want = "test 1\ntest 2\ntest 3\n" contents, _ = os.ReadFile(rotatedPath) diff --git a/go/test/endtoend/cluster/vttablet_process.go b/go/test/endtoend/cluster/vttablet_process.go index c98ed37afc0..bd016b1c1c4 100644 --- a/go/test/endtoend/cluster/vttablet_process.go +++ b/go/test/endtoend/cluster/vttablet_process.go @@ -690,6 +690,7 @@ func VttabletProcessInstance(port, grpcPort, tabletUID int, cell, shard, keyspac Binary: "vttablet", FileToLogQueries: path.Join(tmpDirectory, fmt.Sprintf("/vt_%010d_querylog.txt", tabletUID)), Directory: path.Join(os.Getenv("VTDATAROOT"), fmt.Sprintf("/vt_%010d", tabletUID)), + Cell: cell, TabletPath: fmt.Sprintf("%s-%010d", cell, tabletUID), ServiceMap: "grpc-queryservice,grpc-tabletmanager,grpc-updatestream,grpc-throttler", LogDir: tmpDirectory, diff --git a/go/test/endtoend/vreplication/helper_test.go b/go/test/endtoend/vreplication/helper_test.go index 022262d4b15..e187c8398b6 100644 --- a/go/test/endtoend/vreplication/helper_test.go +++ b/go/test/endtoend/vreplication/helper_test.go @@ -46,9 +46,11 @@ import ( "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/schema" "vitess.io/vitess/go/vt/sqlparser" + "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/throttlerapp" binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" ) const ( @@ -377,6 +379,9 @@ func waitForWorkflowState(t *testing.T, vc *VitessCluster, ksWorkflow string, wa } } } + if wantState == binlogdatapb.VReplicationWorkflowState_Running.String() && attributeValue.Get("Pos").String() == "" { + done = false + } } else { done = false } @@ -410,7 +415,7 @@ func waitForWorkflowState(t *testing.T, vc *VitessCluster, ksWorkflow string, wa // as a CSV have secondary keys. This is useful when testing the // --defer-secondary-keys flag to confirm that the secondary keys // were re-added by the time the workflow hits the running phase. -// For a Reshard workflow, where no tables are specififed, pass +// For a Reshard workflow, where no tables are specified, pass // an empty string for the tables and all tables in the target // keyspace will be checked. func confirmTablesHaveSecondaryKeys(t *testing.T, tablets []*cluster.VttabletProcess, ksName string, tables string) { @@ -430,6 +435,12 @@ func confirmTablesHaveSecondaryKeys(t *testing.T, tablets []*cluster.VttabletPro } } for _, tablet := range tablets { + // Be sure that the schema is up to date. + err := vc.VtctldClient.ExecuteCommand("ReloadSchema", topoproto.TabletAliasString(&topodatapb.TabletAlias{ + Cell: tablet.Cell, + Uid: uint32(tablet.TabletUID), + })) + require.NoError(t, err) for _, table := range tableArr { if schema.IsInternalOperationTableName(table) { continue diff --git a/go/test/endtoend/vreplication/movetables_buffering_test.go b/go/test/endtoend/vreplication/movetables_buffering_test.go index e853022bfd4..88231d4be87 100644 --- a/go/test/endtoend/vreplication/movetables_buffering_test.go +++ b/go/test/endtoend/vreplication/movetables_buffering_test.go @@ -8,7 +8,6 @@ import ( "github.com/stretchr/testify/require" "vitess.io/vitess/go/vt/log" - "vitess.io/vitess/go/vt/wrangler" ) func TestMoveTablesBuffering(t *testing.T) { @@ -16,7 +15,7 @@ func TestMoveTablesBuffering(t *testing.T) { vc = setupMinimalCluster(t) defer vc.TearDown() - currentWorkflowType = wrangler.MoveTablesWorkflow + currentWorkflowType = binlogdatapb.VReplicationWorkflowType_MoveTables setupMinimalCustomerKeyspace(t) tables := "loadtest" err := tstWorkflowExec(t, defaultCellName, workflowName, sourceKs, targetKs, diff --git a/go/test/endtoend/vreplication/partial_movetables_seq_test.go b/go/test/endtoend/vreplication/partial_movetables_seq_test.go index bb354a5ec01..eec304e0a4d 100644 --- a/go/test/endtoend/vreplication/partial_movetables_seq_test.go +++ b/go/test/endtoend/vreplication/partial_movetables_seq_test.go @@ -27,7 +27,6 @@ import ( "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/test/endtoend/cluster" "vitess.io/vitess/go/vt/log" - "vitess.io/vitess/go/vt/wrangler" binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" ) @@ -228,12 +227,12 @@ func (wf *workflow) create() { cell := wf.tc.defaultCellName switch typ { case "movetables": - currentWorkflowType = wrangler.MoveTablesWorkflow + currentWorkflowType = binlogdatapb.VReplicationWorkflowType_MoveTables sourceShards := strings.Join(wf.options.sourceShards, ",") err = tstWorkflowExec(t, cell, wf.name, wf.fromKeyspace, wf.toKeyspace, strings.Join(wf.options.tables, ","), workflowActionCreate, "", sourceShards, "", defaultWorkflowExecOptions) case "reshard": - currentWorkflowType = wrangler.ReshardWorkflow + currentWorkflowType = binlogdatapb.VReplicationWorkflowType_Reshard sourceShards := strings.Join(wf.options.sourceShards, ",") targetShards := strings.Join(wf.options.targetShards, ",") if targetShards == "" { @@ -389,7 +388,7 @@ func TestPartialMoveTablesWithSequences(t *testing.T) { // Switch all traffic for the shard wf80Dash.switchTraffic() - expectedSwitchOutput := fmt.Sprintf("SwitchTraffic was successful for workflow %s.%s\nStart State: Reads Not Switched. Writes Not Switched\nCurrent State: Reads partially switched, for shards: %s. Writes partially switched, for shards: %s\n\n", + expectedSwitchOutput := fmt.Sprintf("SwitchTraffic was successful for workflow %s.%s\n\nStart State: Reads Not Switched. Writes Not Switched\nCurrent State: Reads partially switched, for shards: %s. Writes partially switched, for shards: %s\n\n", targetKs, wfName, shard, shard) require.Equal(t, expectedSwitchOutput, lastOutput) currentCustomerCount = getCustomerCount(t, "") @@ -449,7 +448,7 @@ func TestPartialMoveTablesWithSequences(t *testing.T) { wfDash80.create() wfDash80.switchTraffic() - expectedSwitchOutput := fmt.Sprintf("SwitchTraffic was successful for workflow %s.%s\nStart State: Reads partially switched, for shards: 80-. Writes partially switched, for shards: 80-\nCurrent State: All Reads Switched. All Writes Switched\n\n", + expectedSwitchOutput := fmt.Sprintf("SwitchTraffic was successful for workflow %s.%s\n\nStart State: Reads partially switched, for shards: 80-. Writes partially switched, for shards: 80-\nCurrent State: All Reads Switched. All Writes Switched\n\n", targetKs, wfName) require.Equal(t, expectedSwitchOutput, lastOutput) diff --git a/go/test/endtoend/vreplication/resharding_workflows_v2_test.go b/go/test/endtoend/vreplication/resharding_workflows_v2_test.go index 0acb922cd30..b14b649d6b7 100644 --- a/go/test/endtoend/vreplication/resharding_workflows_v2_test.go +++ b/go/test/endtoend/vreplication/resharding_workflows_v2_test.go @@ -17,12 +17,12 @@ limitations under the License. package vreplication import ( + "encoding/json" "fmt" "net" "strconv" "strings" "testing" - "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -56,7 +56,7 @@ var ( sourceTab, sourceReplicaTab, sourceRdonlyTab *cluster.VttabletProcess lastOutput string - currentWorkflowType wrangler.VReplicationWorkflowType + currentWorkflowType binlogdatapb.VReplicationWorkflowType ) type workflowExecOptions struct { @@ -103,59 +103,64 @@ func tstWorkflowExec(t *testing.T, cells, workflow, sourceKs, targetKs, tables, sourceShards, targetShards string, options *workflowExecOptions) error { var args []string - if currentWorkflowType == wrangler.MoveTablesWorkflow { + if currentWorkflowType == binlogdatapb.VReplicationWorkflowType_MoveTables { args = append(args, "MoveTables") } else { args = append(args, "Reshard") } - args = append(args, "--") + args = append(args, "--workflow", workflow, "--target-keyspace", targetKs, action) - if BypassLagCheck { - args = append(args, "--max_replication_lag_allowed=2542087h") - } - if options.atomicCopy { - args = append(args, "--atomic-copy") - } switch action { case workflowActionCreate: - if currentWorkflowType == wrangler.MoveTablesWorkflow { - args = append(args, "--source", sourceKs) + if currentWorkflowType == binlogdatapb.VReplicationWorkflowType_MoveTables { + args = append(args, "--source-keyspace", sourceKs) if tables != "" { args = append(args, "--tables", tables) } else { - args = append(args, "--all") + args = append(args, "--all-tables") } if sourceShards != "" { - args = append(args, "--source_shards", sourceShards) + args = append(args, "--source-shards", sourceShards) } } else { - args = append(args, "--source_shards", sourceShards, "--target_shards", targetShards) + args = append(args, "--source-shards", sourceShards, "--target-shards", targetShards) } // Test new experimental --defer-secondary-keys flag switch currentWorkflowType { - case wrangler.MoveTablesWorkflow, wrangler.MigrateWorkflow, wrangler.ReshardWorkflow: - + case binlogdatapb.VReplicationWorkflowType_MoveTables, binlogdatapb.VReplicationWorkflowType_Migrate, binlogdatapb.VReplicationWorkflowType_Reshard: if !options.atomicCopy && options.deferSecondaryKeys { args = append(args, "--defer-secondary-keys") } - args = append(args, "--initialize-target-sequences") // Only used for MoveTables } default: if options.shardSubset != "" { args = append(args, "--shards", options.shardSubset) } } - if cells != "" { + if currentWorkflowType == binlogdatapb.VReplicationWorkflowType_MoveTables && action == workflowActionSwitchTraffic { + args = append(args, "--initialize-target-sequences") + } + if action == workflowActionSwitchTraffic || action == workflowActionReverseTraffic { + if BypassLagCheck { + args = append(args, "--max-replication-lag-allowed=2542087h") + } + args = append(args, "--timeout=90s") + } + if action == workflowActionCreate && options.atomicCopy { + args = append(args, "--atomic-copy") + } + if (action == workflowActionCreate || action == workflowActionSwitchTraffic || action == workflowActionReverseTraffic) && cells != "" { args = append(args, "--cells", cells) } - if tabletTypes != "" { - args = append(args, "--tablet_types", tabletTypes) + if action != workflowActionComplete && tabletTypes != "" { + args = append(args, "--tablet-types", tabletTypes) } - args = append(args, "--timeout", time.Minute.String()) - ksWorkflow := fmt.Sprintf("%s.%s", targetKs, workflow) - args = append(args, action, ksWorkflow) - output, err := vc.VtctlClient.ExecuteCommandWithOutput(args...) + args = append(args, "--action_timeout=10m") // At this point something is up so fail the test + if debugMode { + t.Logf("Executing workflow command: vtctldclient %v", strings.Join(args, " ")) + } + output, err := vc.VtctldClient.ExecuteCommandWithOutput(args...) lastOutput = output if err != nil { return fmt.Errorf("%s: %s", err, output) @@ -285,8 +290,8 @@ func checkStates(t *testing.T, startState, endState string) { require.Contains(t, lastOutput, fmt.Sprintf("Current State: %s", endState)) } -func getCurrentState(t *testing.T) string { - if err := tstWorkflowAction(t, "GetState", "", ""); err != nil { +func getCurrentStatus(t *testing.T) string { + if err := tstWorkflowAction(t, "status", "", ""); err != nil { return err.Error() } return strings.TrimSpace(strings.Trim(lastOutput, "\n")) @@ -335,7 +340,7 @@ func testVSchemaForSequenceAfterMoveTables(t *testing.T) { // at this point the unsharded product and sharded customer keyspaces are created by previous tests // use MoveTables to move customer2 from product to customer using - currentWorkflowType = wrangler.MoveTablesWorkflow + currentWorkflowType = binlogdatapb.VReplicationWorkflowType_MoveTables err := tstWorkflowExec(t, defaultCellName, "wf2", sourceKs, targetKs, "customer2", workflowActionCreate, "", "", "", defaultWorkflowExecOptions) require.NoError(t, err) @@ -353,13 +358,13 @@ func testVSchemaForSequenceAfterMoveTables(t *testing.T) { vtgateConn, closeConn := getVTGateConn() defer closeConn() // sanity check - output, err := vc.VtctlClient.ExecuteCommandWithOutput("GetVSchema", "product") + output, err := vc.VtctldClient.ExecuteCommandWithOutput("GetVSchema", "product") require.NoError(t, err) assert.NotContains(t, output, "customer2\"", "customer2 still found in keyspace product") waitForRowCount(t, vtgateConn, "customer", "customer2", 3) // check that customer2 has the sequence tag - output, err = vc.VtctlClient.ExecuteCommandWithOutput("GetVSchema", "customer") + output, err = vc.VtctldClient.ExecuteCommandWithOutput("GetVSchema", "customer") require.NoError(t, err) assert.Contains(t, output, "\"sequence\": \"customer_seq2\"", "customer2 sequence missing in keyspace customer") @@ -387,12 +392,12 @@ func testVSchemaForSequenceAfterMoveTables(t *testing.T) { require.NoError(t, err) // sanity check - output, err = vc.VtctlClient.ExecuteCommandWithOutput("GetVSchema", "product") + output, err = vc.VtctldClient.ExecuteCommandWithOutput("GetVSchema", "product") require.NoError(t, err) assert.Contains(t, output, "customer2\"", "customer2 not found in keyspace product ") // check that customer2 still has the sequence tag - output, err = vc.VtctlClient.ExecuteCommandWithOutput("GetVSchema", "product") + output, err = vc.VtctldClient.ExecuteCommandWithOutput("GetVSchema", "product") require.NoError(t, err) assert.Contains(t, output, "\"sequence\": \"customer_seq2\"", "customer2 still found in keyspace product") @@ -432,7 +437,7 @@ func testReplicatingWithPKEnumCols(t *testing.T) { func testReshardV2Workflow(t *testing.T) { vtgateConn, closeConn := getVTGateConn() defer closeConn() - currentWorkflowType = wrangler.ReshardWorkflow + currentWorkflowType = binlogdatapb.VReplicationWorkflowType_Reshard // create internal tables on the original customer shards that should be // ignored and not show up on the new shards @@ -441,9 +446,6 @@ func testReshardV2Workflow(t *testing.T) { createAdditionalCustomerShards(t, "-40,40-80,80-c0,c0-") createReshardWorkflow(t, "-80,80-", "-40,40-80,80-c0,c0-") - if !strings.Contains(lastOutput, "Workflow started successfully") { - t.Fail() - } validateReadsRouteToSource(t, "replica") validateWritesRouteToSource(t) @@ -461,16 +463,14 @@ func testReshardV2Workflow(t *testing.T) { func testMoveTablesV2Workflow(t *testing.T) { vtgateConn, closeConn := getVTGateConn() defer closeConn() - currentWorkflowType = wrangler.MoveTablesWorkflow + currentWorkflowType = binlogdatapb.VReplicationWorkflowType_MoveTables // test basic forward and reverse flows setupCustomerKeyspace(t) // The purge table should get skipped/ignored // If it's not then we'll get an error as the table doesn't exist in the vschema createMoveTablesWorkflow(t, "customer,loadtest,vdiff_order,reftable,_vt_PURGE_4f9194b43b2011eb8a0104ed332e05c2_20221210194431") - if !strings.Contains(lastOutput, "Workflow started successfully") { - t.Fail() - } + waitForWorkflowState(t, vc, ksWorkflow, binlogdatapb.VReplicationWorkflowState_Running.String()) validateReadsRouteToSource(t, "replica") validateWritesRouteToSource(t) @@ -485,26 +485,47 @@ func testMoveTablesV2Workflow(t *testing.T) { testRestOfWorkflow(t) - listAllArgs := []string{"workflow", "customer", "listall"} - output, _ := vc.VtctlClient.ExecuteCommandWithOutput(listAllArgs...) - require.Contains(t, output, "No workflows found in keyspace customer") + listOutputContainsWorkflow := func(output string, workflow string) bool { + workflows := []string{} + err := json.Unmarshal([]byte(output), &workflows) + require.NoError(t, err) + for _, w := range workflows { + if w == workflow { + return true + } + } + return false + } + listOutputIsEmpty := func(output string) bool { + workflows := []string{} + err := json.Unmarshal([]byte(output), &workflows) + require.NoError(t, err) + return len(workflows) == 0 + } + + listAllArgs := []string{"workflow", "--keyspace", "customer", "list"} + output, err := vc.VtctldClient.ExecuteCommandWithOutput(listAllArgs...) + require.NoError(t, err) + require.True(t, listOutputIsEmpty(output)) testVSchemaForSequenceAfterMoveTables(t) createMoveTablesWorkflow(t, "Lead,Lead-1") - output, _ = vc.VtctlClient.ExecuteCommandWithOutput(listAllArgs...) - require.Contains(t, output, "Following workflow(s) found in keyspace customer: wf1") + output, err = vc.VtctldClient.ExecuteCommandWithOutput(listAllArgs...) + require.NoError(t, err) + require.True(t, listOutputContainsWorkflow(output, "wf1")) - err := tstWorkflowCancel(t) + err = tstWorkflowCancel(t) require.NoError(t, err) - output, _ = vc.VtctlClient.ExecuteCommandWithOutput(listAllArgs...) - require.Contains(t, output, "No workflows found in keyspace customer") + output, err = vc.VtctldClient.ExecuteCommandWithOutput(listAllArgs...) + require.NoError(t, err) + require.True(t, listOutputIsEmpty(output)) } func testPartialSwitches(t *testing.T) { // nothing switched - require.Equal(t, getCurrentState(t), wrangler.WorkflowStateNotSwitched) + require.Contains(t, getCurrentStatus(t), wrangler.WorkflowStateNotSwitched) tstWorkflowSwitchReads(t, "replica,rdonly", "zone1") nextState := "Reads partially switched. Replica switched in cells: zone1. Rdonly switched in cells: zone1. Writes Not Switched" checkStates(t, wrangler.WorkflowStateNotSwitched, nextState) @@ -526,7 +547,7 @@ func testPartialSwitches(t *testing.T) { checkStates(t, nextState, nextState) // idempotency keyspace := "product" - if currentWorkflowType == wrangler.ReshardWorkflow { + if currentWorkflowType == binlogdatapb.VReplicationWorkflowType_Reshard { keyspace = "customer" } waitForLowLag(t, keyspace, "wf1_reverse") @@ -563,7 +584,7 @@ func testRestOfWorkflow(t *testing.T) { // this function is called for both MoveTables and Reshard, so the reverse workflows exist in different keyspaces keyspace := "product" - if currentWorkflowType == wrangler.ReshardWorkflow { + if currentWorkflowType == binlogdatapb.VReplicationWorkflowType_Reshard { keyspace = "customer" } waitForLowLag(t, keyspace, "wf1_reverse") @@ -707,8 +728,11 @@ func switchReadsNew(t *testing.T, workflowType, cells, ksWorkflow string, revers if reverse { command = "ReverseTraffic" } - output, err := vc.VtctlClient.ExecuteCommandWithOutput(workflowType, "--", "--cells="+cells, - "--tablet_types=rdonly,replica", command, ksWorkflow) + parts := strings.Split(ksWorkflow, ".") + require.Len(t, parts, 2) + ks, wf := parts[0], parts[1] + output, err := vc.VtctldClient.ExecuteCommandWithOutput(workflowType, "--workflow", wf, "--target-keyspace", ks, command, + "--cells", cells, "--tablet-types=rdonly,replica") require.NoError(t, err, fmt.Sprintf("SwitchReads Error: %s: %s", err, output)) if output != "" { fmt.Printf("SwitchReads output: %s\n", output) @@ -824,7 +848,7 @@ func createAdditionalCustomerShards(t *testing.T, shards string) { } func tstApplySchemaOnlineDDL(t *testing.T, sql string, keyspace string) { - err := vc.VtctlClient.ExecuteCommand("ApplySchema", "--", "--ddl_strategy=online", + err := vc.VtctldClient.ExecuteCommand("ApplySchema", "--ddl-strategy=online", "--sql", sql, keyspace) require.NoError(t, err, fmt.Sprintf("ApplySchema Error: %s", err)) } diff --git a/go/test/endtoend/vreplication/wrappers_test.go b/go/test/endtoend/vreplication/wrappers_test.go index 5c7e01aa155..407fe12c3ed 100644 --- a/go/test/endtoend/vreplication/wrappers_test.go +++ b/go/test/endtoend/vreplication/wrappers_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" "vitess.io/vitess/go/vt/log" - "vitess.io/vitess/go/vt/wrangler" + binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" ) type iWorkflow interface { @@ -117,7 +117,7 @@ func newVtctlMoveTables(mt *moveTablesWorkflow) *VtctlMoveTables { } func (vmt *VtctlMoveTables) Create() { - currentWorkflowType = wrangler.MoveTablesWorkflow + currentWorkflowType = binlogdatapb.VReplicationWorkflowType_MoveTables vmt.exec(workflowActionCreate) } @@ -314,7 +314,7 @@ func newVtctlReshard(rs *reshardWorkflow) *VtctlReshard { } func (vrs *VtctlReshard) Create() { - currentWorkflowType = wrangler.ReshardWorkflow + currentWorkflowType = binlogdatapb.VReplicationWorkflowType_Reshard vrs.exec(workflowActionCreate) } diff --git a/go/vt/vtctl/workflow/server.go b/go/vt/vtctl/workflow/server.go index f63fb69dea7..c29cd3228db 100644 --- a/go/vt/vtctl/workflow/server.go +++ b/go/vt/vtctl/workflow/server.go @@ -3005,13 +3005,16 @@ func (s *Server) switchReads(ctx context.Context, req *vtctldatapb.WorkflowSwitc } } + cellsStr := strings.Join(req.Cells, ",") + // Consistently handle errors by logging and returning them. handleError := func(message string, err error) (*[]string, error) { - ts.Logger().Error(err) - return nil, err + werr := vterrors.Wrapf(err, message) + ts.Logger().Error(werr) + return nil, werr } - log.Infof("Switching reads: %s.%s tablet types: %s, cells: %s, workflow state: %s", ts.targetKeyspace, ts.workflow, roTypesToSwitchStr, ts.optCells, state.String()) + log.Infof("Switching reads: %s.%s tablet types: %s, cells: %s, workflow state: %s", ts.targetKeyspace, ts.workflow, roTypesToSwitchStr, cellsStr, state.String()) if !switchReplica && !switchRdonly { return handleError("invalid tablet types", vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "tablet types must be REPLICA or RDONLY: %s", roTypesToSwitchStr)) } @@ -3023,14 +3026,6 @@ func (s *Server) switchReads(ctx context.Context, req *vtctldatapb.WorkflowSwitc return handleError("invalid request", vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "requesting reversal of SwitchReads for RDONLYs but RDONLY reads have not been switched")) } } - cells := req.Cells - // If no cells were provided in the command then use the value from the workflow. - if len(cells) == 0 && ts.optCells != "" { - cells = strings.Split(strings.TrimSpace(ts.optCells), ",") - } - for i, cell := range cells { - cells[i] = strings.TrimSpace(cell) - } // If there are no rdonly tablets in the cells ask to switch rdonly tablets as well so that routing rules // are updated for rdonly as well. Otherwise vitess will not know that the workflow has completed and will @@ -3038,7 +3033,7 @@ func (s *Server) switchReads(ctx context.Context, req *vtctldatapb.WorkflowSwitc // rdonly tablets. if switchReplica && !switchRdonly { var err error - rdonlyTabletsExist, err := topotools.DoCellsHaveRdonlyTablets(ctx, s.ts, cells) + rdonlyTabletsExist, err := topotools.DoCellsHaveRdonlyTablets(ctx, s.ts, req.Cells) if err != nil { return nil, err } @@ -3076,20 +3071,20 @@ func (s *Server) switchReads(ctx context.Context, req *vtctldatapb.WorkflowSwitc if ts.MigrationType() == binlogdatapb.MigrationType_TABLES { if ts.isPartialMigration { ts.Logger().Infof("Partial migration, skipping switchTableReads as traffic is all or nothing per shard and overridden for reads AND writes in the ShardRoutingRule created when switching writes.") - } else if err := sw.switchTableReads(ctx, cells, roTabletTypes, direction); err != nil { + } else if err := sw.switchTableReads(ctx, req.Cells, roTabletTypes, direction); err != nil { return handleError("failed to switch read traffic for the tables", err) } return sw.logs(), nil } - ts.Logger().Infof("About to switchShardReads: %+v, %+s, %+v", cells, roTypesToSwitchStr, direction) - if err := sw.switchShardReads(ctx, cells, roTabletTypes, direction); err != nil { + ts.Logger().Infof("About to switchShardReads: cells: %s, tablet types: %s, direction: %d", cellsStr, roTypesToSwitchStr, direction) + if err := sw.switchShardReads(ctx, req.Cells, roTabletTypes, direction); err != nil { return handleError("failed to switch read traffic for the shards", err) } - ts.Logger().Infof("switchShardReads Completed: %+v, %+s, %+v", cells, roTypesToSwitchStr, direction) - if err := s.ts.ValidateSrvKeyspace(ctx, ts.targetKeyspace, strings.Join(cells, ",")); err != nil { + ts.Logger().Infof("switchShardReads Completed: cells: %s, tablet types: %s, direction: %d", cellsStr, roTypesToSwitchStr, direction) + if err := s.ts.ValidateSrvKeyspace(ctx, ts.targetKeyspace, cellsStr); err != nil { err2 := vterrors.Wrapf(err, "after switching shard reads, found SrvKeyspace for %s is corrupt in cell %s", - ts.targetKeyspace, strings.Join(cells, ",")) + ts.targetKeyspace, cellsStr) return handleError("failed to validate SrvKeyspace record", err2) } return sw.logs(), nil @@ -3108,7 +3103,7 @@ func (s *Server) switchWrites(ctx context.Context, req *vtctldatapb.WorkflowSwit // Consistently handle errors by logging and returning them. handleError := func(message string, err error) (int64, *[]string, error) { - werr := vterrors.Errorf(vtrpcpb.Code_INTERNAL, fmt.Sprintf("%s: %v", message, err)) + werr := vterrors.Wrapf(err, message) ts.Logger().Error(werr) return 0, nil, werr } diff --git a/go/vt/vtctl/workflow/traffic_switcher.go b/go/vt/vtctl/workflow/traffic_switcher.go index c8551c5ff73..2f6e0659025 100644 --- a/go/vt/vtctl/workflow/traffic_switcher.go +++ b/go/vt/vtctl/workflow/traffic_switcher.go @@ -547,15 +547,12 @@ func (ts *trafficSwitcher) dropSourceShards(ctx context.Context) error { } func (ts *trafficSwitcher) switchShardReads(ctx context.Context, cells []string, servedTypes []topodatapb.TabletType, direction TrafficSwitchDirection) error { - var fromShards, toShards []*topo.ShardInfo - if direction == DirectionForward { - fromShards, toShards = ts.SourceShards(), ts.TargetShards() - } else { - fromShards, toShards = ts.TargetShards(), ts.SourceShards() - } - if err := ts.TopoServer().ValidateSrvKeyspace(ctx, ts.TargetKeyspaceName(), strings.Join(cells, ",")); err != nil { + cellsStr := strings.Join(cells, ",") + log.Infof("switchShardReads: cells: %s, tablet types: %+v, direction %d", cellsStr, servedTypes, direction) + fromShards, toShards := ts.SourceShards(), ts.TargetShards() + if err := ts.TopoServer().ValidateSrvKeyspace(ctx, ts.TargetKeyspaceName(), cellsStr); err != nil { err2 := vterrors.Wrapf(err, "Before switching shard reads, found SrvKeyspace for %s is corrupt in cell %s", - ts.TargetKeyspaceName(), strings.Join(cells, ",")) + ts.TargetKeyspaceName(), cellsStr) log.Errorf("%w", err2) return err2 } @@ -571,9 +568,9 @@ func (ts *trafficSwitcher) switchShardReads(ctx context.Context, cells []string, return err } } - if err := ts.TopoServer().ValidateSrvKeyspace(ctx, ts.TargetKeyspaceName(), strings.Join(cells, ",")); err != nil { + if err := ts.TopoServer().ValidateSrvKeyspace(ctx, ts.TargetKeyspaceName(), cellsStr); err != nil { err2 := vterrors.Wrapf(err, "after switching shard reads, found SrvKeyspace for %s is corrupt in cell %s", - ts.TargetKeyspaceName(), strings.Join(cells, ",")) + ts.TargetKeyspaceName(), cellsStr) log.Errorf("%w", err2) return err2 } @@ -581,7 +578,7 @@ func (ts *trafficSwitcher) switchShardReads(ctx context.Context, cells []string, } func (ts *trafficSwitcher) switchTableReads(ctx context.Context, cells []string, servedTypes []topodatapb.TabletType, direction TrafficSwitchDirection) error { - log.Infof("switchTableReads: servedTypes: %+v, direction %t", servedTypes, direction) + log.Infof("switchTableReads: cells: %s, tablet types: %+v, direction %d", strings.Join(cells, ","), servedTypes, direction) rules, err := topotools.GetRoutingRules(ctx, ts.TopoServer()) if err != nil { return err @@ -939,7 +936,7 @@ func (ts *trafficSwitcher) waitForCatchup(ctx context.Context, filteredReplicati }); err != nil { return err } - // all targets have caught up, record their positions for setting up reverse workflows + // All targets have caught up, record their positions for setting up reverse workflows. return ts.ForAllTargets(func(target *MigrationTarget) error { var err error target.Position, err = ts.TabletManagerClient().PrimaryPosition(ctx, target.GetPrimary().Tablet) @@ -1005,7 +1002,7 @@ func (ts *trafficSwitcher) cancelMigration(ctx context.Context, sm *StreamMigrat err = ts.changeShardsAccess(ctx, ts.SourceKeyspaceName(), ts.SourceShards(), allowWrites) } if err != nil { - ts.Logger().Errorf("Cancel migration failed:", err) + ts.Logger().Errorf("Cancel migration failed: %v", err) } sm.CancelStreamMigrations(ctx) @@ -1369,7 +1366,7 @@ func (ts *trafficSwitcher) findSequenceUsageInKeyspace(vschema *vschemapb.Keyspa for _, table := range ts.Tables() { vs, ok := vschema.Tables[table] - if !ok || vs == nil || vs.AutoIncrement == nil || vs.AutoIncrement.Sequence == "" { + if !ok || vs.GetAutoIncrement().GetSequence() == "" { continue } sm := &sequenceMetadata{ @@ -1411,7 +1408,7 @@ func (ts *trafficSwitcher) findSequenceUsageInKeyspace(vschema *vschemapb.Keyspa // the primary tablet serving the sequence to refresh/reset its cache to // be sure that it does not provide a value that is less than the current max. func (ts *trafficSwitcher) initializeTargetSequences(ctx context.Context, sequencesByBackingTable map[string]*sequenceMetadata) error { - initSequenceTable := func(ictx context.Context, sequenceTableName string, sequenceMetadata *sequenceMetadata) error { + initSequenceTable := func(ictx context.Context, sequenceMetadata *sequenceMetadata) error { // Now we need to run this query on the target shards in order // to get the max value and set the next id for the sequence to // a higher value. @@ -1458,6 +1455,10 @@ func (ts *trafficSwitcher) initializeTargetSequences(ctx context.Context, sequen return ictx.Err() default: } + if len(shardResults) == 0 { // This should never happen + return vterrors.Errorf(vtrpcpb.Code_INTERNAL, "did not get any results for the max used sequence value for target table %s.%s in order to initialize the backing sequence table", + ts.targetKeyspace, sequenceMetadata.usingTableName) + } // Sort the values to find the max value across all shards. sort.Slice(shardResults, func(i, j int) bool { return shardResults[i] < shardResults[j] @@ -1492,12 +1493,7 @@ func (ts *trafficSwitcher) initializeTargetSequences(ctx context.Context, sequen ) // Now execute this on the primary tablet of the unsharded keyspace // housing the backing table. - primaryTablet, ierr := ts.TopoServer().GetTablet(ictx, sequenceShard.PrimaryAlias) - if ierr != nil { - return vterrors.Errorf(vtrpcpb.Code_INTERNAL, "failed to get the primary tablet for %s.%s using alias %s: %v", - sequenceShard.Keyspace(), sequenceShard.ShardName(), sequenceShard.PrimaryAlias, ierr) - } - qr, ierr := ts.ws.tmc.ExecuteFetchAsApp(ictx, primaryTablet.Tablet, true, &tabletmanagerdatapb.ExecuteFetchAsAppRequest{ + qr, ierr := ts.ws.tmc.ExecuteFetchAsApp(ictx, sequenceTablet.Tablet, true, &tabletmanagerdatapb.ExecuteFetchAsAppRequest{ Query: []byte(query.Query), MaxRows: 1, }) @@ -1532,10 +1528,9 @@ func (ts *trafficSwitcher) initializeTargetSequences(ctx context.Context, sequen } initGroup, gctx := errgroup.WithContext(ctx) - for sequenceTableName, sequenceMetadata := range sequencesByBackingTable { - sequenceTableName, sequenceMetadata := sequenceTableName, sequenceMetadata // https://golang.org/doc/faq#closures_and_goroutines + for _, sequenceMetadata := range sequencesByBackingTable { initGroup.Go(func() error { - return initSequenceTable(gctx, sequenceTableName, sequenceMetadata) + return initSequenceTable(gctx, sequenceMetadata) }) } return initGroup.Wait() diff --git a/go/vt/vttablet/tabletmanager/rpc_vreplication.go b/go/vt/vttablet/tabletmanager/rpc_vreplication.go index 1489d6eccb7..de4a9c21c8d 100644 --- a/go/vt/vttablet/tabletmanager/rpc_vreplication.go +++ b/go/vt/vttablet/tabletmanager/rpc_vreplication.go @@ -79,7 +79,7 @@ func (tm *TabletManager) CreateVReplicationWorkflow(ctx context.Context, req *ta } // Use the local cell if none are specified. if len(req.Cells) == 0 || strings.TrimSpace(req.Cells[0]) == "" { - req.Cells = append(req.Cells, tm.Tablet().Alias.Cell) + req.Cells = []string{tm.Tablet().Alias.Cell} } wfState := binlogdatapb.VReplicationWorkflowState_Stopped.String() tabletTypesStr := topoproto.MakeStringTypeCSV(req.TabletTypes) diff --git a/test/config.json b/test/config.json index 7d429ce6978..9bbab938f77 100644 --- a/test/config.json +++ b/test/config.json @@ -1085,15 +1085,6 @@ "RetryMax": 1, "Tags": [] }, - "vreplication_vtctldclient_cli": { - "File": "unused.go", - "Args": ["vitess.io/vitess/go/test/endtoend/vreplication", "-run", "TestVtctldclientCLI", "-timeout", "20m"], - "Command": [], - "Manual": false, - "Shard": "vreplication_basic", - "RetryMax": 1, - "Tags": [] - }, "vreplication_copy_parallel": { "File": "unused.go", "Args": ["vitess.io/vitess/go/test/endtoend/vreplication", "-run", "TestVreplicationCopyParallel", "-timeout", "20m"], @@ -1256,12 +1247,21 @@ "RetryMax": 1, "Tags": [] }, + "vreplication_vtctldclient_cli": { + "File": "unused.go", + "Args": ["vitess.io/vitess/go/test/endtoend/vreplication", "-run", "TestVtctldclientCLI", "-timeout", "20m"], + "Command": [], + "Manual": false, + "Shard": "vreplication_cli_migrate_vdiff2_convert_tz", + "RetryMax": 1, + "Tags": [] + }, "vreplication_vtctl_migrate": { "File": "unused.go", "Args": ["vitess.io/vitess/go/test/endtoend/vreplication", "-run", "TestVtctlMigrate", "-timeout", "30m"], "Command": [], "Manual": false, - "Shard": "vreplication_migrate_vdiff2_convert_tz", + "Shard": "vreplication_cli_migrate_vdiff2_convert_tz", "RetryMax": 1, "Tags": [] }, @@ -1270,7 +1270,7 @@ "Args": ["vitess.io/vitess/go/test/endtoend/vreplication", "-run", "TestVtctldMigrate", "-timeout", "30m"], "Command": [], "Manual": false, - "Shard": "vreplication_migrate_vdiff2_convert_tz", + "Shard": "vreplication_cli_migrate_vdiff2_convert_tz", "RetryMax": 1, "Tags": [] }, @@ -1279,7 +1279,7 @@ "Args": ["vitess.io/vitess/go/test/endtoend/vreplication", "-run", "TestVDiff2", "-timeout", "30m"], "Command": [], "Manual": false, - "Shard": "vreplication_migrate_vdiff2_convert_tz", + "Shard": "vreplication_cli_migrate_vdiff2_convert_tz", "RetryMax": 1, "Tags": [] }, @@ -1288,7 +1288,7 @@ "Args": ["vitess.io/vitess/go/test/endtoend/vreplication", "-run", "TestMoveTablesTZ"], "Command": [], "Manual": false, - "Shard": "vreplication_migrate_vdiff2_convert_tz", + "Shard": "vreplication_cli_migrate_vdiff2_convert_tz", "RetryMax": 1, "Tags": [] }, From 8850e8ef3086179d7046e46277e40601922410b9 Mon Sep 17 00:00:00 2001 From: Manan Gupta <35839558+GuptaManan100@users.noreply.github.com> Date: Wed, 27 Mar 2024 23:32:57 +0530 Subject: [PATCH 21/22] Remove reading emergently instances (#15580) Signed-off-by: Manan Gupta --- go/vt/vtorc/logic/topology_recovery.go | 113 -------------------- go/vt/vtorc/logic/topology_recovery_test.go | 9 -- 2 files changed, 122 deletions(-) diff --git a/go/vt/vtorc/logic/topology_recovery.go b/go/vt/vtorc/logic/topology_recovery.go index 1ee82bb3560..8a1c3af5ac9 100644 --- a/go/vt/vtorc/logic/topology_recovery.go +++ b/go/vt/vtorc/logic/topology_recovery.go @@ -23,8 +23,6 @@ import ( "math/rand/v2" "time" - "github.com/patrickmn/go-cache" - "vitess.io/vitess/go/stats" "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/logutil" @@ -160,20 +158,12 @@ func NewTopologyRecoveryStep(uid string, message string) *TopologyRecoveryStep { } } -var emergencyReadTopologyInstanceMap *cache.Cache -var emergencyRestartReplicaTopologyInstanceMap *cache.Cache -var emergencyOperationGracefulPeriodMap *cache.Cache - func init() { go initializeTopologyRecoveryPostConfiguration() } func initializeTopologyRecoveryPostConfiguration() { config.WaitForConfigurationToBeLoaded() - - emergencyReadTopologyInstanceMap = cache.New(time.Second, time.Millisecond*250) - emergencyRestartReplicaTopologyInstanceMap = cache.New(time.Second*30, time.Second) - emergencyOperationGracefulPeriodMap = cache.New(time.Second*5, time.Millisecond*500) } // AuditTopologyRecovery audits a single step in a topology recovery process. @@ -310,80 +300,6 @@ func checkAndRecoverGenericProblem(ctx context.Context, analysisEntry *inst.Repl return false, nil, nil } -// Force a re-read of a topology instance; this is done because we need to substantiate a suspicion -// that we may have a failover scenario. we want to speed up reading the complete picture. -func emergentlyReadTopologyInstance(tabletAlias string, analysisCode inst.AnalysisCode) (instance *inst.Instance) { - if existsInCacheError := emergencyReadTopologyInstanceMap.Add(tabletAlias, true, cache.DefaultExpiration); existsInCacheError != nil { - // Just recently attempted - return nil - } - instance, _ = inst.ReadTopologyInstance(tabletAlias) - _ = inst.AuditOperation("emergently-read-topology-instance", tabletAlias, string(analysisCode)) - return instance -} - -// Force reading of replicas of given instance. This is because we suspect the instance is dead, and want to speed up -// detection of replication failure from its replicas. -func emergentlyReadTopologyInstanceReplicas(primaryHost string, primaryPort int, analysisCode inst.AnalysisCode) { - replicas, err := inst.ReadReplicaInstancesIncludingBinlogServerSubReplicas(primaryHost, primaryPort) - if err != nil { - return - } - for _, replica := range replicas { - go emergentlyReadTopologyInstance(replica.InstanceAlias, analysisCode) - } -} - -// emergentlyRestartReplicationOnTopologyInstance forces a RestartReplication on a given instance. -func emergentlyRestartReplicationOnTopologyInstance(tabletAlias string, analysisCode inst.AnalysisCode) { - if existsInCacheError := emergencyRestartReplicaTopologyInstanceMap.Add(tabletAlias, true, cache.DefaultExpiration); existsInCacheError != nil { - // Just recently attempted on this specific replica - return - } - go inst.ExecuteOnTopology(func() { - _ = restartReplication(tabletAlias) - _ = inst.AuditOperation("emergently-restart-replication-topology-instance", tabletAlias, string(analysisCode)) - }) -} - -func beginEmergencyOperationGracefulPeriod(tabletAlias string) { - emergencyOperationGracefulPeriodMap.Set(tabletAlias, true, cache.DefaultExpiration) -} - -func isInEmergencyOperationGracefulPeriod(tabletAlias string) bool { - _, found := emergencyOperationGracefulPeriodMap.Get(tabletAlias) - return found -} - -// emergentlyRestartReplicationOnTopologyInstanceReplicas forces a stop slave + start slave on -// replicas of a given instance, in an attempt to cause them to re-evaluate their replication state. -// This can be useful in scenarios where the primary has Too Many Connections, but long-time connected -// replicas are not seeing this; when they stop+start replication, they need to re-authenticate and -// that's where we hope they realize the primary is bad. -func emergentlyRestartReplicationOnTopologyInstanceReplicas(primaryHost string, primaryPort int, tabletAlias string, analysisCode inst.AnalysisCode) { - if existsInCacheError := emergencyRestartReplicaTopologyInstanceMap.Add(tabletAlias, true, cache.DefaultExpiration); existsInCacheError != nil { - // While each replica's RestartReplication() is throttled on its own, it's also wasteful to - // iterate all replicas all the time. This is the reason why we do grand-throttle check. - return - } - beginEmergencyOperationGracefulPeriod(tabletAlias) - - replicas, err := inst.ReadReplicaInstancesIncludingBinlogServerSubReplicas(primaryHost, primaryPort) - if err != nil { - return - } - for _, replica := range replicas { - go emergentlyRestartReplicationOnTopologyInstance(replica.InstanceAlias, analysisCode) - } -} - -func emergentlyRecordStaleBinlogCoordinates(tabletAlias string, binlogCoordinates *inst.BinlogCoordinates) { - err := inst.RecordStaleInstanceBinlogCoordinates(tabletAlias, binlogCoordinates) - if err != nil { - log.Error(err) - } -} - // checkAndExecuteFailureDetectionProcesses tries to register for failure detection and potentially executes // failure-detection processes. func checkAndExecuteFailureDetectionProcesses(analysisEntry *inst.ReplicationAnalysis) (detectionRegistrationSuccess bool, processesExecutionAttempted bool, err error) { @@ -407,9 +323,6 @@ func getCheckAndRecoverFunctionCode(analysisCode inst.AnalysisCode, tabletAlias log.Infof("VTOrc not configured to run ERS, skipping recovering %v", analysisCode) return noRecoveryFunc } - if isInEmergencyOperationGracefulPeriod(tabletAlias) { - return recoverGenericProblemFunc - } return recoverDeadPrimaryFunc case inst.PrimaryTabletDeleted: // If ERS is disabled, we have no way of repairing the cluster. @@ -417,9 +330,6 @@ func getCheckAndRecoverFunctionCode(analysisCode inst.AnalysisCode, tabletAlias log.Infof("VTOrc not configured to run ERS, skipping recovering %v", analysisCode) return noRecoveryFunc } - if isInEmergencyOperationGracefulPeriod(tabletAlias) { - return recoverGenericProblemFunc - } return recoverPrimaryTabletDeletedFunc case inst.ErrantGTIDDetected: if !config.ConvertTabletWithErrantGTIDs() { @@ -430,9 +340,6 @@ func getCheckAndRecoverFunctionCode(analysisCode inst.AnalysisCode, tabletAlias case inst.PrimaryHasPrimary: return recoverPrimaryHasPrimaryFunc case inst.LockedSemiSyncPrimary: - if isInEmergencyOperationGracefulPeriod(tabletAlias) { - return recoverGenericProblemFunc - } return recoverLockedSemiSyncPrimaryFunc case inst.ClusterHasNoPrimary: return electNewPrimaryFunc @@ -566,25 +473,6 @@ func analysisEntriesHaveSameRecovery(prevAnalysis, newAnalysis *inst.Replication return prevRecoveryFunctionCode == newRecoveryFunctionCode } -func runEmergentOperations(analysisEntry *inst.ReplicationAnalysis) { - switch analysisEntry.Analysis { - case inst.DeadPrimaryAndReplicas: - go emergentlyReadTopologyInstance(analysisEntry.AnalyzedInstancePrimaryAlias, analysisEntry.Analysis) - case inst.UnreachablePrimary: - go emergentlyReadTopologyInstance(analysisEntry.AnalyzedInstanceAlias, analysisEntry.Analysis) - go emergentlyReadTopologyInstanceReplicas(analysisEntry.AnalyzedInstanceHostname, analysisEntry.AnalyzedInstancePort, analysisEntry.Analysis) - case inst.UnreachablePrimaryWithLaggingReplicas: - go emergentlyRestartReplicationOnTopologyInstanceReplicas(analysisEntry.AnalyzedInstanceHostname, analysisEntry.AnalyzedInstancePort, analysisEntry.AnalyzedInstanceAlias, analysisEntry.Analysis) - case inst.LockedSemiSyncPrimaryHypothesis: - go emergentlyReadTopologyInstance(analysisEntry.AnalyzedInstanceAlias, analysisEntry.Analysis) - go emergentlyRecordStaleBinlogCoordinates(analysisEntry.AnalyzedInstanceAlias, &analysisEntry.AnalyzedInstanceBinlogCoordinates) - case inst.AllPrimaryReplicasNotReplicating: - go emergentlyReadTopologyInstance(analysisEntry.AnalyzedInstanceAlias, analysisEntry.Analysis) - case inst.AllPrimaryReplicasNotReplicatingOrDead: - go emergentlyReadTopologyInstance(analysisEntry.AnalyzedInstanceAlias, analysisEntry.Analysis) - } -} - // executeCheckAndRecoverFunction will choose the correct check & recovery function based on analysis. // It executes the function synchronously func executeCheckAndRecoverFunction(analysisEntry *inst.ReplicationAnalysis) (err error) { @@ -594,7 +482,6 @@ func executeCheckAndRecoverFunction(analysisEntry *inst.ReplicationAnalysis) (er checkAndRecoverFunctionCode := getCheckAndRecoverFunctionCode(analysisEntry.Analysis, analysisEntry.AnalyzedInstanceAlias) isActionableRecovery := hasActionableRecovery(checkAndRecoverFunctionCode) analysisEntry.IsActionableRecovery = isActionableRecovery - runEmergentOperations(analysisEntry) if checkAndRecoverFunctionCode == noRecoveryFunc { // Unhandled problem type diff --git a/go/vt/vtorc/logic/topology_recovery_test.go b/go/vt/vtorc/logic/topology_recovery_test.go index d517649fd13..f636a194283 100644 --- a/go/vt/vtorc/logic/topology_recovery_test.go +++ b/go/vt/vtorc/logic/topology_recovery_test.go @@ -19,9 +19,7 @@ package logic import ( "context" "testing" - "time" - "github.com/patrickmn/go-cache" "github.com/stretchr/testify/require" topodatapb "vitess.io/vitess/go/vt/proto/topodata" @@ -88,7 +86,6 @@ func TestAnalysisEntriesHaveSameRecovery(t *testing.T) { shouldBeEqual: true, }, } - emergencyOperationGracefulPeriodMap = cache.New(time.Second*5, time.Millisecond*500) t.Parallel() for _, tt := range tests { t.Run(string(tt.prevAnalysisCode)+","+string(tt.newAnalysisCode), func(t *testing.T) { @@ -256,12 +253,6 @@ func TestGetCheckAndRecoverFunctionCode(t *testing.T) { }, } - // Needed for the test to work - oldMap := emergencyOperationGracefulPeriodMap - emergencyOperationGracefulPeriodMap = cache.New(time.Second*5, time.Millisecond*500) - defer func() { - emergencyOperationGracefulPeriodMap = oldMap - }() for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { prevVal := config.ERSEnabled() From 2078d620fcd5c6622df35c18b582a63eff21fe43 Mon Sep 17 00:00:00 2001 From: Manan Gupta <35839558+GuptaManan100@users.noreply.github.com> Date: Thu, 28 Mar 2024 10:47:17 +0530 Subject: [PATCH 22/22] Add api end point to print the current database state in VTOrc (#15485) Signed-off-by: Manan Gupta --- go/test/endtoend/vtorc/api/api_test.go | 18 ++++++++++++++ go/vt/external/golib/sqlutils/sqlutils.go | 2 +- go/vt/vtorc/db/generate_base.go | 22 +++++++++++++++++ go/vt/vtorc/inst/instance_dao.go | 30 +++++++++++++++++++++++ go/vt/vtorc/inst/instance_dao_test.go | 16 ++++++++++++ go/vt/vtorc/server/api.go | 16 +++++++++++- 6 files changed, 102 insertions(+), 2 deletions(-) diff --git a/go/test/endtoend/vtorc/api/api_test.go b/go/test/endtoend/vtorc/api/api_test.go index 30e43dfc29a..05b757a90ac 100644 --- a/go/test/endtoend/vtorc/api/api_test.go +++ b/go/test/endtoend/vtorc/api/api_test.go @@ -93,6 +93,24 @@ func TestAPIEndpoints(t *testing.T) { return response != "null" }) + t.Run("Database State", func(t *testing.T) { + // Get database state + status, resp, err := utils.MakeAPICall(t, vtorc, "/api/database-state") + require.NoError(t, err) + assert.Equal(t, 200, status) + assert.Contains(t, resp, `"alias": "zone1-0000000101"`) + assert.Contains(t, resp, `{ + "TableName": "vitess_keyspace", + "Rows": [ + { + "durability_policy": "none", + "keyspace": "ks", + "keyspace_type": "0" + } + ] + },`) + }) + t.Run("Disable Recoveries API", func(t *testing.T) { // Disable recoveries of VTOrc status, resp, err := utils.MakeAPICall(t, vtorc, "/api/disable-global-recoveries") diff --git a/go/vt/external/golib/sqlutils/sqlutils.go b/go/vt/external/golib/sqlutils/sqlutils.go index c88af1176b1..ecf80649b0b 100644 --- a/go/vt/external/golib/sqlutils/sqlutils.go +++ b/go/vt/external/golib/sqlutils/sqlutils.go @@ -42,7 +42,7 @@ type RowMap map[string]CellData // CellData is the result of a single (atomic) column in a single row type CellData sql.NullString -func (this *CellData) MarshalJSON() ([]byte, error) { +func (this CellData) MarshalJSON() ([]byte, error) { if this.Valid { return json.Marshal(this.String) } else { diff --git a/go/vt/vtorc/db/generate_base.go b/go/vt/vtorc/db/generate_base.go index 73238802920..94daebbf7f0 100644 --- a/go/vt/vtorc/db/generate_base.go +++ b/go/vt/vtorc/db/generate_base.go @@ -16,6 +16,28 @@ package db +var TableNames = []string{ + "database_instance", + "audit", + "active_node", + "node_health", + "topology_recovery", + "database_instance_topology_history", + "candidate_database_instance", + "topology_failure_detection", + "blocked_topology_recovery", + "database_instance_last_analysis", + "database_instance_analysis_changelog", + "node_health_history", + "vtorc_db_deployments", + "global_recovery_disable", + "topology_recovery_steps", + "database_instance_stale_binlog_coordinates", + "vitess_tablet", + "vitess_keyspace", + "vitess_shard", +} + // vtorcBackend is a list of SQL statements required to build the vtorc backend var vtorcBackend = []string{ ` diff --git a/go/vt/vtorc/inst/instance_dao.go b/go/vt/vtorc/inst/instance_dao.go index 250d2bd6ba6..35b5d11bc95 100644 --- a/go/vt/vtorc/inst/instance_dao.go +++ b/go/vt/vtorc/inst/instance_dao.go @@ -17,6 +17,7 @@ package inst import ( + "encoding/json" "errors" "fmt" "regexp" @@ -1210,3 +1211,32 @@ func ExpireStaleInstanceBinlogCoordinates() error { } return ExecDBWriteFunc(writeFunc) } + +// GetDatabaseState takes the snapshot of the database and returns it. +func GetDatabaseState() (string, error) { + type tableState struct { + TableName string + Rows []sqlutils.RowMap + } + + var dbState []tableState + for _, tableName := range db.TableNames { + ts := tableState{ + TableName: tableName, + } + err := db.QueryVTOrc("select * from "+tableName, nil, func(rowMap sqlutils.RowMap) error { + ts.Rows = append(ts.Rows, rowMap) + return nil + }) + if err != nil { + return "", err + } + dbState = append(dbState, ts) + } + jsonData, err := json.MarshalIndent(dbState, "", "\t") + if err != nil { + return "", err + } + + return string(jsonData), nil +} diff --git a/go/vt/vtorc/inst/instance_dao_test.go b/go/vt/vtorc/inst/instance_dao_test.go index 549389f91fe..c6020ec52d8 100644 --- a/go/vt/vtorc/inst/instance_dao_test.go +++ b/go/vt/vtorc/inst/instance_dao_test.go @@ -746,3 +746,19 @@ func waitForCacheInitialization() { time.Sleep(100 * time.Millisecond) } } + +func TestGetDatabaseState(t *testing.T) { + // Clear the database after the test. The easiest way to do that is to run all the initialization commands again. + defer func() { + db.ClearVTOrcDatabase() + }() + + for _, query := range initialSQL { + _, err := db.ExecVTOrc(query) + require.NoError(t, err) + } + + ds, err := GetDatabaseState() + require.NoError(t, err) + require.Contains(t, ds, `"alias": "zone1-0000000112"`) +} diff --git a/go/vt/vtorc/server/api.go b/go/vt/vtorc/server/api.go index b0112e10add..60fdf226e95 100644 --- a/go/vt/vtorc/server/api.go +++ b/go/vt/vtorc/server/api.go @@ -45,6 +45,7 @@ const ( disableGlobalRecoveriesAPI = "/api/disable-global-recoveries" enableGlobalRecoveriesAPI = "/api/enable-global-recoveries" replicationAnalysisAPI = "/api/replication-analysis" + databaseStateAPI = "/api/database-state" healthAPI = "/debug/health" AggregatedDiscoveryMetricsAPI = "/api/aggregated-discovery-metrics" @@ -60,6 +61,7 @@ var ( disableGlobalRecoveriesAPI, enableGlobalRecoveriesAPI, replicationAnalysisAPI, + databaseStateAPI, healthAPI, AggregatedDiscoveryMetricsAPI, } @@ -86,6 +88,8 @@ func (v *vtorcAPI) ServeHTTP(response http.ResponseWriter, request *http.Request errantGTIDsAPIHandler(response, request) case replicationAnalysisAPI: replicationAnalysisAPIHandler(response, request) + case databaseStateAPI: + databaseStateAPIHandler(response) case AggregatedDiscoveryMetricsAPI: AggregatedDiscoveryMetricsAPIHandler(response, request) default: @@ -104,7 +108,7 @@ func getACLPermissionLevelForAPI(apiEndpoint string) string { return acl.ADMIN case replicationAnalysisAPI: return acl.MONITORING - case healthAPI: + case healthAPI, databaseStateAPI: return acl.MONITORING } return acl.ADMIN @@ -166,6 +170,16 @@ func errantGTIDsAPIHandler(response http.ResponseWriter, request *http.Request) returnAsJSON(response, http.StatusOK, instances) } +// databaseStateAPIHandler is the handler for the databaseStateAPI endpoint +func databaseStateAPIHandler(response http.ResponseWriter) { + ds, err := inst.GetDatabaseState() + if err != nil { + http.Error(response, err.Error(), http.StatusInternalServerError) + return + } + writePlainTextResponse(response, ds, http.StatusOK) +} + // AggregatedDiscoveryMetricsAPIHandler is the handler for the discovery metrics endpoint func AggregatedDiscoveryMetricsAPIHandler(response http.ResponseWriter, request *http.Request) { // return metrics for last x seconds