Skip to content
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

Allow setting callerid in vtworker #4243

Merged
merged 1 commit into from
Oct 4, 2018

Conversation

dweitzman
Copy link
Member

To avoid getting stuck on any strict table acl checks when resharding

Signed-off-by: David Weitzman dweitzman@pinterest.com

@@ -41,6 +42,7 @@ import (
var (
cell = flag.String("cell", "", "cell to pick servers from")
commandDisplayInterval = flag.Duration("command_display_interval", time.Second, "Interval between each status update when vtworker is executing a single command from the command line")
immediateCaller = flag.String("callerid", "", "immediate CallerID to set when querying vttablet")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - I would call this flag the same way as vtctl, so it is consistent:

   username := subFlags.String("username", "", "If set, value is set as immediate caller id in the request and used by vttablet for TableACL check")
    if *username != "" {
        ctx = callerid.NewContext(ctx,
            callerid.NewEffectiveCallerID("vtctl", "" /* component */, "" /* subComponent */),
            callerid.NewImmediateCallerID(*username))
    }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed the flag to "username" and copied the flag description from vtctl

@dweitzman dweitzman force-pushed the vtworker_callerid_param branch 2 times, most recently from 52ce53b to b595bb4 Compare October 4, 2018 18:32
The -username flag serves the same purpose as the corresponding flag on vtctl:
to avoid getting blocked by strict table acl checks.

Signed-off-by: David Weitzman <dweitzman@pinterest.com>
@dweitzman dweitzman force-pushed the vtworker_callerid_param branch from b595bb4 to 8872101 Compare October 4, 2018 18:32
@sougou sougou merged commit db6a3e8 into vitessio:master Oct 4, 2018
@dweitzman dweitzman deleted the vtworker_callerid_param branch January 7, 2019 00:50
@dweitzman
Copy link
Member Author

This diff does not help in vtworker interactive or web mode and does not support setting groups along with the callerid. I have some code for that, but it feels messy so I'm not planning to mail it out unless other folks run into this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants