Vitess is a database clustering system for horizontal scaling of MySQL.
Перейти к файлу
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
.github fixing linter errors 2020-07-01 05:58:16 +04:00
config rename and deprecate RPCs, rename vars and files 2020-07-02 11:22:18 -07:00
data/test
doc
docker Merge branch 'master' into docker-minivitess 2020-06-30 15:07:51 +03:00
examples Merge pull request #6360 from vitessio/orchestrator-openark 2020-06-24 13:35:36 -07:00
go Tablet Manager: Add Option To Stop IO Thread Only (#6335) 2020-07-08 14:01:17 -07:00
helm orchestrator repo moved under openark/ org 2020-06-23 15:29:49 +03:00
java build(deps): bump log4j2.version from 2.13.0 to 2.13.3 in /java 2020-07-01 19:27:06 +00:00
misc linter fixes, remove staticcheck hook because golangci-lint includes it 2020-07-06 17:23:15 -07:00
proto Tablet Manager: Add Option To Stop IO Thread Only (#6335) 2020-07-08 14:01:17 -07:00
support Formatting updtaes 2020-04-09 03:39:37 +03:00
test Merge pull request #6275 from planetscale/ds-region-example 2020-06-05 09:21:42 -07:00
tools Handled ineffectual errors 2020-06-23 23:03:24 +04:00
vagrant-scripts
vitess-mixin
web/vtctld2 vtctld: vttablet proxy UI changes and test fix 2020-04-12 17:12:10 -07:00
.codeclimate.yml
.dockerignore
.gitignore
.gitmodules
ADOPTERS.md
CODE_OF_CONDUCT.md
CONTRIBUTING.md
DCO
Dockerfile
GOVERNANCE.md
GUIDING_PRINCIPLES.md
LICENSE
MAINTAINERS.md
Makefile Merge branch 'master' into docker-minivitess 2020-06-30 15:07:51 +03:00
README.md
SECURITY.md
Vagrantfile
bootstrap.sh
build.env
dev.env
go.mod Merge pull request #6399 from planetscale/rn-schema-version-ddl-as-blob 2020-07-02 16:14:33 -07:00
go.sum Schema Version Table: alter table using withddl avoiding breaking change. Updated tests: extra events can occur if tests are run isolated due to the way withddl works 2020-07-01 13:43:05 +02:00
sonar-project.properties Handled ineffectual errors 2020-06-23 23:03:24 +04:00
test.go

README.md

Maven Central Build Status codebeat badge Go Report Card FOSSA Status CII Best Practices Coverage

Vitess

Vitess is a database clustering system for horizontal scaling of MySQL through generalized sharding.

By encapsulating shard-routing logic, Vitess allows application code and database queries to remain agnostic to the distribution of data onto multiple shards. With Vitess, you can even split and merge shards as your needs grow, with an atomic cutover step that takes only a few seconds.

Vitess has been a core component of YouTube's database infrastructure since 2011, and has grown to encompass tens of thousands of MySQL nodes.

For more about Vitess, please visit vitess.io.

Vitess has a growing community. You can view the list of adopters here.

Contact

Ask questions in the vitess@googlegroups.com discussion forum.

For topics that are better discussed live, please join the Vitess Slack workspace.

Subscribe to vitess-announce@googlegroups.com or the Vitess Blog for low-frequency updates like new features and releases.

Security

Reporting Security Vulnerabilities

To report a security vulnerability, please email vitess-maintainers.

See Security for a full outline of the security process.

Security Audit

A third party security audit was performed by Cure53. You can see the full report here.

License

Unless otherwise noted, the Vitess source files are distributed under the Apache Version 2.0 license found in the LICENSE file.

FOSSA Status