-
Notifications
You must be signed in to change notification settings - Fork 501
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
Support plugin start argument for tidb instance #412
Conversation
charts/tidb-cluster/values.yaml
Outdated
@@ -192,6 +192,15 @@ tidb: | |||
cpu: 20m | |||
memory: 5Mi | |||
|
|||
# tidb plugin configuration | |||
plugin: | |||
# enable pulgin or not |
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.
s/pulgin/plugin
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.
fixed
charts/tidb-cluster/values.yaml
Outdated
# enable pulgin or not | ||
enable: false | ||
# the start argument to specify the folder containing | ||
directory: /pulugins |
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.
s/pulugins//plugins
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.
fixed
charts/tidb-cluster/values.yaml
Outdated
# the start argument to specify the folder containing | ||
directory: /plugins | ||
# the start argument to specify the plugin id (name "-" version) that needs to be loaded, e.g. 'conn_limit-1'. | ||
list: whitelist-1 |
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.
If there're multiple plugins, is list a comma separated string? I found a example, but not sure it works or not.https://github.com/helm/charts/blob/master/stable/opa/templates/deployment.yaml#L96
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.
yes!
From the design document.
https://github.com/pingcap/tidb/blob/master/docs/design/2018-12-10-plugin-framework.md#Management
and tidb uage document
https://github.com/pingcap/tidb/blob/11d7199fcfbb66b1205ffa00f770f90f7b1ee9c1/tidb-server/main.go#L114
and the code that load plugins
https://github.com/pingcap/tidb/blob/11d7199fcfbb66b1205ffa00f770f90f7b1ee9c1/session/session.go#L1305
if len(cfg.Plugin.Load) > 0 {
err := plugin.Load(context.Background(), plugin.Config{
Plugins: strings.Split(cfg.Plugin.Load, ","),
PluginDir: cfg.Plugin.Dir,
GlobalSysVar: &variable.SysVars,
PluginVarNames: &variable.PluginVarNames,
})
if err != nil {
return nil, err
}
}
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.
the plugin.list is changed to array
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
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
Support plugin start argument for tidb instance. The default value is disabled
Tests
ARGS="${ARGS} --plugin-dir /pulugins --plugin-load whitelist-1 "