-
Notifications
You must be signed in to change notification settings - Fork 838
Open
Labels
C-featureCategory: featureCategory: feature
Description
Summary
- CI spins up a 3-node query cluster via
scripts/ci/deploy/databend-query-cluster-3-nodes-nginx.sh, thentests/nox/java_client/prepare.pycreates user
databend, roletest_jdbc, and runsGRANT ALL ON *.* TO ROLE test_jdbc. - Grants are written in meta by whichever node handles the HTTP call (through nginx on port 8000).
- JDBC sessions are routed round-robin to any query node. Each node maintains its own
RoleCacheManager(src/query/users/src/role_cache_mgr.rs), which
invalidates locally on GRANT/REVOKE but otherwise reloads every 15 s via background polling or lazymaybe_reload. - If a JDBC session lands on a different node before its cache reloads,
validate_db_access(src/query/service/src/interpreters/access/privilege_access.rs:268- 337) sees stale grants and throws:
Permission denied: privilege [Create] is required on 'default'.'default'.*
- CI currently has to curl each node (
SHOW GRANTS FOR ROLE test_jdbcon ports 8001–8003) to force reloads, which is brittle.
Request
Introduce an explicit “flush privileges” mechanism, similar to MySQL/ClickHouse:
- Provide a SQL statement (e.g.
SYSTEM FLUSH PRIVILEGES/SYSTEM RELOAD ROLES) and/or HTTP API that invokesRoleCacheManager::force_reload(&tenant)on
every query node. - Broadcast the command so all running query instances refresh immediately, eliminating the 15 s window.
Acceptance Criteria
- After GRANT/REVOKE the user can run a single flush command and be guaranteed that all nodes observe the new privileges immediately.
- CI scripts no longer need to probe each HTTP port manually to warm caches.
Metadata
Metadata
Assignees
Labels
C-featureCategory: featureCategory: feature