[#28172] YSQL: Adding range columns to yb_tablet_metadata and masking sensitive columns for unprivileged users
commit 92bb0dd ↗ · yugabyte/yugabyte-db · · committed Jun 27, 2026 · +735−27 · base ac7942d0357d
Agent prompt
what a new run launched now would send
The cluster-wide YSQL view `yb_tablet_metadata` still leaves `start_range` and `end_range` always NULL, and every role can read every row’s `relname` (and would see partition bounds once filled), which leaks table names and range boundaries across databases.
Goals:
1) For range-sharded tablets, populate `start_range` and `end_range` with decoded partition bounds in DocDB form (same rendering as the master UI tablet listing — e.g. timestamps as int64 microseconds since epoch). Hash-sharded tablets must keep those columns NULL (hash bounds stay in `start_hash_code`/`end_hash_code` only; composite HASH+ASC still reports only hash bounds).
2) Mask sensitive columns `relname`, `start_range`, and `end_range` for unprivileged callers without dropping rows or requiring a YSQL migration:
- Superusers and `yb_db_admin` members always see real values.
- Other roles see real values only when the row’s table is in the connection’s current database AND the caller has SELECT on that table; otherwise those columns are the literal `<insufficient privilege>`.
- The system `transactions` tablet is always shown unmasked.
- Masked hash-sharded rows keep natural NULL ranges; masked range-sharded rows get the placeholder on every range cell (including edges that would have been NULL) so tablet count/edges do not leak.
- Do not mask `start_hash_code`/`end_hash_code`. Colocation parent rows stay masked for regular users; per-table SELECT gates colocated user-table rows.
- Queries must not fail on rewritten/orphaned OIDs; ACL misses should mask that row.
Existing callers that filter `yb_tablet_metadata` only by `relname` may need to also scope by `db_name` / `current_database()` now that names can be masked or collide across DBs. Cover privilege, hash/range, cross-DB, colocation, and rewrite/OID-stable grant cases in tests.
Work only inside this repository checkout. Make the code change the task
describes, keeping the diff focused — no drive-by refactors.
When you are done, leave your changes committed or in the working tree;
they are collected automatically.
Stay on this snapshot checkout (`task/ycb_yugabyte-db_c92bb0dd12852`). Never checkout, pull, or rebase onto `main`. That branch is a README-only orphan.
Stay on this HEAD. Do not fetch another default branch. Push only on the Cursor-created `crazy-cursor/…` side branch from this HEAD.
Some past runs of this task were launched with a different prompt (the prompt template changed since, or those runs predate this benchmark's stored prompt). Each run persists the exact prompt it sent at launch — that per-launch record is the audit trail; this page shows only the current one.
Reference diff
The task commit's diff against its first parent — the judge's comparison target.