9f2b0fd0b7
* 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> |
||
---|---|---|
.. | ||
README.md | ||
automation.proto | ||
automationservice.proto | ||
binlogdata.proto | ||
binlogservice.proto | ||
logutil.proto | ||
mysqlctl.proto | ||
query.proto | ||
queryservice.proto | ||
replicationdata.proto | ||
tableacl.proto | ||
tabletmanagerdata.proto | ||
tabletmanagerservice.proto | ||
throttlerdata.proto | ||
throttlerservice.proto | ||
topodata.proto | ||
vschema.proto | ||
vtctldata.proto | ||
vtctlservice.proto | ||
vtgate.proto | ||
vtgateservice.proto | ||
vtrpc.proto | ||
vttest.proto | ||
vttime.proto | ||
vtworkerdata.proto | ||
vtworkerservice.proto | ||
workflow.proto |
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.