vitess-gh/proto/tabletmanagerservice.proto

192 строки
9.2 KiB
Protocol Buffer
Исходник Обычный вид История

/*
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.
*/
2015-06-10 19:32:15 +03:00
// This file contains the service definition for making management API
// calls to VtTablet.
syntax = "proto3";
option go_package = "vitess.io/vitess/go/vt/proto/tabletmanagerservice";
2015-06-10 19:32:15 +03:00
package tabletmanagerservice;
import "tabletmanagerdata.proto";
2015-06-10 19:32:15 +03:00
// TabletManager is a service definition for tabletmanagerdata.TabletManager.
2015-06-10 19:32:15 +03:00
service TabletManager {
//
// Various read-only methods
//
// Ping returns the input payload
rpc Ping(tabletmanagerdata.PingRequest) returns (tabletmanagerdata.PingResponse) {};
2015-06-10 19:32:15 +03:00
// Sleep sleeps for the provided duration
rpc Sleep(tabletmanagerdata.SleepRequest) returns (tabletmanagerdata.SleepResponse) {};
2015-06-10 19:32:15 +03:00
// ExecuteHook executes the hook remotely
rpc ExecuteHook(tabletmanagerdata.ExecuteHookRequest) returns (tabletmanagerdata.ExecuteHookResponse) {};
2015-06-10 19:32:15 +03:00
// GetSchema asks the tablet for its schema
rpc GetSchema(tabletmanagerdata.GetSchemaRequest) returns (tabletmanagerdata.GetSchemaResponse) {};
2015-06-10 19:32:15 +03:00
// GetPermissions asks the tablet for its permissions
rpc GetPermissions(tabletmanagerdata.GetPermissionsRequest) returns (tabletmanagerdata.GetPermissionsResponse) {};
2015-06-10 19:32:15 +03:00
//
// Various read-write methods
//
rpc SetReadOnly(tabletmanagerdata.SetReadOnlyRequest) returns (tabletmanagerdata.SetReadOnlyResponse) {};
2015-06-10 19:32:15 +03:00
rpc SetReadWrite(tabletmanagerdata.SetReadWriteRequest) returns (tabletmanagerdata.SetReadWriteResponse) {};
2015-06-10 19:32:15 +03:00
// ChangeType asks the remote tablet to change its type
rpc ChangeType(tabletmanagerdata.ChangeTypeRequest) returns (tabletmanagerdata.ChangeTypeResponse) {};
2015-06-10 19:32:15 +03:00
rpc RefreshState(tabletmanagerdata.RefreshStateRequest) returns (tabletmanagerdata.RefreshStateResponse) {};
2015-06-10 19:32:15 +03:00
rpc RunHealthCheck(tabletmanagerdata.RunHealthCheckRequest) returns (tabletmanagerdata.RunHealthCheckResponse) {};
2015-06-10 19:32:15 +03:00
rpc IgnoreHealthError(tabletmanagerdata.IgnoreHealthErrorRequest) returns (tabletmanagerdata.IgnoreHealthErrorResponse) {};
rpc ReloadSchema(tabletmanagerdata.ReloadSchemaRequest) returns (tabletmanagerdata.ReloadSchemaResponse) {};
2015-06-10 19:32:15 +03:00
rpc PreflightSchema(tabletmanagerdata.PreflightSchemaRequest) returns (tabletmanagerdata.PreflightSchemaResponse) {};
2015-06-10 19:32:15 +03:00
rpc ApplySchema(tabletmanagerdata.ApplySchemaRequest) returns (tabletmanagerdata.ApplySchemaResponse) {};
2015-06-10 19:32:15 +03:00
rpc LockTables(tabletmanagerdata.LockTablesRequest) returns (tabletmanagerdata.LockTablesResponse) {};
rpc UnlockTables(tabletmanagerdata.UnlockTablesRequest) returns (tabletmanagerdata.UnlockTablesResponse) {};
rpc ExecuteFetchAsDba(tabletmanagerdata.ExecuteFetchAsDbaRequest) returns (tabletmanagerdata.ExecuteFetchAsDbaResponse) {};
2015-06-10 19:32:15 +03:00
rpc ExecuteFetchAsAllPrivs(tabletmanagerdata.ExecuteFetchAsAllPrivsRequest) returns (tabletmanagerdata.ExecuteFetchAsAllPrivsResponse) {};
rpc ExecuteFetchAsApp(tabletmanagerdata.ExecuteFetchAsAppRequest) returns (tabletmanagerdata.ExecuteFetchAsAppResponse) {};
2015-06-10 19:32:15 +03:00
//
// Replication related methods
//
// SlaveStatus returns the current slave status.
rpc SlaveStatus(tabletmanagerdata.SlaveStatusRequest) returns (tabletmanagerdata.SlaveStatusResponse) {};
2015-06-10 19:32:15 +03:00
// MasterPosition returns the current master position
rpc MasterPosition(tabletmanagerdata.MasterPositionRequest) returns (tabletmanagerdata.MasterPositionResponse) {};
2015-06-10 19:32:15 +03:00
// StopSlave makes mysql stop its replication
rpc StopSlave(tabletmanagerdata.StopSlaveRequest) returns (tabletmanagerdata.StopSlaveResponse) {};
2015-06-10 19:32:15 +03:00
// StopSlaveMinimum stops the mysql replication after it reaches
// the provided minimum point
rpc StopSlaveMinimum(tabletmanagerdata.StopSlaveMinimumRequest) returns (tabletmanagerdata.StopSlaveMinimumResponse) {};
2015-06-10 19:32:15 +03:00
// StartSlave starts the mysql replication
rpc StartSlave(tabletmanagerdata.StartSlaveRequest) returns (tabletmanagerdata.StartSlaveResponse) {};
2015-06-10 19:32:15 +03:00
// StartSlave starts the mysql replication until and including
// the provided position
rpc StartSlaveUntilAfter(tabletmanagerdata.StartSlaveUntilAfterRequest) returns (tabletmanagerdata.StartSlaveUntilAfterResponse) {};
2015-06-10 19:32:15 +03:00
// TabletExternallyReparented tells a tablet that its underlying MySQL is
// currently the master. It is only used in environments (tabletmanagerdata.such as Vitess+MoB)
2015-06-10 19:32:15 +03:00
// in which MySQL is reparented by some agent external to Vitess, and then
// that agent simply notifies Vitess.
//
// This call is idempotent with respect to a single target tablet.
// However, the tablet assumes there is a cooling-off period following the
// initial external reparent from A to B, before this call is repeated on any
// tablet other than B. This assumption is configurable with the vttablet flag
// "finalize_external_reparent_timeout".
//
// For more information, see the design doc at go/vt-fast-failover.
rpc TabletExternallyReparented(tabletmanagerdata.TabletExternallyReparentedRequest) returns (tabletmanagerdata.TabletExternallyReparentedResponse) {};
2015-06-10 19:32:15 +03:00
// TabletExternallyElected is an notification that may be sent in
// anticipation of potentially later sending TabletExternallyReparented.
// The tablet can use this extra lead time to prepare to react quickly if
// TabletExternallyReparented does follow.
//
// This call is effectively a no-op if it is not followed by a call to
// TabletExternallyReparented, so the external agent doing the reparent can
// still change its mind.
//
// The agent does not need to wait for this call or cancel it before calling
// TabletExternallyReparented if the external reparent operation finishes
// before TabletExternallyElected returns.
rpc TabletExternallyElected(tabletmanagerdata.TabletExternallyElectedRequest) returns (tabletmanagerdata.TabletExternallyElectedResponse) {};
2015-06-10 19:32:15 +03:00
// GetSlaves asks for the list of mysql slaves
rpc GetSlaves(tabletmanagerdata.GetSlavesRequest) returns (tabletmanagerdata.GetSlavesResponse) {};
2015-06-10 19:32:15 +03:00
// VReplication API
rpc VReplicationExec(tabletmanagerdata.VReplicationExecRequest) returns(tabletmanagerdata.VReplicationExecResponse) {};
rpc VReplicationWaitForPos(tabletmanagerdata.VReplicationWaitForPosRequest) returns(tabletmanagerdata.VReplicationWaitForPosResponse) {};
2015-06-10 19:32:15 +03:00
//
// Reparenting related functions
//
// ResetReplication makes the target not replicating
rpc ResetReplication(tabletmanagerdata.ResetReplicationRequest) returns (tabletmanagerdata.ResetReplicationResponse) {};
2015-06-10 19:32:15 +03:00
// InitMaster initializes the tablet as a master
rpc InitMaster(tabletmanagerdata.InitMasterRequest) returns (tabletmanagerdata.InitMasterResponse) {};
2015-06-10 19:32:15 +03:00
// PopulateReparentJournal tells the tablet to add an entry to its
// reparent journal
rpc PopulateReparentJournal(tabletmanagerdata.PopulateReparentJournalRequest) returns (tabletmanagerdata.PopulateReparentJournalResponse) {};
2015-06-10 19:32:15 +03:00
// InitSlave tells the tablet to reparent to the master unconditionally
rpc InitSlave(tabletmanagerdata.InitSlaveRequest) returns (tabletmanagerdata.InitSlaveResponse) {};
2015-06-10 19:32:15 +03:00
// DemoteMaster tells the soon-to-be-former master it's gonna change
rpc DemoteMaster(tabletmanagerdata.DemoteMasterRequest) returns (tabletmanagerdata.DemoteMasterResponse) {};
2015-06-10 19:32:15 +03:00
// UndoDemoteMaster reverts all changes made by DemoteMaster
rpc UndoDemoteMaster(tabletmanagerdata.UndoDemoteMasterRequest) returns (tabletmanagerdata.UndoDemoteMasterResponse) {};
2015-06-10 19:32:15 +03:00
// PromoteSlaveWhenCaughtUp tells the remote tablet to catch up,
// and then be the master
rpc PromoteSlaveWhenCaughtUp(tabletmanagerdata.PromoteSlaveWhenCaughtUpRequest) returns (tabletmanagerdata.PromoteSlaveWhenCaughtUpResponse) {};
2015-06-10 19:32:15 +03:00
// SlaveWasPromoted tells the remote tablet it is now the master
rpc SlaveWasPromoted(tabletmanagerdata.SlaveWasPromotedRequest) returns (tabletmanagerdata.SlaveWasPromotedResponse) {};
2015-06-10 19:32:15 +03:00
// SetMaster tells the slave to reparent
rpc SetMaster(tabletmanagerdata.SetMasterRequest) returns (tabletmanagerdata.SetMasterResponse) {};
2015-06-10 19:32:15 +03:00
// SlaveWasRestarted tells the remote tablet its master has changed
rpc SlaveWasRestarted(tabletmanagerdata.SlaveWasRestartedRequest) returns (tabletmanagerdata.SlaveWasRestartedResponse) {};
2015-06-10 19:32:15 +03:00
// StopReplicationAndGetStatus stops MySQL replication, and returns the
// replication status
rpc StopReplicationAndGetStatus(tabletmanagerdata.StopReplicationAndGetStatusRequest) returns (tabletmanagerdata.StopReplicationAndGetStatusResponse) {};
2015-06-10 19:32:15 +03:00
// PromoteSlave makes the slave the new master
rpc PromoteSlave(tabletmanagerdata.PromoteSlaveRequest) returns (tabletmanagerdata.PromoteSlaveResponse) {};
2015-06-10 19:32:15 +03:00
//
// Backup related methods
//
rpc Backup(tabletmanagerdata.BackupRequest) returns (stream tabletmanagerdata.BackupResponse) {};
// RestoreFromBackup deletes all local data and restores it from the latest backup.
rpc RestoreFromBackup(tabletmanagerdata.RestoreFromBackupRequest) returns (stream tabletmanagerdata.RestoreFromBackupResponse) {};
2015-06-10 19:32:15 +03:00
}