vitess-gh/proto
Peter Farr 9f2b0fd0b7
Tablet Manager: Add Option To Stop IO Thread Only (#6335)
* Added the option to StopReplicationAndGetStatus() to stop only the IO Thread, and passed it all the way down the call chain to MysqlDaemon, where we can now call a new method (implemented in all flavors) which stops only the io thread, if that's what was requested.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Oops

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Remove hook per review suggestion.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Adjusted stop slave io thread to pass in a ctx because it's a new function. Adjusted StopReplicationAndGetStatus so that it stops the slave before getting slave status. This will ensure that the relay log information is correct.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Add back in logic to bail if slave is already stopped.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* We have to patch these in because after calling stop slave there won't be a master host and master port anymore when we grab slave status. Instead we need to patch in positions so we retain master host and master port, otherwise set master will assume the tablet is the master because it has no master host and master port. In retrospect its probably a bad idea that we assume no master host and no master port means we've found the master (in set master).

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Refactored per offline discussions. We now return before and after slave status, so we are more explicit, and don't nest business logic into subfields of a hybrid struct.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Fix issues that cropped up after merge conflict

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Change way we get this state to also pull in the Connecting state. We are either running, or attempting to run. Either way we are not not running.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Changed references from slave to replica per review suggestion.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Embed StopReplicationStatus into StopReplicationAndGetStatusResponse and rename fields to make it clear.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Various fixes per review suggestions.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Lets try out issuing a stop no matter what and see what happens.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Adding back in bailouts. They are necessary.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Get rid of more slave references.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Changed stopIOThreadOnly to an enum so we can change the way in which we stop replication in the future.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Add a test to ensure that we can stop the io thread only.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Fix incorrect test methodology.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Used a generated enum from proto per convention for the stop replication mode.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Scrub more references of slave without obfuscating MySQL statements that are being called under the hood.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-07-08 14:01:17 -07:00
..
README.md proto: Add README.md to document our required style guide. 2017-03-23 19:14:34 +01:00
automation.proto add license in helm/misc/proto 2019-10-21 17:35:53 +08:00
automationservice.proto add license in helm/misc/proto 2019-10-21 17:35:53 +08:00
binlogdata.proto VSCopy: vtgate-related changes 2020-06-06 16:37:27 +02:00
binlogservice.proto add license in helm/misc/proto 2019-10-21 17:35:53 +08:00
logutil.proto builds: fix protoc goimports issue 2019-12-31 14:53:04 -08:00
mysqlctl.proto add license in helm/misc/proto 2019-10-21 17:35:53 +08:00
query.proto rename and deprecate RPCs, rename vars and files 2020-07-02 11:22:18 -07:00
queryservice.proto reserve connection protobuf changes 2020-06-11 14:03:55 +02:00
replicationdata.proto Tablet Manager: Add Option To Stop IO Thread Only (#6335) 2020-07-08 14:01:17 -07:00
tableacl.proto add license in helm/misc/proto 2019-10-21 17:35:53 +08:00
tabletmanagerdata.proto Tablet Manager: Add Option To Stop IO Thread Only (#6335) 2020-07-08 14:01:17 -07:00
tabletmanagerservice.proto rename and deprecate RPCs, rename vars and files 2020-07-02 11:22:18 -07:00
throttlerdata.proto rename and deprecate RPCs, rename vars and files 2020-07-02 11:22:18 -07:00
throttlerservice.proto add license in helm/misc/proto 2019-10-21 17:35:53 +08:00
topodata.proto rename and deprecate RPCs, rename vars and files 2020-07-02 11:22:18 -07:00
vschema.proto add license in helm/misc/proto 2019-10-21 17:35:53 +08:00
vtctldata.proto vrepl: Materialize WIP 3 2019-12-30 21:22:49 -08:00
vtctlservice.proto add license in helm/misc/proto 2019-10-21 17:35:53 +08:00
vtgate.proto reserve connection protobuf changes 2020-06-11 14:03:55 +02:00
vtgateservice.proto deprecation: delete v2 api code and tests 2020-03-23 16:38:37 -07:00
vtrpc.proto add license in helm/misc/proto 2019-10-21 17:35:53 +08:00
vttest.proto add license in helm/misc/proto 2019-10-21 17:35:53 +08:00
vttime.proto builds: fix protoc goimports issue 2019-12-31 14:53:04 -08:00
vtworkerdata.proto add license in helm/misc/proto 2019-10-21 17:35:53 +08:00
vtworkerservice.proto add license in helm/misc/proto 2019-10-21 17:35:53 +08:00
workflow.proto add license in helm/misc/proto 2019-10-21 17:35:53 +08:00

README.md

Vitess Protobuf Definitions

This directory contains all Vitess protobuf definitions.

Our protobuf messages are both used as wire format (e.g. query.proto) and for storage (e.g. topodata.proto).

RPC messages and service definitions are in separate files (e.g. vtgate.proto and vtgateservice.proto) on purpose because our internal deployment does not use gRPC.

Style Guide

Before creating new messages or services, please make yourself familiar with the style of the existing definitions first.

Additionally, new definitions must adhere to the Google Cloud API Design Guide: https://cloud.google.com/apis/design/

Comments

We are more strict than the Design Guide on the format for comments. Similar to comments for Go types or fields, protobuf comments must start with the name. For example:

// TabletAlias is a globally unique tablet identifier.
message TabletAlias {
  // cell is the cell (or datacenter) the tablet is in.
  string cell = 1;
  ...
}

Note that the Design Guide also has the following ask:

If the field value is required, input only, output only, it must be documented at the start of the field description. By default, all fields and parameters are optional.

Here's an example which combines this ask with our stricter comments style:

// ExecuteKeyspaceIdsRequest is the payload to ExecuteKeyspaceIds.
message ExecuteKeyspaceIdsRequest {
  ...
  // Required. keyspace to target the query to.
  string keyspace = 4;
  ...
}

Note that most of our existing files (as of March 2017) do not have e.g. "Required." comments. Nonetheless, new files should follow this where applicable.