Feature: Reduce role-graph work for explicit secondary roles

Open
#21,226 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@TCeason is already working on this.

Since Nov 26, 2026.

Assessment

This issue has not been assessed yet.

Description

C-feature

Summary

Follow-up to #21204. With a non-empty explicit secondary-role list, effective-role resolution expands, clones, and sorts all available RoleInfo values before filtering the requested names, then expands the enabled roles. The extra work can repeat across privilege checks even when the role cache is warm.

Benchmark effective-role resolution and end-to-end authorization checks with large role graphs and non-empty explicit lists. If the overhead is material, use a single role-graph snapshot to check which requested names are reachable and construct RoleInfo only for the final effective roles. Keep ALL and NONE behavior intact, and avoid introducing a cross-request cache.

Verify inherited roles and the AUTH ROLE cap still apply, and that revoking and re-granting a role changes whether it takes effect without changing the stored list.

Dominant language
Rust
Stars
9.5k
Forks
903
Avg merge
2d 13h
Merged PRs (30d)
204

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from databendlabs/databend

All issues in databendlabs/databend

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.