-
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
vtctld: make cell optional #6111
Conversation
This change makes the cell flag optional for vtctld. This removes the catch-22 that you have to create a cell before launching vtctld. But then, how do you create a cell without a vtctld? This required a one-time use of vtctl tool to create this initial cell. If you don't specify a cell, vtctld will choose one at random. I believe the main use case for this is for identifying which shards are serving vs. non-serving. This info is now available in global topo itself as the "IsMasterServing" flag. But, we'll need to go into the UI to make this change, which is non-trivial right now. Signed-off-by: Sugu Sougoumarane <[email protected]>
Also use the API only if localcell is not specified. Signed-off-by: Sugu Sougoumarane <[email protected]>
@@ -287,9 +287,17 @@ func initAPI(ctx context.Context, ts *topo.Server, actions *ActionRepository, re | |||
|
|||
if cell == "local" { | |||
if *localCell == "" { | |||
return nil, fmt.Errorf("local cell requested, but not specified. Please set with -cell flag") | |||
cells, err := ts.GetCellInfoNames(ctx) |
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.
Does this mean that local
is a reserved cell name and no one can use it for their cells? We need to document that.
I think this will improve the local example code a lot. Let's take a look after Vitess 6, so we can think through it from an examples perspective. |
Should this say deterministically and not random? Otherwise LGTM. |
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. We need to track the documentation requirement elsewhere.
I suggest |
This change makes the cell flag optional for vtctld. This removes
the catch-22 that you have to create a cell before launching vtctld.
But then, how do you create a cell without a vtctld?
This required a one-time use of vtctl tool to create this initial
cell.
If you don't specify a cell, vtctld will choose one for you.
I believe the main use case for this is for identifying which shards
are serving vs. non-serving. This info is now available in global
topo itself as the "IsMasterServing" flag. But, we'll need to
go into the UI to make this change, which is non-trivial right now.
Signed-off-by: Sugu Sougoumarane [email protected]