Repository navigation
fix(engines): StarRocks impersonation users, CN password and delete leftovers - #850
Merged
Merged
Conversation
Design for the three StarRocks defects found on kind: the Ranger impersonate row and eager StarRocks user sync for impersonate mode, MYSQL_PWD for the FE and CN, and engine delete removing the initpwd Job's pods and the FE metadata claims. English and Vietnamese. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Twelve tasks: measurements on the fork's plugin and FE first, the D1b infra row with its goldens, MYSQL_PWD, delete cleanup, migration 0219 and the StarRocks user sync with its hook points, a CI parity gate, real-StarRocks and kind live checks, and the docs. English and Vietnamese. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Platform admins are synced; native access control gets per-user IMPERSONATE grants and loses ON ALL USERS in this package; users egret did not create stay untouched; a StarRocks create answers 409 when an old FE metadata claim is left. Adds M6 and M7. English and Vietnamese. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New Task 6 (create refuses a leftover FE metadata claim) and Task 10 (native per-user IMPERSONATE, ON ALL USERS revoked, bootstrap stops granting it); platform admins in the sync and its triggers; M6 and M7 in Task 1; live checks for both on kind. English and Vietnamese. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e but root and egret's users Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oldens with it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…MYSQL_PWD Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… metadata claims Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…end metadata volume Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fy on membership writes Migration 0219 adds engine_mgmt.starrocks_users, reserves `root` in the username ledger, and wakes the StarRocks user sync (channel egret_starrocks_user_sync) from statement triggers on access_grants, user_groups, users, engine_workspaces and roles. The store gains the candidate, record, forget and per-engine advisory-lock methods the sync uses. The two perm-compile tests that seed a person named `root` now write that row with the ledger's triggers off, as a holder from before 0219. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eftover claim A StarRocks create that reuses a live engine's name now answers the ordinary name-exists 409 before the leftover-claim check, so the message never advises deleting a running engine's metadata volume. The claim name comes from the provisioner's fe_meta_claim_name, the helper moves above mod tests, and a failed claim read is tested as a 502. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gine's members Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…applies, the bootstrap and a sweep The bootstrap syncs the users at a new checkpoint 7, after the delegation statements and before the query log (now checkpoint 8). Every StarRocks update apply spawns a sync once the FE answers. A LISTEN worker on migration 0219's channel and a 10-minute sweep (first tick = boot reconcile) feed one worker that debounces and drains wake-ups, so a burst of statement-level NOTIFYs costs one pass. Every sync plans from the engine row re-read at call time, never an earlier snapshot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d or a stale row A username that cannot be minted fails the sync instead of skipping the person; the platform admins' stored names are read in one query. The plan uses the engine row re-read under the sync lock. A create refused as "already exists" always forgets its record, so a lost user someone else re-created is never adopted. Tests assert on their own users, not counts a concurrent platform-admin test can change, and clean up panic-safely. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Busy pass retries sqlx's PgListener::recv() reconnects silently, so the "wake on reconnect" never ran for an ordinary dropped connection. The listener now loops on try_recv() and wakes the worker on Ok(None) (connection lost and re-established), stopping once the pool closes. A pass that finds an engine Busy asks for another pass shortly after instead of leaving the write for the sweep. The coalescing test runs on paused time, and the checkpoint-8 test no longer assumes the member's create is the last statement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… revoke ON ALL USERS The bootstrap no longer grants IMPERSONATE ON ALL USERS. On an engine bound to no profile, the user sync reads the delegator's grants by header, revokes ON ALL USERS, and grants IMPERSONATE ON USER for each user egret created and records. Reserved and foreign users are never granted; bound engines get no native statement. StarRocks keeps a grant on a dropped user and cannot revoke it afterwards, so the sync revokes it before DROP USER and skips the drop when the revoke or the read fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…SERS, revoke before every drop Per-user grants are sent first and ON ALL USERS is revoked only when all of them landed, so a failure never leaves members un-impersonatable. The delegator's grants are read once per sync; a listed per-user grant is revoked before its user is dropped on bound engines too, since DROP USER keeps it. The grants parser unquotes exactly as quote_string quotes. A none-mode engine is not converged. The spec and plan record the measured DROP behaviour, the new order and the 2026-11-12 ruling on orphan grants. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n guard
The workspace guard in egret-workflow's execution_timestamps reads
`ApplyOp::Update {` as an UPDATE whose table is interpolated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three StarRocks defects found live on kind (package D of the StarRocks follow-ups):
MYSQL_PWDand crash-looped on a passworded engine.{name}-initpwdJob pods and thefe-metaPVCs behind. A same-name re-create then kept the old root password, users and catalogs.No issue; tracked in the StarRocks follow-up programme. Spec:
docs/en/specs/2026-11-11-starrocks-delegation-and-lifecycle-design.md. Plan:docs/en/plans/2026-11-11-starrocks-delegation-and-lifecycle.md(both with vi twins).Changes
egret-delegator-impersonaterow (resourceuser,isExcludesoverroot,egret_delegator,egret_query_log) for StarRocks impersonate engines. The OPAdecidearm (InfraObject::AnyUserExcept) matches it. The G22 golden gains the row.0219_starrocks_users.sql(engine_mgmt.starrocks_users,rootreserved in the username ledger, statement-levelpg_notifytriggers).GRANT IMPERSONATE ON USERfor the delegator, thenREVOKE … ON ALL USERS, and a revoke before every drop. The bootstrap no longer grantsON ALL USERS.MYSQL_PWDcomes from<name>-initpwd-secreton FE and CN (an admin-set value wins). Delete removes the initpwd Job (background propagation) and everyfe-meta-<name>-fe-<i>claim. The FE StatefulSet has PVC retentionwhenDeleted: Delete.POST /enginesanswers 409engine_metadata_left_overwhilefe-meta-<name>-fe-0exists, with thekubectl delete pvccommand (502 if the probe cannot read).Test plan
a_starrocks_update_syncs_the_users_again).cargo fmt --checkand workspace clippy-D warnings;EGRET_GOLDEN_MECHANISM=opa),ranger_engine_gate,opa_differential, ranger-evaldifferential.ghcr.io/egret-data/egret-starrocks-allin1:4.1.7-egret.4): newtests/starrocks_users_live.rs, gated onEGRET_TEST_STARROCKS_URL, passes in 1.4 s.ON ALL USERSis gone,EXECUTE ASa member works,EXECUTE AS rootandEXECUTE AS <foreign>are refused.root,egret_query_logandegret_delegatorare refused (5204); an ordinary user is allowed.member-ssoranSELECT current_user()through Egret and got'member-sso'@'%', with no user created by hand. Removing them from the workspace dropped the user within about 1 s; re-adding brought it back within 5 s. The delegator is refusedEXECUTE AS rootandegret_query_log.MYSQL_PWDcomes from the initpwd secret on FE and CN. The CN ran with 0 restarts, wasAlive: true, and re-registered after its pod was deleted.fe-metaclaim, create gives 409 with the command. After running the command, create succeeds.Documentation
egret-data/docs#76:
CREATE USERreply, with recovery) are new.kubectl delete stscascade note), provision (the 409), upgrade notes, REST reference.Checklist
🤖 Generated with Claude Code