-
Notifications
You must be signed in to change notification settings - Fork 841
feat: add explicit FLUSH PRIVILEGES to refresh role cache for query node #19066
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
Conversation
d486a0b to
c20e715
Compare
💡 Codex Review
The flight handlers now call ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
4d88077 to
961274b
Compare
|
@TCeason That was a mistake, fixed it |
…s runs in a QueryContext whose tenant is fixed to GlobalConfig::instance().query.tenant_id unless the server
is in management mode. When management mode is enabled, ManagementModeAccess blocks Plan::System altogether so no user query can ever build a system
action with a different tenant. As a result, the tenant field inside SystemPlan was guaranteed to equal the global config tenant and provided no extra routing information anywhere else in the stack.
- All flight actions (system_action, kill_query, set_priority, truncate_table) run inside a query server whose GlobalConfig already defines a single tenant. There is no supported deployment where a single query process serves
multiple tenants concurrently over flight RPC. Therefore, the create_session helper in src/query/service/src/servers/flight/v1/actions/mod.rs can safely derive the tenant from GlobalConfig every time; the optional parameter was
never used to switch context to another tenant.
- Because both ends (planner and flight handler) collapse to the same static tenant, the tenant field in SystemPlan and the Option<Tenant> parameter to create_session were redundant wiring that couldn't change behavior. Removing
them simplifies the code without affecting any observable semantics and makes it clear that system/flight actions always run under the server's configured tenant.
6f98822 to
198a47e
Compare
|
@camilesing Thanks for contributing. |

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/
Summary
Add the SYSTEM FLUSH PRIVILEGES syntax/AST/plan so users can invoke it just like the existing SYSTEM ENABLE/DISABLE EXCEPTION_BACKTRACE.
Extend SystemActionInterpreter to reuse the flight broadcast path so every query node handles the new system action, while each node calls RoleCacheManager::force_reload locally to eliminate the previous 15 s privilege-cache
fixes: Feature: Add explicit
FLUSH PRIVILEGES-style command to refresh role cache across query nodes #19013Tests
Type of change
This change is