vitess-gh/test
Rohit Nayak 8037f43d00
VStreamer: fix deadlock when there are a lot of vschema changes at the same time as binlog events (#11325)
* Don't block on vschema channel in case of heavy vschema changes and vstream load

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Prevent VStreamer engine deadlocks during state transitions

The VStreamer engine is somewhat unusual in two ways:
  1. It is open and running on replica tablets rather than only
     running on primary tablets.
  2. It has no controllers so the main engine mutex is widely shared.

Because of this, when a tablet has open vstreams (direct binary log
streams) performing work and a state transition starts, it can
deadlock with the tabletmanager's state lock when checking if
the engine is open or not.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Address review comments

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
Co-authored-by: Matt Lord <mattalord@gmail.com>
2022-09-30 15:32:37 +02:00
..
bin
client
templates
vttest_schema
README.md
TestingStrategy.md
ci_workflow_gen.go
client_java.sh
client_jdbc.sh
client_test.sh
config.json
config_partial_keyspace.json
local_example.sh
region_example.sh
vthook-make_mycnf
vthook-test.sh
vthook-test_backup_error
vthook-test_backup_transform
vtop_example.sh

README.md

##Github CI Workflows

This document has a short outline of how tests are run in CI, how to add new tests and where these are configured.

Adding a new test

Unit tests are run by the unit test runner, one per platform, currently mysql57, mysql80, mariadb101, mariadb102, mariadb103. The workflow first installs the required database server before calling make unit_test.

To add a new end-to-end (e2e) test (also called cluster end to end tests):

  • Add a new object to test/config.json
  • If you are creating a new test shard:
    • update clusterList in ci_workflow_gen.go
    • make generate_ci_workflows
  • If you are adding a new database platform, update the templates\unit_test.tpl to add the platform specific packages and update unitTestDatabases

Vitess test runner

The .github/workflows directory contains one yaml file per workflow. e2e tests are run using the test.go script in the repository root.

This script invokes the vitess e2e test framework using a json configuration file test/config.json which has one object per test. Each test is of the form:

"vtgate": {
			"File": "unused.go",
			"Args": ["vitess.io/vitess/go/test/endtoend/vtgate"],
			"Command": [],
			"Manual": false,
			"Shard": 17,
			"RetryMax": 0,
			"Tags": []
		},

The important parameters here are Args which define the arguments to go test and the Shard which says which Test VM should run this test. All tests which have a common Shard value are run in the same test vm.

Known Issue

  • Each VM does not seem to be able to create a lot of vttablets. For this reason we have had to split a few VReplication e2e tests across Shards. We need to identify and if possible fix this limitation so that we can reduce the number of test Shards