Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
0a5c2b1
support vitess Comments in CREATE/ALTER/DROP TABLE statements
shlomi-noach Apr 1, 2021
a5b39a2
improved upon comment_opt in CREATE, ALTER and DROP statements
shlomi-noach Apr 1, 2021
1234cab
normalized comments for DROP statements
shlomi-noach Apr 2, 2021
be290ef
minor comment spacing change
shlomi-noach Apr 2, 2021
db392d7
Merge remote-tracking branch 'origin/online-ddl-idempotent' into onli…
shlomi-noach Apr 2, 2021
ef5172f
DDL statement: SetComments
shlomi-noach Apr 3, 2021
cf8d855
online ddl refactor:
shlomi-noach Apr 5, 2021
552b50a
TabletExecutor utilizes DDLStrategySetting, now more DRY and more for…
shlomi-noach Apr 5, 2021
6df2060
vtctl utilizes new DDLStrategySetting
shlomi-noach Apr 5, 2021
8fd6222
onlineddl.Executor utilizes new DDLStrategySetting. Also, it ensures …
shlomi-noach Apr 5, 2021
6d4db17
endtoend tests adapt to new DDLStrategySetting
shlomi-noach Apr 5, 2021
852e9a7
go.sum
shlomi-noach Apr 5, 2021
63fac67
utilizing DDLStrategySetting to validate @@ddl_strategy
shlomi-noach Apr 5, 2021
7124709
adapt to DDLStrategySetting
shlomi-noach Apr 5, 2021
1e4ace2
adapt to DDLStrategySetting
shlomi-noach Apr 5, 2021
dfe69b0
OnlineDDL engine can choose to use Send to pus online DDL statements,…
shlomi-noach Apr 5, 2021
580393b
merge master, resolve conflicts
shlomi-noach Apr 5, 2021
9c60403
REVERT supports comment_opt
shlomi-noach Apr 5, 2021
b637c0b
NewOnlineDDL now expects DDLStatement. NewOnlineDDLBySQL supports an …
shlomi-noach Apr 5, 2021
4271063
RevertMigration prints comments in Format, supports SetComments()
shlomi-noach Apr 5, 2021
55e3c31
removed 'NewOnlineDDLBySQL()' introduced in previous commit. NewOnlin…
shlomi-noach Apr 5, 2021
617656a
revert schema.NewOnlineDDLBySQL
shlomi-noach Apr 5, 2021
417c1c4
formalizing 'revert <uuid>' into 'revert vitess_migration '<uuid>''
shlomi-noach Apr 5, 2021
cc2aa00
support legacy revert statement parser; only generate new formal reve…
shlomi-noach Apr 6, 2021
e3d29b6
vtgate/plan: revert uses Send when IsSkipTopo()
shlomi-noach Apr 6, 2021
beaff22
initial implementation for RevertMigration plan in tabletserver
shlomi-noach Apr 6, 2021
3c00298
merge master, resolve conflicts
shlomi-noach Apr 6, 2021
3736bf2
sizegen
shlomi-noach Apr 6, 2021
2badbcf
encode online DDL params using encoding/hex to safeguard against pote…
shlomi-noach Apr 6, 2021
45508e0
DDLStatement supports GetComments()
shlomi-noach Apr 6, 2021
f593408
extra sanity check for UUID
shlomi-noach Apr 6, 2021
268b233
go.sum
shlomi-noach Apr 6, 2021
250dc5a
only remove comments temporarily
shlomi-noach Apr 6, 2021
6a675e4
run online DDL from within vttablet/query executor
shlomi-noach Apr 6, 2021
f44fa0d
removed redundant field
shlomi-noach Apr 6, 2021
5697f17
triggering next check upon SubmitMigration
shlomi-noach Apr 6, 2021
ae7ab35
-skip-topo flag
shlomi-noach Apr 6, 2021
8e0c77d
fix timestamp
shlomi-noach Apr 7, 2021
4374d24
Adding tabletmanager.ExecuteQuery() which runs QueryExecutor.Execute(…
shlomi-noach Apr 7, 2021
885de27
reject -singleton migratio submission if another migration is pending
shlomi-noach Apr 8, 2021
453d2ef
onlineddl/singleton endtoend tests
shlomi-noach Apr 8, 2021
a8c3111
cleanup
shlomi-noach Apr 8, 2021
895693c
ApplySchema supports 'revert vitess_migration' queries
shlomi-noach Apr 8, 2021
2771b09
testing REVERT statements on vtctl
shlomi-noach Apr 8, 2021
585b373
skip_preflight
shlomi-noach Apr 8, 2021
22ae22c
fixed endtoendt test
shlomi-noach Apr 8, 2021
c206a5d
Merge branch 'master' into online-ddl-send-plan-comments
shlomi-noach Apr 11, 2021
359490b
Merge branch 'master' into online-ddl-send-plan-comments
shlomi-noach Apr 12, 2021
66015d9
Merge branch 'master' into online-ddl-send-plan-comments
shlomi-noach Apr 13, 2021
684fbd3
merged master, resolve conflict
shlomi-noach Apr 13, 2021
29ef369
merged master, resolve conflict
shlomi-noach Apr 18, 2021
226ba67
merged master, resolve conflict
shlomi-noach Apr 20, 2021
479525a
apply /etc/hosts patch
shlomi-noach Apr 20, 2021
fdbdf06
extend CI port range
shlomi-noach Apr 20, 2021
b5127c5
extend CI port range: apply
shlomi-noach Apr 20, 2021
eb1a784
Merge branch 'master' into online-ddl-send-plan-comments
shlomi-noach Apr 20, 2021
3737c8f
copyright year
shlomi-noach Apr 20, 2021
ed94bb9
clarifies case statement
shlomi-noach Apr 20, 2021
2f81d42
vterrors
shlomi-noach Apr 20, 2021
942ad9b
patch OS fo rupgrade test
shlomi-noach Apr 20, 2021
f027d46
more verbose execution of vtctlclient
shlomi-noach Apr 20, 2021
ff49712
Merge branch 'master' into online-ddl-send-plan-comments
shlomi-noach Apr 20, 2021
051bb2a
-skip_preflight must be v9.0.0 compatible
shlomi-noach Apr 21, 2021
e06d1b8
Merge branch 'master' into online-ddl-send-plan-comments
shlomi-noach Apr 21, 2021
5cd4a09
Merge branch 'master' into online-ddl-send-plan-comments
shlomi-noach Apr 21, 2021
86f4b27
empty commit to kick CI
shlomi-noach Apr 21, 2021
10d95ad
empty commit to kick CI
shlomi-noach Apr 21, 2021
09e3e90
more verbose logging on 'xtrabackup failed with error'
shlomi-noach Apr 22, 2021
86fa94b
experiment: sleep 20sec
shlomi-noach Apr 22, 2021
cab62e2
lower sleep
shlomi-noach Apr 22, 2021
54a4721
10 secs
shlomi-noach Apr 22, 2021
036cb43
20 secs
shlomi-noach Apr 22, 2021
4512c31
30 secs
shlomi-noach Apr 22, 2021
71d576f
sleep on terminatedRestore
shlomi-noach Apr 22, 2021
7397b8b
refactor switch statement per review
shlomi-noach Apr 22, 2021
34e0a4c
fixed race condition
shlomi-noach Apr 22, 2021
5bb8ffd
reduce sleep time
shlomi-noach Apr 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/cluster_endtoend_onlineddl_singleton.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# DO NOT MODIFY: THIS FILE IS GENERATED USING "make generate_ci_workflows"

name: Cluster (onlineddl_singleton)
on: [push, pull_request]
jobs:

build:
name: Run endtoend tests on Cluster (onlineddl_singleton)
runs-on: ubuntu-18.04

steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.15

- name: Tune the OS
run: |
echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range

# TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185
- name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
run: |
echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
# DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED!

- name: Check out code
uses: actions/checkout@v2

- name: Get dependencies
run: |
sudo apt-get update
sudo apt-get install -y mysql-server mysql-client make unzip g++ etcd curl git wget eatmydata
sudo service mysql stop
sudo service etcd stop
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
go mod download

wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
sudo apt-get install percona-xtrabackup-24

- name: Run cluster endtoend test
timeout-minutes: 30
run: |
source build.env
eatmydata -- go run test.go -docker=false -print-log -follow -shard onlineddl_singleton
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ github.com/spyzhov/ajson v0.4.2 h1:JMByd/jZApPKDvNsmO90X2WWGbmT2ahDFp73QhZbg3s=
github.com/spyzhov/ajson v0.4.2/go.mod h1:63V+CGM6f1Bu/p4nLIN8885ojBdt88TbLoSFzyqMuVA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
Expand Down
10 changes: 10 additions & 0 deletions go/test/endtoend/backup/vtctlbackup/backup_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,11 @@ func testRestoreOldMaster(t *testing.T, method restoreMethod) {
// insert data on master, wait for replica to get it
verifyInitialReplication(t)

// TODO: The following Sleep in introduced as it seems like the previous step doesn't fully complete, causing
// this test to be flaky. Sleep seems to solve the problem. Need to fix this in a better way and Wait for
// previous test to complete (suspicion: MySQL does not fully start)
time.Sleep(5 * time.Second)

// backup the replica
err := localCluster.VtctlclientProcess.ExecuteCommand("Backup", replica1.Alias)
require.Nil(t, err)
Expand Down Expand Up @@ -488,6 +493,11 @@ func terminatedRestore(t *testing.T) {
// insert data on master, wait for replica to get it
verifyInitialReplication(t)

// TODO: The following Sleep in introduced as it seems like the previous step doesn't fully complete, causing
// this test to be flaky. Sleep seems to solve the problem. Need to fix this in a better way and Wait for
// previous test to complete (suspicion: MySQL does not fully start)
time.Sleep(5 * time.Second)

// backup the replica
err := localCluster.VtctlclientProcess.ExecuteCommand("Backup", replica1.Alias)
require.Nil(t, err)
Expand Down
17 changes: 13 additions & 4 deletions go/test/endtoend/cluster/vtctlclient_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ type VtctlClientProcess struct {
ZoneName string
}

// VtctlClientParams encapsulated params to provide if non-default
type VtctlClientParams struct {
DDLStrategy string
SkipPreflight bool
}

// InitShardMaster executes vtctlclient command to make one of tablet as master
func (vtctlclient *VtctlClientProcess) InitShardMaster(Keyspace string, Shard string, Cell string, TabletUID int) (err error) {
output, err := vtctlclient.ExecuteCommandWithOutput(
Expand All @@ -50,21 +56,24 @@ func (vtctlclient *VtctlClientProcess) InitShardMaster(Keyspace string, Shard st
}

// ApplySchemaWithOutput applies SQL schema to the keyspace
func (vtctlclient *VtctlClientProcess) ApplySchemaWithOutput(Keyspace string, SQL string, ddlStrategy string) (result string, err error) {
func (vtctlclient *VtctlClientProcess) ApplySchemaWithOutput(Keyspace string, SQL string, params VtctlClientParams) (result string, err error) {
args := []string{
"ApplySchema",
"-sql", SQL,
}
if ddlStrategy != "" {
args = append(args, "-ddl_strategy", ddlStrategy)
if params.DDLStrategy != "" {
args = append(args, "-ddl_strategy", params.DDLStrategy)
}
if params.SkipPreflight {
args = append(args, "-skip_preflight")
}
args = append(args, Keyspace)
return vtctlclient.ExecuteCommandWithOutput(args...)
}

// ApplySchema applies SQL schema to the keyspace
func (vtctlclient *VtctlClientProcess) ApplySchema(Keyspace string, SQL string) error {
message, err := vtctlclient.ApplySchemaWithOutput(Keyspace, SQL, "direct")
message, err := vtctlclient.ApplySchemaWithOutput(Keyspace, SQL, VtctlClientParams{DDLStrategy: "direct"})

return vterrors.Wrap(err, message)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,17 +415,17 @@ func testOnlineDDLStatement(t *testing.T, alterStatement string, ddlStrategy str
}
} else {
var err error
uuid, err = clusterInstance.VtctlclientProcess.ApplySchemaWithOutput(keyspaceName, alterStatement, ddlStrategy)
uuid, err = clusterInstance.VtctlclientProcess.ApplySchemaWithOutput(keyspaceName, alterStatement, cluster.VtctlClientParams{DDLStrategy: ddlStrategy})
assert.NoError(t, err)
}
uuid = strings.TrimSpace(uuid)
fmt.Println("# Generated UUID (for debug purposes):")
fmt.Printf("<%s>\n", uuid)

strategy, _, err := schema.ParseDDLStrategy(ddlStrategy)
strategySetting, err := schema.ParseDDLStrategy(ddlStrategy)
assert.NoError(t, err)

if !strategy.IsDirect() {
if !strategySetting.Strategy.IsDirect() {
time.Sleep(time.Second * 20)
}

Expand Down
7 changes: 3 additions & 4 deletions go/test/endtoend/onlineddl/ghost/onlineddl_ghost_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,17 +315,16 @@ func testOnlineDDLStatement(t *testing.T, alterStatement string, ddlStrategy str
}
} else {
var err error
uuid, err = clusterInstance.VtctlclientProcess.ApplySchemaWithOutput(keyspaceName, sqlQuery, ddlStrategy)
uuid, err = clusterInstance.VtctlclientProcess.ApplySchemaWithOutput(keyspaceName, sqlQuery, cluster.VtctlClientParams{DDLStrategy: ddlStrategy})
assert.NoError(t, err)
}
uuid = strings.TrimSpace(uuid)
fmt.Println("# Generated UUID (for debug purposes):")
fmt.Printf("<%s>\n", uuid)

strategy, _, err := schema.ParseDDLStrategy(ddlStrategy)
strategySetting, err := schema.ParseDDLStrategy(ddlStrategy)
assert.NoError(t, err)

if !strategy.IsDirect() {
if !strategySetting.Strategy.IsDirect() {
time.Sleep(time.Second * 20)
}

Expand Down
6 changes: 3 additions & 3 deletions go/test/endtoend/onlineddl/revert/onlineddl_revert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,17 +471,17 @@ func testOnlineDDLStatement(t *testing.T, alterStatement string, ddlStrategy str
}
} else {
var err error
uuid, err = clusterInstance.VtctlclientProcess.ApplySchemaWithOutput(keyspaceName, alterStatement, ddlStrategy)
uuid, err = clusterInstance.VtctlclientProcess.ApplySchemaWithOutput(keyspaceName, alterStatement, cluster.VtctlClientParams{DDLStrategy: ddlStrategy})
assert.NoError(t, err)
}
uuid = strings.TrimSpace(uuid)
fmt.Println("# Generated UUID (for debug purposes):")
fmt.Printf("<%s>\n", uuid)

strategy, _, err := schema.ParseDDLStrategy(ddlStrategy)
strategySetting, err := schema.ParseDDLStrategy(ddlStrategy)
assert.NoError(t, err)

if !strategy.IsDirect() {
if !strategySetting.Strategy.IsDirect() {
time.Sleep(time.Second * 20)
}

Expand Down
Loading