[MDEV-33145] Add FLUSH GLOBAL STATUS Created: 2023-12-31  Updated: 2024-01-02

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: 11.6

Type: Task Priority: Major
Reporter: Michael Widenius Assignee: Michael Widenius
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Current FLUSH STATUS command has a bunch of issues:

  • it resets many session variables and some global variables — but not all session and not all global, the decision was made per variable and was rather ad hoc
  • it requires RELOAD global privilege, a user cannot reset status in his session other than by reconnecting

A more useful behavior could be:

  • there are clear criteria what variables are reset and what aren't
  • FLUSH [ SESSION | LOCAL ] STATUS flushes appropriate session variables, and requires no privileges at all
  • FLUSH GLOBAL STATUS requires RELOAD and resets appropriate global variables

original description:

Currently there is now way to flush global status variables, stored in 'global_status_var', which is useful for testing.
Another issue is that FLUSH STATUS resets some global variables (all LONG and LONGLONG C global variables) which 'normal' users should not be allowed to do. This is not dangerous but can be confusing for shared instances.

The proposal is to implement FLUSH SESSION STATUS, which only resets thread local variables and FLUSH GLOBAL STATUS that resets global_status_vars and the currently reset global C variables.

FLUSH STATUS will be mapped to FLUSH SESSION STATUS and can be used without any privileges.
FLUSH GLOBAL STATUS will require the RELOAD_ACL, like now.


Generated at Thu Feb 08 10:36:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.