-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
vreplication_test_env.go
87 lines (80 loc) · 5.21 KB
/
vreplication_test_env.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
Copyright 2020 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package vreplication
var dryRunResultsSwitchWritesCustomerShard = []string{
"Lock keyspace product",
"Lock keyspace customer",
"Stop writes on keyspace product, tables [Lead,Lead-1,customer,db_order_test]:",
"/ Keyspace product, Shard 0 at Position",
"Wait for VReplication on stopped streams to catchup for up to 30s",
"Create reverse replication workflow p2c_reverse",
"Create journal entries on source databases",
"Enable writes on keyspace customer tables [Lead,Lead-1,customer,db_order_test]",
"Switch routing from keyspace product to keyspace customer",
"Routing rules for tables [Lead,Lead-1,customer,db_order_test] will be updated",
"Switch writes completed, freeze and delete vreplication streams on:",
" tablet 200 ",
" tablet 300 ",
"Start reverse replication streams on:",
" tablet 100 ",
"Mark vreplication streams frozen on:",
" Keyspace customer, Shard -80, Tablet 200, Workflow p2c, DbName vt_customer",
" Keyspace customer, Shard 80-, Tablet 300, Workflow p2c, DbName vt_customer",
"Unlock keyspace customer",
"Unlock keyspace product",
}
var dryRunResultsReadCustomerShard = []string{
"Lock keyspace product",
"Switch reads for tables [Lead,Lead-1,customer,db_order_test] to keyspace customer for tablet types [RDONLY,REPLICA]",
"Routing rules for tables [Lead,Lead-1,customer,db_order_test] will be updated",
"Unlock keyspace product",
}
var dryRunResultsSwitchWritesM2m3 = []string{
"Lock keyspace merchant-type",
"Stop streams on keyspace merchant-type",
"/ Id 2 Keyspace customer Shard -80 Rules rules:{match:\"morders\" filter:\"select oid, cid, mname, pid, price, qty, total from orders where in_keyrange(mname, 'merchant-type.md5', '-80')\"} at Position ",
"/ Id 2 Keyspace customer Shard -80 Rules rules:{match:\"morders\" filter:\"select oid, cid, mname, pid, price, qty, total from orders where in_keyrange(mname, 'merchant-type.md5', '80-')\"} at Position ",
"/ Id 3 Keyspace customer Shard 80- Rules rules:{match:\"morders\" filter:\"select oid, cid, mname, pid, price, qty, total from orders where in_keyrange(mname, 'merchant-type.md5', '-80')\"} at Position ",
"/ Id 3 Keyspace customer Shard 80- Rules rules:{match:\"morders\" filter:\"select oid, cid, mname, pid, price, qty, total from orders where in_keyrange(mname, 'merchant-type.md5', '80-')\"} at Position ",
"/ Id 4 Keyspace customer Shard -80 Rules rules:{match:\"msales\" filter:\"select mname as merchant_name, count(*) as kount, sum(price) as amount from orders where in_keyrange(mname, 'merchant-type.md5', '-80') group by merchant_name\"} at Position ",
"/ Id 4 Keyspace customer Shard -80 Rules rules:{match:\"msales\" filter:\"select mname as merchant_name, count(*) as kount, sum(price) as amount from orders where in_keyrange(mname, 'merchant-type.md5', '80-') group by merchant_name\"} at Position ",
"/ Id 5 Keyspace customer Shard 80- Rules rules:{match:\"msales\" filter:\"select mname as merchant_name, count(*) as kount, sum(price) as amount from orders where in_keyrange(mname, 'merchant-type.md5', '-80') group by merchant_name\"} at Position ",
"/ Id 5 Keyspace customer Shard 80- Rules rules:{match:\"msales\" filter:\"select mname as merchant_name, count(*) as kount, sum(price) as amount from orders where in_keyrange(mname, 'merchant-type.md5', '80-') group by merchant_name\"} at Position ",
"Stop writes on keyspace merchant-type, tables [/.*]:",
"/ Keyspace merchant-type, Shard -80 at Position",
"/ Keyspace merchant-type, Shard 80- at Position",
"Wait for VReplication on stopped streams to catchup for up to 30s",
"Create reverse replication workflow m2m3_reverse",
"Create journal entries on source databases",
"Enable writes on keyspace merchant-type tables [/.*]",
"Switch routing from keyspace merchant-type to keyspace merchant-type",
"IsPrimaryServing will be set to false for:",
" Shard -80, Tablet 400 ",
" Shard 80-, Tablet 500 ",
"IsPrimaryServing will be set to true for:",
" Shard -40, Tablet 1600 ",
" Shard 40-c0, Tablet 1700 ",
" Shard c0-, Tablet 1800 ",
"Switch writes completed, freeze and delete vreplication streams on:",
" tablet 1600 ",
" tablet 1700 ",
" tablet 1800 ",
"Start reverse replication streams on:",
" tablet 400 ",
" tablet 500 ",
"Mark vreplication streams frozen on:",
" Keyspace merchant-type, Shard -40, Tablet 1600, Workflow m2m3, DbName vt_merchant-type",
" Keyspace merchant-type, Shard 40-c0, Tablet 1700, Workflow m2m3, DbName vt_merchant-type",
" Keyspace merchant-type, Shard c0-, Tablet 1800, Workflow m2m3, DbName vt_merchant-type",
"Unlock keyspace merchant-type",
}