vitess-gh/go
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
..
acl
bucketpool
bytes2
cache
cacheservice
cmd linter fixes, remove staticcheck hook because golangci-lint includes it 2020-07-06 17:23:15 -07:00
event
exit
fileutil
flagutil
hack
history
ioutil2
json2
jsonutil Add unit test for function in go/sync2/atomic.go 2020-04-28 16:18:29 +08:00
memcache
mysql Tablet Manager: Add Option To Stop IO Thread Only (#6335) 2020-07-08 14:01:17 -07:00
netutil Add unit test for function:ResolveIPv4Addrs 2020-06-02 11:10:39 +08:00
pools Fixed test failures 2020-05-25 10:10:21 +05:30
proc Full pass on codebase. Need to double check later 2020-02-06 16:05:27 -08:00
race
ratelimiter
sqlescape
sqltypes Move evaluation expression to its own package 2020-04-16 21:32:40 -07:00
stats Merge pull request #6280 from hs0210/work 2020-06-14 19:28:04 -07:00
streamlog
sync2 Add unit test for function in go/sync2/atomic.go 2020-04-28 16:18:29 +08:00
tb
test linter fixes, remove staticcheck hook because golangci-lint includes it 2020-07-06 17:23:15 -07:00
testfiles
timer
trace Fix go-lint warning: package comment should be of the form 'Package trace ...' 2020-06-12 10:53:54 +08:00
vt Tablet Manager: Add Option To Stop IO Thread Only (#6335) 2020-07-08 14:01:17 -07:00
vtbench reserve-conn: added reserveID to BeginExecute and Execute 2020-06-29 10:21:20 +05:30
yaml2 yaml: DBConfigs WIP 2020-04-20 19:54:46 -07:00
zk/zkctl
README.md

README.md

This directory contains all the Go code for Vitess.

Most of the packages at the top level are general-purpose and are suitable for use outside Vitess. Packages that are specific to Vitess are in the vt subdirectory. Binaries are in the cmd subdirectory.

Please see GoDoc for a listing of the packages and their purposes.

vt/proto contains the compiled protos for go, one per each directory. When importing these protos (for instance XXX.proto), we rename them on import to XXXpb. For instance:

import (
    topodatapb "vitess.io/vitess/go/vt/proto/topodata"
)