An option modifier to make a given global variable have immediate effect on session vars

Registered by Laurynas Biveinis on 2012-12-20

MySQL global/session variables work in a way that global variable changes affect only subsequently started sessions. There is no way for a global variable change to affect already running sessions. There are some use cases where such changes are desirable, thus "slow_query_log_use_global_control" has been implemented [1], [2] to provide this behavior for some specific variables.

This implementation has the issue that it does not fit into MySQL variable framework well.

An alternative would be to implement another variable modifier (such as done for [3], [4]) that, applied to a global/session variable, specifies that the global value changes have effect on session variables immediatelly. For example, "immediate-": --immediate-long-query-time etc. It can be combined with other variable modifiers when it makes sense: --immediate-readonly-query-time would have the effect of a "truly global" variable: the sessions would not be able to modify it, and any changes to the global variable would have immediate effect.

This comes at a cost of some flexibility. "slow_query_log_use_global_control" is dynamic, so the immediate effect can be enabled or disabled at a runtime for the individual supported variables. The immediate modifier would determine all affected variables at server startup and that could not change during server operation.

[1] http://www.percona.com/doc/percona-server/5.5/diagnostics/slow_extended_55.html
[2] https://blueprints.launchpad.net/percona-server/+spec/control-global-slow
[3] http://www.percona.com/doc/percona-server/5.5/management/expanded_program_option_modifiers.html
[4] https://blueprints.launchpad.net/percona-server/+spec/5.5-enhanced-options-modifiers

Blueprint information

Status:
Not started
Approver:
Vadim Tkachenko
Priority:
Not
Drafter:
Laurynas Biveinis
Direction:
Needs approval
Assignee:
None
Definition:
Discussion
Series goal:
Accepted for 5.6
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

KAlexey: see also https://bugs.launchpad.net/percona-server/+bug/588854 which suggests a cleaner approach.
- It is indeed cleaner, what would be the effort estimate for it?

Vadim: I would like to keep at least compatibility with 5.5 in this case.

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.