-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema Tracking Refactor: Merge schema-tracking in health-streamer into schema.Engine #13121
Changes from 8 commits
4e75fe9
122c5e6
714a975
36758f2
9923f76
a950d15
69c3554
9a8202e
b4a7f95
5643738
90e0b56
05b4b82
43056d7
5bb9291
a7e6159
41c5d2a
c47b88b
7f56125
e5272fb
25814d1
0d2ac63
7699de2
42e8ca4
32ab02a
aea8396
707a460
dfdb469
16a4acf
54943b2
877dc48
5ebe65d
94f8c49
f7b496e
c8d891e
96cec2c
f778e0b
ff01bf9
dcff98a
993fa6b
05d3546
ee7562d
e00653f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,18 @@ func VtctldClientProcessInstance(hostname string, grpcPort int, tmpDirectory str | |
return vtctldclient | ||
} | ||
|
||
// PlannedReparentShard executes vtctlclient command to make specified tablet the primary for the shard. | ||
func (vtctldclient *VtctldClientProcess) PlannedReparentShard(Keyspace string, Shard string, alias string) (err error) { | ||
output, err := vtctldclient.ExecuteCommandWithOutput( | ||
"PlannedReparentShard", | ||
fmt.Sprintf("%s/%s", Keyspace, Shard), | ||
"--new-primary", alias) | ||
if err != nil { | ||
log.Errorf("error in PlannedReparentShard output %s, err %s", output, err.Error()) | ||
Comment on lines
+97
to
+103
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there are other places as well we are doing this call, like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could, but eventually we want to move to using |
||
} | ||
return err | ||
} | ||
|
||
// CreateKeyspace executes the vtctl command to create a keyspace | ||
func (vtctldclient *VtctldClientProcess) CreateKeyspace(keyspaceName string, sidecarDBName string) (err error) { | ||
var output string | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
Copyright 2023 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. | ||
*/ | ||
|
||
CREATE TABLE IF NOT EXISTS schema_engine_tables | ||
( | ||
TABLE_SCHEMA varchar(64) NOT NULL, | ||
TABLE_NAME varchar(64) NOT NULL, | ||
CREATE_STATEMENT longtext, | ||
CREATE_TIME BIGINT, | ||
PRIMARY KEY (TABLE_SCHEMA, TABLE_NAME) | ||
) engine = InnoDB |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
Copyright 2023 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. | ||
*/ | ||
|
||
CREATE TABLE IF NOT EXISTS schema_engine_views | ||
( | ||
VIEW_SCHEMA varchar(64) NOT NULL, | ||
VIEW_NAME varchar(64) NOT NULL, | ||
CREATE_STATEMENT longtext, | ||
VIEW_DEFINITION longtext NOT NULL, | ||
PRIMARY KEY (VIEW_SCHEMA, VIEW_NAME) | ||
) engine = InnoDB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there are existing usages of
StreamTabletHealth
can those also use this utility function?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an inherent difference between the two.
StreamTabletHealth
gets you specified number of stream responses back, which can then be processed. On the other handStreamTabletHealthUntil
is meant to be used where the test doesn't care if we consume more responses and only verifies if a certain check is ever true.The tests currently using
StreamTabletHealth
actually can't really useStreamTabletHealthUntil
because they want to run a test on the next packet, and not an eventual packet.