-
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
Rename WORKER tablet type into DRAINED #2151
Conversation
Reviewed 6 of 6 files at r1, 3 of 3 files at r2. go/vt/worker/topo_utils.go, line 121 at r1 (raw file):
nit: Please write "vtworker" instead of "worker" because only the Go package is called "worker". Other than that, we always refer to it by "vtworker". Comments from Reviewable |
I like this idea. Alain, any objections on this one? |
Review status: 8 of 9 files reviewed at latest revision, 1 unresolved discussion. go/vt/worker/topo_utils.go, line 121 at r1 (raw file):
|
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.
LGTM I don't think we use the worker type name explicitly anywhere.
@@ -128,17 +129,18 @@ func FindWorkerTablet(ctx context.Context, wr *wrangler.Wrangler, cleaner *wrang | |||
// ChangeSlaveType back, so we need to record this tag change after the change | |||
// slave type change in the cleaner. | |||
defer wrangler.RecordTabletTagAction(cleaner, tabletAlias, "worker", "") |
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.
I don't like that these Tablet record changes are not atomic. We update the tablet record 2 times upon start, and 3 times upon cleaning. The extra tag makes it worse, but the problem was already there. I guess we can fix that when we switch to having an RPC to make a tablet drained.
This will make the type look more generic, so that it could be used for other purposes as well, not only for a worker during resharding. In particular I plan to use the same tablet type for schema swap reserving a seed vttablet to execute the schema change. I also add a "drain_reason" tag that will be set by anyone setting the DRAINED tablet type, so that it's easy to understand why it is drained.
The site needed publishing after vitessio#2312 and maybe after some other changes. On the way I fixed a couple of incorrect things in vtctl docs (typo in an error message and change of tablet type name WORKER->DRAINED that happened in vitessio#2151).
This will make the type look more generic, so that it could be used for other
purposes as well, not only for a worker during resharding. In particular I plan
to use the same tablet type for schema swap reserving a seed vttablet to execute
the schema change.
I also add a "drain_reason" tag that will be set by anyone setting the DRAINED
tablet type, so that it's easy to understand why it is drained.