Skip to content

Commit

Permalink
Orchestrator Integration Removal and orc_client_user removal (#11503)
Browse files Browse the repository at this point in the history
* feat: remove orchestrator integration

Signed-off-by: Manan Gupta <[email protected]>

* feat: remove orc_client from the init_db.sql file

Signed-off-by: Manan Gupta <[email protected]>

* feat: fix imports

Signed-off-by: Manan Gupta <[email protected]>

Signed-off-by: Manan Gupta <[email protected]>
  • Loading branch information
GuptaManan100 authored Nov 2, 2022
1 parent 0e300fc commit 83eef5d
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 417 deletions.
7 changes: 0 additions & 7 deletions config/init_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions doc/releasenotes/16_0_0_summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions examples/compose/config/init_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
222 changes: 0 additions & 222 deletions go/vt/vttablet/tabletmanager/orchestrator.go

This file was deleted.

23 changes: 1 addition & 22 deletions go/vt/vttablet/tabletmanager/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down
24 changes: 1 addition & 23 deletions go/vt/vttablet/tabletmanager/rpc_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
}
}()
}
}

Expand Down
Loading

0 comments on commit 83eef5d

Please sign in to comment.