-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
cli: make the zone cli aware of tables/databases #4866
Conversation
This likely needs some additional commenting, but I wanted to get some feedback on the interface. Specifying zone configs via yaml isn't that pleasant, but I think this is as much as we should do for Beta. |
I agree with the format, but yaml is still a friendlier solution than json (kindda gross) or ascii protobufs (too obscure). an alternative would be to allow setting individual fields of the config, but I'm not sure that's critical. |
Lots of utility stuff wound up in zone.go - probably belongs elsewhere. It makes the important stuff in zone.go quite hard to read in this diff. Reviewed 6 of 6 files at r1. cli/zone.go, line 54 [r1] (raw file): also, why pointers? cli/zone.go, line 64 [r1] (raw file): cli/zone.go, line 294 [r1] (raw file): sql/keys.go, line 59 [r1] (raw file): Comments from the review on Reviewable.io |
@mberhault This change does allow you to tweak individual fields. See the example where
It would be nice to have a shorthand: |
f04ce53
to
3a09961
Compare
Review status: 3 of 8 files reviewed at latest revision, 4 unresolved discussions. cli/zone.go, line 54 [r1] (raw file): cli/zone.go, line 64 [r1] (raw file): cli/zone.go, line 294 [r1] (raw file): sql/keys.go, line 59 [r1] (raw file): Comments from the review on Reviewable.io |
c.Run("zone ls") | ||
c.Run("zone rm .default") |
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.
can you add a case to modify .default
. it looks fine since it should always exist so the UPDATE
vs INSERT
check should always say UPDATE
, but the use of 0
as a return value for queryZonePath
makes it worth checking.
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.
Done.
LGTM |
3a09961
to
5c2101f
Compare
Instead of shorthand at the CLI level, we should consider reworking the protobuf completely. In addition to making it awkward to express the basic constraint of the number of target replicas, it is completely unable to express negative constraints (any store but I'd be in favor of introducing a |
@bdarnell That's a good point about negative and diversity constraints. I think we need to put additional thought into this. I'll file an issue. |
Reviewed 5 of 5 files at r2. cli/zone.go, line 54 [r1] (raw file): Comments from the review on Reviewable.io |
5c2101f
to
679ac96
Compare
Review status: 6 of 8 files reviewed at latest revision, 2 unresolved discussions. cli/zone.go, line 54 [r1] (raw file): Comments from the review on Reviewable.io |
Reviewed 1 of 1 files at r3, 1 of 1 files at r4. Comments from the review on Reviewable.io |
Enhanced the zone commands to operate on database and table names instead of object IDs. Fixes cockroachdb#2505.
679ac96
to
5e2b720
Compare
@jseldess The |
cli: make the zone cli aware of tables/databases
Enhanced the zone commands to operate on database and table names
instead of object IDs.
Fixes #2505.