From 83eef5d198ae1d9c5245270c8ca39961ca847b13 Mon Sep 17 00:00:00 2001 From: Manan Gupta <35839558+GuptaManan100@users.noreply.github.com> Date: Wed, 2 Nov 2022 18:22:44 +0530 Subject: [PATCH] Orchestrator Integration Removal and `orc_client_user` removal (#11503) * feat: remove orchestrator integration Signed-off-by: Manan Gupta * feat: remove orc_client from the init_db.sql file Signed-off-by: Manan Gupta * feat: fix imports Signed-off-by: Manan Gupta Signed-off-by: Manan Gupta --- config/init_db.sql | 7 - doc/releasenotes/16_0_0_summary.md | 7 + examples/compose/config/init_db.sql | 7 - go/vt/vttablet/tabletmanager/orchestrator.go | 222 ------------------ go/vt/vttablet/tabletmanager/restore.go | 23 +- go/vt/vttablet/tabletmanager/rpc_backup.go | 24 +- .../vttablet/tabletmanager/rpc_replication.go | 114 +-------- go/vt/vttablet/tabletmanager/tm_init.go | 18 +- vitess-mixin/e2e/config/init_db.sql | 7 - 9 files changed, 12 insertions(+), 417 deletions(-) delete mode 100644 go/vt/vttablet/tabletmanager/orchestrator.go diff --git a/config/init_db.sql b/config/init_db.sql index cf7fdd63350..67a41d98c4b 100644 --- a/config/init_db.sql +++ b/config/init_db.sql @@ -90,13 +90,6 @@ GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD GRANT SELECT, UPDATE, DELETE, DROP ON performance_schema.* TO 'vt_monitoring'@'localhost'; -# User for Orchestrator (https://github.com/openark/orchestrator). -CREATE USER 'orc_client_user'@'%' IDENTIFIED BY 'orc_client_user_password'; -GRANT SUPER, PROCESS, REPLICATION SLAVE, RELOAD - ON *.* TO 'orc_client_user'@'%'; -GRANT SELECT - ON _vt.* TO 'orc_client_user'@'%'; - FLUSH PRIVILEGES; RESET SLAVE ALL; diff --git a/doc/releasenotes/16_0_0_summary.md b/doc/releasenotes/16_0_0_summary.md index abb9bd76b4d..2dfc1ce7798 100644 --- a/doc/releasenotes/16_0_0_summary.md +++ b/doc/releasenotes/16_0_0_summary.md @@ -6,6 +6,13 @@ ## Major Changes +### Breaking Changes + +#### Orchestrator Integration Deletion + +Orchestrator integration in `vttablet` was deprecated in the previous release and is deleted in this release. +Consider using `VTOrc` instead of `Orchestrator`. + ### New command line flags and behavior #### VTGate: Support query timeout --query-timeout diff --git a/examples/compose/config/init_db.sql b/examples/compose/config/init_db.sql index 75dae7cd89d..d29f16073cd 100644 --- a/examples/compose/config/init_db.sql +++ b/examples/compose/config/init_db.sql @@ -64,13 +64,6 @@ GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, FILE, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'vt_filtered'@'localhost'; -# User for Orchestrator (https://github.com/openark/orchestrator). -# TODO: Reenable when the password is randomly generated. -CREATE USER 'orc_client_user'@'%' IDENTIFIED BY 'orc_client_user_password'; -GRANT SUPER, PROCESS, REPLICATION SLAVE, RELOAD - ON *.* TO 'orc_client_user'@'%'; -GRANT SELECT - ON _vt.* TO 'orc_client_user'@'%'; FLUSH PRIVILEGES; RESET SLAVE ALL; RESET MASTER; diff --git a/go/vt/vttablet/tabletmanager/orchestrator.go b/go/vt/vttablet/tabletmanager/orchestrator.go deleted file mode 100644 index 70887e5d10b..00000000000 --- a/go/vt/vttablet/tabletmanager/orchestrator.go +++ /dev/null @@ -1,222 +0,0 @@ -/* -Copyright 2019 The Vitess Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package tabletmanager - -import ( - "encoding/json" - "fmt" - "io" - "net/http" - "net/url" - "path" - "strconv" - "time" - - "github.com/spf13/pflag" - - "vitess.io/vitess/go/timer" - "vitess.io/vitess/go/vt/log" - "vitess.io/vitess/go/vt/servenv" - "vitess.io/vitess/go/vt/topo/topoproto" - "vitess.io/vitess/go/vt/vterrors" - - topodatapb "vitess.io/vitess/go/vt/proto/topodata" -) - -var ( - orcAddr string - orcUser string - orcPassword string - orcTimeout = 30 * time.Second - orcInterval time.Duration -) - -func init() { - servenv.OnParseFor("vtcombo", registerOrcFlags) - servenv.OnParseFor("vttablet", registerOrcFlags) -} - -func registerOrcFlags(fs *pflag.FlagSet) { - fs.StringVar(&orcAddr, "orc_api_url", orcAddr, "Address of Orchestrator's HTTP API (e.g. http://host:port/api/). Leave empty to disable Orchestrator integration.") - _ = fs.MarkDeprecated("orc_api_url", "Orchestrator integration is deprecated. Consider using VTOrc instead") - fs.StringVar(&orcUser, "orc_api_user", orcUser, "(Optional) Basic auth username to authenticate with Orchestrator's HTTP API. Leave empty to disable basic auth.") - _ = fs.MarkDeprecated("orc_api_user", "Orchestrator integration is deprecated. Consider using VTOrc instead") - fs.StringVar(&orcPassword, "orc_api_password", orcPassword, "(Optional) Basic auth password to authenticate with Orchestrator's HTTP API.") - _ = fs.MarkDeprecated("orc_api_password", "Orchestrator integration is deprecated. Consider using VTOrc instead") - fs.DurationVar(&orcTimeout, "orc_timeout", orcTimeout, "Timeout for calls to Orchestrator's HTTP API.") - _ = fs.MarkDeprecated("orc_timeout", "Orchestrator integration is deprecated. Consider using VTOrc instead") - fs.DurationVar(&orcInterval, "orc_discover_interval", orcInterval, "How often to ping Orchestrator's HTTP API endpoint to tell it we exist. 0 means never.") - _ = fs.MarkDeprecated("orc_discover_interval", "Orchestrator integration is deprecated. Consider using VTOrc instead") -} - -type orcClient struct { - apiRoot *url.URL - httpClient *http.Client -} - -// newOrcClient creates a client for the Orchestrator HTTP API. -// It should only be called after flags have been parsed. -func newOrcClient() (*orcClient, error) { - if orcAddr == "" { - // Orchestrator integration is disabled. - return nil, nil - } - log.Errorf("Orchestrator integration has been deprecated. Consider using VTOrc instead.") - apiRoot, err := url.Parse(orcAddr) - if err != nil { - return nil, vterrors.Wrapf(err, "can't parse --orc_api_url flag value (%v)", orcAddr) - } - return &orcClient{ - apiRoot: apiRoot, - httpClient: &http.Client{Timeout: orcTimeout}, - }, nil -} - -// DiscoverLoop periodically calls orc.discover() until process termination. -// The Tablet is read from the given tm each time before calling discover(). -// Usually this will be launched as a background goroutine. -func (orc *orcClient) DiscoverLoop(tm *TabletManager) { - if orcInterval == 0 { - // 0 means never. - return - } - log.Infof("Starting periodic Orchestrator self-registration: API URL = %v, interval = %v", orcAddr, orcInterval) - - // Randomly vary the interval by +/- 25% to reduce the potential for spikes. - ticker := timer.NewRandTicker(orcInterval, orcInterval/4) - - // Remember whether we've most recently succeeded or failed. - var lastErr error - - for { - // Do the first attempt immediately. - err := orc.Discover(tm.Tablet()) - - // Only log if we're transitioning between success and failure states. - if (err != nil) != (lastErr != nil) { - if err != nil { - log.Warningf("Orchestrator self-registration attempt failed: %v", err) - } else { - log.Infof("Orchestrator self-registration succeeded.") - } - } - lastErr = err - - // Wait for the next tick. - // The only way to stop the loop is to terminate the process. - <-ticker.C - } -} - -// Discover executes a single attempt to self-register with Orchestrator. -func (orc *orcClient) Discover(tablet *topodatapb.Tablet) error { - host, port, err := mysqlHostPort(tablet) - if err != nil { - return err - } - _, err = orc.apiGet("discover", host, port) - return err -} - -// BeginMaintenance tells Orchestrator not to touch the given tablet -// until we call EndMaintenance(). -func (orc *orcClient) BeginMaintenance(tablet *topodatapb.Tablet, reason string) error { - host, port, err := mysqlHostPort(tablet) - if err != nil { - return err - } - _, err = orc.apiGet("begin-maintenance", host, port, "vitess", reason) - return err -} - -// EndMaintenance tells Orchestrator to remove the maintenance block on the -// given tablet, which should have been placed there by BeginMaintenance(). -func (orc *orcClient) EndMaintenance(tablet *topodatapb.Tablet) error { - host, port, err := mysqlHostPort(tablet) - if err != nil { - return err - } - _, err = orc.apiGet("end-maintenance", host, port) - return err -} - -func (orc *orcClient) InActiveShardRecovery(tablet *topodatapb.Tablet) (bool, error) { - alias := fmt.Sprintf("%v.%v", tablet.GetKeyspace(), tablet.GetShard()) - - // TODO(zmagg): Replace this with simpler call to active-cluster-recovery - // when call with alias parameter is supported. - resp, err := orc.apiGet("audit-recovery", "alias", alias) - - if err != nil { - return false, fmt.Errorf("error calling Orchestrator API: %v", err) - } - - var r []map[string]any - - if err := json.Unmarshal(resp, &r); err != nil { - return false, fmt.Errorf("error parsing JSON response from Orchestrator: %v; response: %q", err, string(resp)) - } - - // Orchestrator returns a 0-length response when it has no history of recovery on this cluster. - if len(r) == 0 { - return false, nil - } - - active, ok := r[0]["IsActive"].(bool) - - if !ok { - return false, fmt.Errorf("error parsing JSON response from Orchestrator") - } - return active, nil -} - -func mysqlHostPort(tablet *topodatapb.Tablet) (host, port string, err error) { - mysqlPort := int(tablet.MysqlPort) - if mysqlPort == 0 { - return "", "", fmt.Errorf("MySQL port is unknown for tablet %v (mysqld may not be running yet)", topoproto.TabletAliasString(tablet.Alias)) - } - return tablet.MysqlHostname, strconv.Itoa(mysqlPort), nil -} - -// apiGet calls the given Orchestrator API endpoint. -// The final, assembled path will be URL-escaped, but things like '/' inside a -// path part can still confuse the HTTP API. We can't do anything about that -// because Orchestrator's API chose to put variable values in path elements -// rather than query arguments. -func (orc *orcClient) apiGet(pathParts ...string) ([]byte, error) { - // Append pathParts to a copy of the apiRoot URL. - url := *orc.apiRoot - fullPath := make([]string, 0, len(pathParts)+1) - fullPath = append(fullPath, url.Path) - fullPath = append(fullPath, pathParts...) - url.Path = path.Join(fullPath...) - - // Note that url.String() will URL-escape the path we gave it above. - req, err := http.NewRequest("GET", url.String(), nil) - if err != nil { - return nil, err - } - if orcUser != "" { - req.SetBasicAuth(orcUser, orcPassword) - } - resp, err := orc.httpClient.Do(req) - if err != nil { - return nil, err - } - defer resp.Body.Close() - return io.ReadAll(resp.Body) -} diff --git a/go/vt/vttablet/tabletmanager/restore.go b/go/vt/vttablet/tabletmanager/restore.go index dbcc158097f..b884c71bc22 100644 --- a/go/vt/vttablet/tabletmanager/restore.go +++ b/go/vt/vttablet/tabletmanager/restore.go @@ -30,6 +30,7 @@ import ( "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/mysqlctl" + "vitess.io/vitess/go/vt/proto/vttime" "vitess.io/vitess/go/vt/servenv" "vitess.io/vitess/go/vt/topo" "vitess.io/vitess/go/vt/topo/topoproto" @@ -40,7 +41,6 @@ import ( binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" topodatapb "vitess.io/vitess/go/vt/proto/topodata" vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" - "vitess.io/vitess/go/vt/proto/vttime" ) // This file handles the initial backup restore upon startup. @@ -105,16 +105,6 @@ func (tm *TabletManager) RestoreData(ctx context.Context, logger logutil.Logger, if tm.Cnf == nil { return fmt.Errorf("cannot perform restore without my.cnf, please restart vttablet with a my.cnf file specified") } - // Tell Orchestrator we're stopped on purpose for some Vitess task. - // Do this in the background, as it's best-effort. - go func() { - if tm.orc == nil { - return - } - if err := tm.orc.BeginMaintenance(tm.Tablet(), "vttablet has been told to Restore"); err != nil { - log.Warningf("Orchestrator BeginMaintenance failed: %v", err) - } - }() var ( err error @@ -155,17 +145,6 @@ func (tm *TabletManager) RestoreData(ctx context.Context, logger logutil.Logger, if err != nil { return err } - - // Tell Orchestrator we're no longer stopped on purpose. - // Do this in the background, as it's best-effort. - go func() { - if tm.orc == nil { - return - } - if err := tm.orc.EndMaintenance(tm.Tablet()); err != nil { - log.Warningf("Orchestrator EndMaintenance failed: %v", err) - } - }() return nil } diff --git a/go/vt/vttablet/tabletmanager/rpc_backup.go b/go/vt/vttablet/tabletmanager/rpc_backup.go index 0fa0744a1c5..eeeec156b01 100644 --- a/go/vt/vttablet/tabletmanager/rpc_backup.go +++ b/go/vt/vttablet/tabletmanager/rpc_backup.go @@ -17,11 +17,10 @@ limitations under the License. package tabletmanager import ( + "context" "fmt" "time" - "context" - "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/mysqlctl" "vitess.io/vitess/go/vt/topo/topoproto" @@ -89,16 +88,6 @@ func (tm *TabletManager) Backup(ctx context.Context, logger logutil.Logger, req if err := tm.changeTypeLocked(ctx, topodatapb.TabletType_BACKUP, DBActionNone, SemiSyncActionUnset); err != nil { return err } - // Tell Orchestrator we're stopped on purpose for some Vitess task. - // Do this in the background, as it's best-effort. - go func() { - if tm.orc == nil { - return - } - if err := tm.orc.BeginMaintenance(tm.Tablet(), "vttablet has been told to run an offline backup"); err != nil { - logger.Warningf("Orchestrator BeginMaintenance failed: %v", err) - } - }() } // create the loggers: tee to console and source l := logutil.NewTeeLogger(logutil.NewConsoleLogger(), logger) @@ -134,17 +123,6 @@ func (tm *TabletManager) Backup(ctx context.Context, logger logutil.Logger, req l.Errorf("mysql backup command returned error: %v", returnErr) } returnErr = err - } else { - // Tell Orchestrator we're no longer stopped on purpose. - // Do this in the background, as it's best-effort. - go func() { - if tm.orc == nil { - return - } - if err := tm.orc.EndMaintenance(tm.Tablet()); err != nil { - logger.Warningf("Orchestrator EndMaintenance failed: %v", err) - } - }() } } diff --git a/go/vt/vttablet/tabletmanager/rpc_replication.go b/go/vt/vttablet/tabletmanager/rpc_replication.go index 3bee3383b3a..fcbfd3e974f 100644 --- a/go/vt/vttablet/tabletmanager/rpc_replication.go +++ b/go/vt/vttablet/tabletmanager/rpc_replication.go @@ -29,13 +29,13 @@ import ( "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/mysqlctl" + "vitess.io/vitess/go/vt/proto/vtrpc" "vitess.io/vitess/go/vt/servenv" "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/vterrors" replicationdatapb "vitess.io/vitess/go/vt/proto/replicationdata" topodatapb "vitess.io/vitess/go/vt/proto/topodata" - "vitess.io/vitess/go/vt/proto/vtrpc" ) var setSuperReadOnly bool @@ -208,18 +208,6 @@ func (tm *TabletManager) stopReplicationLocked(ctx context.Context) error { // Remember that we were told to stop, so we don't try to // restart ourselves (in replication_reporter). tm.replManager.setReplicationStopped(true) - - // Also tell Orchestrator we're stopped on purpose for some Vitess task. - // Do this in the background, as it's best-effort. - go func() { - if tm.orc == nil { - return - } - if err := tm.orc.BeginMaintenance(tm.Tablet(), "vttablet has been told to StopReplication"); err != nil { - log.Warningf("Orchestrator BeginMaintenance failed: %v", err) - } - }() - return tm.MysqlDaemon.StopReplication(tm.hookExtraEnv()) } @@ -228,18 +216,6 @@ func (tm *TabletManager) stopIOThreadLocked(ctx context.Context) error { // Remember that we were told to stop, so we don't try to // restart ourselves (in replication_reporter). tm.replManager.setReplicationStopped(true) - - // Also tell Orchestrator we're stopped on purpose for some Vitess task. - // Do this in the background, as it's best-effort. - go func() { - if tm.orc == nil { - return - } - if err := tm.orc.BeginMaintenance(tm.Tablet(), "vttablet has been told to StopReplication"); err != nil { - log.Warningf("Orchestrator BeginMaintenance failed: %v", err) - } - }() - return tm.MysqlDaemon.StopIOThread(ctx) } @@ -282,18 +258,6 @@ func (tm *TabletManager) StartReplication(ctx context.Context, semiSync bool) er defer tm.unlock() tm.replManager.setReplicationStopped(false) - - // Tell Orchestrator we're no longer stopped on purpose. - // Do this in the background, as it's best-effort. - go func() { - if tm.orc == nil { - return - } - if err := tm.orc.EndMaintenance(tm.Tablet()); err != nil { - log.Warningf("Orchestrator EndMaintenance failed: %v", err) - } - }() - if err := tm.fixSemiSync(tm.Tablet().Type, convertBoolToSemiSyncAction(semiSync)); err != nil { return err } @@ -510,17 +474,6 @@ func (tm *TabletManager) demotePrimary(ctx context.Context, revertPartialFailure // in order to ensure the guarantee we are being asked to provide, which is // that no writes are occurring. if wasPrimary && !wasReadOnly { - // Tell Orchestrator we're stopped on purpose for demotion. - // This is a best effort task, so run it in a goroutine. - go func() { - if tm.orc == nil { - return - } - if err := tm.orc.BeginMaintenance(tm.Tablet(), "vttablet has been told to DemotePrimary"); err != nil { - log.Warningf("Orchestrator BeginMaintenance failed: %v", err) - } - }() - // Note that this may block until the transaction timeout if clients // don't finish their transactions in time. Even if some transactions // have to be killed at the end of their timeout, this will be @@ -617,16 +570,6 @@ func (tm *TabletManager) UndoDemotePrimary(ctx context.Context, semiSync bool) e if err := tm.QueryServiceControl.SetServingType(tablet.Type, logutil.ProtoToTime(tablet.PrimaryTermStartTime), true, ""); err != nil { return vterrors.Wrap(err, "SetServingType(serving=true) failed") } - // Tell Orchestrator we're no longer stopped on purpose. - // Do this in the background, as it's best-effort. - go func() { - if tm.orc == nil { - return - } - if err := tm.orc.EndMaintenance(tm.Tablet()); err != nil { - log.Warningf("Orchestrator EndMaintenance failed: %v", err) - } - }() return nil } @@ -702,19 +645,6 @@ func (tm *TabletManager) setReplicationSourceSemiSyncNoAction(ctx context.Contex } func (tm *TabletManager) setReplicationSourceLocked(ctx context.Context, parentAlias *topodatapb.TabletAlias, timeCreatedNS int64, waitPosition string, forceStartReplication bool, semiSync SemiSyncAction) (err error) { - // End orchestrator maintenance at the end of fixing replication. - // This is a best effort operation, so it should happen in a goroutine - defer func() { - go func() { - if tm.orc == nil { - return - } - if err := tm.orc.EndMaintenance(tm.Tablet()); err != nil { - log.Warningf("Orchestrator EndMaintenance failed: %v", err) - } - }() - }() - // Change our type to REPLICA if we used to be PRIMARY. // Being sent SetReplicationSource means another PRIMARY has been successfully promoted, // so we convert to REPLICA first, since we want to do it even if other @@ -948,17 +878,6 @@ func (tm *TabletManager) PromoteReplica(ctx context.Context, semiSync bool) (str tm.replManager.SetTabletType(tm.Tablet().Type) }() - // If Orchestrator is configured then also tell it we're promoting a tablet so it needs to be in maintenance mode - // Do this in the background, as it's best-effort. - go func() { - if tm.orc == nil { - return - } - if err := tm.orc.BeginMaintenance(tm.Tablet(), "vttablet has been told to PromoteReplica"); err != nil { - log.Warningf("Orchestrator BeginMaintenance failed: %v", err) - } - }() - pos, err := tm.MysqlDaemon.Promote(tm.hookExtraEnv()) if err != nil { return "", err @@ -977,18 +896,6 @@ func (tm *TabletManager) PromoteReplica(ctx context.Context, semiSync bool) (str // or we might block replication the next time we demote it // here, we do not want to start the health ticks, so we should use reset. tm.replManager.reset() - - // Tell Orchestrator we're no longer in maintenance mode. - // Do this in the background, as it's best-effort. - go func() { - if tm.orc == nil { - return - } - if err := tm.orc.EndMaintenance(tm.Tablet()); err != nil { - log.Warningf("Orchestrator EndMaintenance failed: %v", err) - } - }() - return mysql.EncodePosition(pos), nil } @@ -1106,24 +1013,5 @@ func (tm *TabletManager) repairReplication(ctx context.Context) error { // we should not try to reparent to ourselves. return fmt.Errorf("shard %v/%v record claims tablet %v is primary, but its type is %v", tablet.Keyspace, tablet.Shard, topoproto.TabletAliasString(tablet.Alias), tablet.Type) } - - // If Orchestrator is configured and if Orchestrator is actively reparenting, we should not repairReplication - if tm.orc != nil { - re, err := tm.orc.InActiveShardRecovery(tablet) - if err != nil { - return err - } - if re { - return fmt.Errorf("orchestrator actively reparenting shard %v, skipping repairReplication", si) - } - - // Before repairing replication, tell Orchestrator to enter maintenance mode for this tablet and to - // lock any other actions on this tablet by Orchestrator. - if err := tm.orc.BeginMaintenance(tm.Tablet(), "vttablet has been told to StopReplication"); err != nil { - log.Warningf("Orchestrator BeginMaintenance failed: %v", err) - return vterrors.Wrap(err, "orchestrator BeginMaintenance failed, skipping repairReplication") - } - } - return tm.setReplicationSourceRepairReplication(ctx, si.PrimaryAlias, 0, "", true) } diff --git a/go/vt/vttablet/tabletmanager/tm_init.go b/go/vt/vttablet/tabletmanager/tm_init.go index f3a3d12a1d2..219bacbcb04 100644 --- a/go/vt/vttablet/tabletmanager/tm_init.go +++ b/go/vt/vttablet/tabletmanager/tm_init.go @@ -58,6 +58,8 @@ import ( "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/mysqlctl" + querypb "vitess.io/vitess/go/vt/proto/query" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" "vitess.io/vitess/go/vt/servenv" "vitess.io/vitess/go/vt/topo" "vitess.io/vitess/go/vt/topo/topoproto" @@ -67,9 +69,6 @@ import ( "vitess.io/vitess/go/vt/vttablet/tabletmanager/vdiff" "vitess.io/vitess/go/vt/vttablet/tabletmanager/vreplication" "vitess.io/vitess/go/vt/vttablet/tabletserver" - - querypb "vitess.io/vitess/go/vt/proto/query" - topodatapb "vitess.io/vitess/go/vt/proto/topodata" ) // Query rules from denylist @@ -175,11 +174,6 @@ type TabletManager struct { // first before other mutexes. actionSema *sync2.Semaphore - // orc is an optional client for Orchestrator HTTP API calls. - // If this is nil, those calls will be skipped. - // It's only set once in NewTabletManager() and never modified after that. - orc *orcClient - // mutex protects all the following fields (that start with '_'), // only hold the mutex to update the fields, nothing else. mutex sync.Mutex @@ -403,14 +397,6 @@ func (tm *TabletManager) Start(tablet *topodatapb.Tablet, healthCheckInterval ti // in any specific order. tm.startShardSync() tm.exportStats() - orc, err := newOrcClient() - if err != nil { - return err - } - if orc != nil { - tm.orc = orc - go tm.orc.DiscoverLoop(tm) - } servenv.OnRun(tm.registerTabletManager) restoring, err := tm.handleRestore(tm.BatchCtx) diff --git a/vitess-mixin/e2e/config/init_db.sql b/vitess-mixin/e2e/config/init_db.sql index 2ed71e2fbf4..e69a2239321 100644 --- a/vitess-mixin/e2e/config/init_db.sql +++ b/vitess-mixin/e2e/config/init_db.sql @@ -65,13 +65,6 @@ GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, FILE, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'vt_filtered'@'localhost'; -# User for Orchestrator (https://github.com/openark/orchestrator). -# TODO: Reenable when the password is randomly generated. -CREATE USER 'orc_client_user'@'%' IDENTIFIED BY 'orc_client_user_password'; -GRANT SUPER, PROCESS, REPLICATION SLAVE, RELOAD - ON *.* TO 'orc_client_user'@'%'; -GRANT SELECT - ON _vt.* TO 'orc_client_user'@'%'; FLUSH PRIVILEGES; RESET SLAVE ALL; RESET MASTER;