Upgrades and migrations
How to move an Egret deployment to a newer version, how database migrations behave, and what to check afterwards. Back up the metadata database first; see Backup and restore.
How migrations work
Egret keeps its schema as numbered SQL files in the repository's migrations/ directory (199 of them at the time of
writing, 0001_init.sql to 0199_audit_mutation_index.sql). They are compiled into the egret binary and applied with
sqlx. The applied versions and a checksum of each are recorded in the table _sqlx_migrations in the metadata database.
| Property | What it means for you |
|---|---|
| Forward only | There are no down migrations. The way back is a restore from backup. |
| Applied automatically | egret serve runs pending migrations at boot. egret migrate, egret init and egret workspace run them too. |
| Compiled in | A binary carries exactly the migrations that existed when it was built. |
| Verified | Each applied migration is checked against its recorded checksum on every run. |
Because serve migrates at boot, starting the new version is the upgrade. To migrate before any traffic, run egret migrate once with the new binary and then roll out the servers.
What the server does when the database does not match
These refusals were reproduced against a copy of a database:
| Situation | Message | What to do |
|---|---|---|
| The database is newer than the binary (you started an older version) | migration 9999 was previously applied but is missing in the resolved migrations | Run the newer binary, or restore a backup taken before the upgrade. Do not delete rows from _sqlx_migrations. |
| A migration file changed after it was applied | migration 1 was previously applied but has been modified | Use the release's own migration files. A modified migration is a build or packaging error. |
| The database is unreachable or the password is wrong | error returned from database: password authentication failed for user "egret" | Fix EGRET_DATABASE__URL. |
A first migration of a fresh database applies all 199 files and takes about 15 seconds.
Migration numbers are a shared namespace. If you build from a long-lived branch that added a migration with a number
main later used for something else, migrate fails. Deploy released builds, not branches, to shared environments.
Upgrade procedure
- Read the release notes of every version between yours and the target for configuration changes. New keys have defaults, but a key whose default changed, or a new required key, stops the server at boot with a message naming it (see Startup checks).
- Back up the metadata database. Take the dump before you stop anything.
- Stop or drain the old servers. The server drains in-flight requests for up to 55 seconds on shutdown; allow at least
65 seconds before the process is killed (the Helm chart sets
terminationGracePeriodSeconds: 65). - Start the new version. With one replica, start it and watch the log for
migrations applied. With several replicas, runegret migrateonce first. - Check health.
GET /readyzanswers{"status":"ok","db":"up"}once the database answers. Sign in, open a dashboard, run a query. - Check the workflow worker and scheduler are still enabled (
EGRET_WORKFLOW__WORKER_ENABLED,EGRET_WORKFLOW__SCHEDULER_ENABLED); they are off by default and a rebuilt environment loses them silently.
With the Helm chart
helm upgrade egret deploy/helm/egret -n egret-system -f my-values.yaml
The chart looks up the existing egret-secrets Secret, so the master key, the cookie key and the catalog token are kept
across upgrades. The egret-init hook runs again after every upgrade; it does nothing when an administrator already exists.
Pods are not restarted when only an image's contents change under an unchanged tag: roll them explicitly
(kubectl rollout restart deploy/egret -n egret-system) or use a new tag. Not run for these docs, which had no Kubernetes
cluster; see Kubernetes.
The demo stack
The demo stack is upgraded by rebuilding it from the new source: git pull, then
just demo-up (it runs docker compose up -d --build). Migrations run when the Egret container starts, and the data volumes are
kept. Engines started with Add engine keep their containers only while the stack is up: after just demo-down and
just demo-up they stay listed as provisioning with no containers, so delete and add them again. Not run for these docs.
Moving engines to a new version
Upgrading Egret does not change the engines it provisioned: each keeps the image it was created with. Change an engine's
image with PUT /api/control-plane/engines/{id}; this restarts the engine's pods, so the engine is unavailable while they
roll. Egret models policy evaluation only for measured (engine, plugin) pairs, so pin images to the versions listed in
Engines and Ranger setup and never move a StarRocks front end back to an older version: its metadata
may not start on it.
Version-specific notes
These come from the repository's Helm chart README and apply to the releases that introduced them.
The bundled object store is RustFS, not MinIO
MinIO withdrew its public images, so the bundled S3 server is now RustFS, and the Service, Deployment, claim and values were
renamed (deps.minio.* became deps.rustfs.*, mcImage became clientImage). RustFS cannot read MinIO's data format, so
upgrading an existing dev release starts with an empty bucket: Iceberg data files, query results, workflow files and Data
Apps sources are not carried over, and catalog rows in PostgreSQL that point at them are left dangling. Reinstall or reseed
instead of upgrading in place. Engines provisioned earlier keep http://minio...:9000 in their catalog properties and
storage connections; re-create the storage connection with the new endpoint and re-apply the catalogs, or re-provision.
StarRocks front-end metadata is persistent only for new engines
Engines created from the release that added it get a persistent volume for the front end's metadata. Existing engines keep
the operator's emptyDir and are left exactly as they are: the volume claim template of a StatefulSet is immutable, so
changing it would park the cluster in a failed state. To get persistence, create a new engine and point at it. Migrating
an existing engine by hand destroys its front end's metadata (catalogs, StarRocks-side users and grants); the chart README
lists what is lost and what recovers it.
Usernames are never reused (migration 0209)
From platform #741 a deleted user's engine username is retired for good (see
Users). Migration 0209_username_ledger.sql
records every username in use and every name that a policy, grant, rule or retained governance event names, in the
append-only table username_ledger.
Upgrading retires every username that a policy, grant, rule or retained governance event names but no user holds. A
hand-written policy that named someone who had not signed in yet will not apply to them: they are given another name (for
example alice-2). Governance → People & groups → Reused names lists such names as dead. Rewrite those policies to the
name the person was given.
After the upgrade, a platform admin should open Reused names and the Governance overview once: they report places
where a deleted user's name was already given to someone else before the upgrade. At its first start the new version also
rewrites the engines' egret-admin policies to the active platform admins, so disabled admins lose engine all access. The
ledger is data; see Backup and restore before restoring data only.
StarRocks enforces whole-table classifications (platform #755)
From platform #755 a classification on a whole table is enforced on StarRocks: a clearance compiles a select deny on the table and a NULL mask per column, and a row filter by classification filters the table (see Clearance). There is no migration. At its first start the new version recompiles each StarRocks profile that reaches such a classification, and the plugins download the new policies once.
After the upgrade, open the Governance overview once. A profile whose recompile was refused, for example because a newly
reached table makes two row filters by classification decide it differently, keeps its previous compile and shows as
Profile compile failed, naming the rules. Edit or delete one of them. GET /api/control-plane/perm/overlaps lists only
pairs that were already stored. A table change that would push a clearance over its ceiling is now refused at the Iceberg
commit.
Classifications follow a renamed table (platform #757)
From platform #757 a rename of a classified table or column through egret's Iceberg catalog moves its classifications to the
new name, and is held until the engines serve them: up to 90 seconds, about two policy polls with StarRocks bound. An Iceberg
client that renames tables must wait that long; Trino does. A bound engine whose plugins do not poll makes these renames fail
with a 409, and SQL Lab stops waiting at its 60-second query limit (engine.query_timeout_secs) first (KI-310). Unclassified
renames and every other request are unchanged. There is no migration.
Classifications that earlier renames left on old names are not moved. After the upgrade, open the Governance overview and check classifications on tables that do not exist and classifications on columns that do not exist. Attach each classification to the new name and remove it from the old one. See Renames and drops.
Catalog renames and commits are authorized by their tables (platform #758)
From platform #758 egret's Iceberg catalog decides a rename, a commit and a recursive namespace drop on the tables they
change. There is no migration and no API change. Engines provisioned by egret hold catalog · manage and are not affected;
Trino's creates, writes, renames and drops were checked. A Catalog Client with narrower grants may now be refused calls it
could make before:
- a rename needs
writeon the source table and acatalogornamespacegrant on the destination namespace (a grant on the destination table name no longer suffices); - a multi-table commit needs
writeon every table in it; - a recursive namespace drop needs a
catalog-levelwriteormanagegrant; - remote S3 signing is refused with 403.
Grants now match names case-insensitively, as the catalog does, so two grants that differ only in case are the same grant. A role reaches no table it could not already reach by spelling the name as its grant does. Refusals are Iceberg JSON errors, and rename and commit bodies are limited to 1 MiB and 16 MiB (413). See What each operation needs.
Vended credentials follow catalog grants (platform #760)
From platform #760 the S3 credentials egret's Iceberg catalog vends on a table load follow the client's grant. There is no migration and no API change.
- A role with only a
readgrant covering the table (on the table, its namespace or the catalog) gets read-only credentials (s3:GetObject,s3:GetObjectVersion). Before, every client that could load a table got read-write-delete credentials on its files, even without theX-Iceberg-Access-Delegationheader (KI-311). writeandmanagestill get read-write-delete. The same rule applies on…/tables/{t}/credentials. View loads stay read-only.- Behaviour change: an engine or client that uses a Catalog Client with only
readgrants can still read, but it can no longer write or delete table files. Its writes now fail at the object store with access denied (PyIceberg:ACCESS_DENIED during CreateMultipartUpload) instead of reaching the catalog. If such an engine is meant to write, give its rolewriteormanage. - Engines provisioned by egret hold
catalog · manageand are not affected; Trino's creates, inserts, updates, deletes, renames and drops were checked. - Credentials vended before the upgrade, read-write-delete ones handed to readers included, stay valid until they expire, about an hour after they were issued (KI-315).
See Storage credentials follow the grant.
Grants, rules and catalog grants follow a renamed table (platform #764)
From platform #764 a rename of a table or column through egret's Iceberg catalog carries its permissions. There is no migration and no API change.
- Deny grants, path masks and path row filters are copied to the new name before the commit, and the originals stay on the old name on purpose. Such renames are held like classified ones, now waiting for Trino's policy version too: 54 to 57 seconds were measured with both engines bound, at most 90 seconds (KI-310). An Iceberg client that renames these tables must wait that long; from SQL Lab a hold over 60 seconds shows a timeout although the rename goes through (since platform #805 the timeout message says so).
- Allow grants move to the new name after the commit. A holder can be refused on the new name until the engines' next policy polls (KI-317).
- Catalog grants on the table move to the new name after the commit, for every rename.
- Behaviour change: a rename is refused with a 409 that names the rows when a deny, mask or row filter written with a pattern covers the old name and not the new one, or when an enabled hand-written policy names the table with a deny, mask, row filter or exclusion list. Change the pattern or add the restriction on the new name, or edit the policy, then rename.
- A grant or rule write on a table name that a rename is holding is refused with 409
table_change_held; retry it. - A recursive namespace drop now also deletes the allow grants on its tables and the catalog grants on tables under it.
Grants, rules and catalog grants that earlier renames left on old names are not moved. After the upgrade, open the Governance overview and check permissions on tables that do not exist, permissions on columns that do not exist and catalog grants on tables that do not exist. Write each row on the new name and delete the old one. The overview also lists the restrictions renames now keep on old names on purpose; remove those you no longer need. See Renames and drops.
StarRocks 4.1.6 enforces view privileges
StarRocks refuses SELECT * on masked tables (platform #766)
From platform #766 a StarRocks table with a mask refuses SELECT * to a reader who does not see the real value in every
masked column, because the table's hidden _file column would show the object-store path of each data file (KI-304).
- Behaviour change: that reader gets error 5204 on
_fileinstead of the rows. Name the columns, or read through a view, which shows no path. - There is no migration and no API change. An existing masked table gets its deny on the next compile of its profile. To
apply it at once, run
POST /api/control-plane/perm/compile/{profile_id}. - A mask on a table selected by a wildcard or an excluded name gets no deny. That gap stays open (KI-304).
Profiles get a tag service from the console (platform #805)
From platform #805 a Trino policy profile can be given a tag service in the console, at creation or later on its
Advanced tab, through PUT /api/control-plane/policies/services/{service}/tag-service. There is no migration.
- API change:
GET /api/control-plane/policies/services/{service}/trino-configanswers{"files": [...], "warnings": [...]}instead of a bare array of files. A script that read the array must readfiles. - The engine pickers no longer offer a Trino profile with no tag service. Give such a profile one before you bind it.
- A SQL Lab timeout on a schema change says that the change may still complete (KI-318).
Namespace creates, listings and body deadline in the Iceberg catalog (platform #806)
From platform #806 egret's Iceberg catalog decides a namespace create on its parent, cuts listings to what the role can
see, and limits the time a request body may take. There is no migration and no API change. Engines provisioned by egret
hold catalog · manage and are not affected. A Catalog Client with narrower grants may now see:
- a 403 creating a namespace: it needs
writeormanageon the parent namespace, or acatalog-level grant for a top-level namespace (before, anywritegrant created any namespace); - shorter answers from
GET …/namespaces,…/namespaces/{ns}/tablesand…/views: only what the role can see. A page can be short or empty whilenext-page-tokenstill points on; Iceberg clients follow the token; - a 408 when a request body has not fully arrived 30 seconds after the request;
- a 409 creating a warehouse whose S3 storage overlaps an existing one, even when the endpoint is written differently (KI-316).
Platform admins held through groups (platform #807)
From platform #807 the last active platform admin is guarded on every path, and the console shows roles held through a group. There is no migration.
- Behaviour change: removing a member from a group, deleting a group and
PUT /api/admin/users/{id}/platform-rolesnow answer 409 Cannot remove the last active platform admin when they would leave no active platform admin. - The OIDC group sync keeps a membership that is the last active platform admin's only hold on
platform_admin, and logs a warning (kept the OIDC group membership that is the last active platform admin's only hold on platform_admin; make another user a platform admin, then the next sync drops it). Make someone else a platform admin, and the next sync drops it. - API addition: the Control Plane user list carries
effectiveRoles([{"name", "group"}],groupnull for a direct grant);rolesstays the directly granted set.
Manual tag policies the engines apply (platform #809)
From platform #809 a classification's Manual policies tab lists every hand-written tag policy the engines apply to
the classification's name, including one whose pattern does not match it: Ranger picks tag policies by the text before
the first *, ? or {, so *i applies to every tag. Such a row carries Wider than its pattern (see
Manual policies). There is no migration and nothing changes
on the engines: they applied these policies before too.
- API addition: each row of
GET /api/control-plane/classifications/{id}/handwrittencarrieswidenedByEngineandengineTagPrefix(""means every tag).
Permission follow-ups (platform #810)
From platform #810 there is no migration, and no request or response shape changes.
- The start-up recompile of profiles that name a role is retried after 5 s, 30 s and 2 min, and logs an error when every attempt fails (see Platform admins on the engines).
- Renaming or deleting a local group checks policy:read only when the change is refused because something names the group. A change that nothing refuses no longer depends on that check.
- Editing a grant or a rule while someone else edits the same one answers 409 less often: egret re-reads the row once it holds the locks, and refuses only when the change no longer fits.
PATCHandDELETEon/api/control-plane/perm/grants/{id}and/perm/rules/{id}, andGET /api/control-plane/perm/rules/{id}/effect, answer 404 for a grant or rule outside the caller's workspace, the same answer as for an id that does not exist.- A platform-scope
platform_admingrant that has expired, or whose effect isdeny, no longer counts for the engines'egret-adminpolicies or the last-admin guard (KI-322), and adenygrant no longer gives the session its role (KI-323). No API writes such grants, so existing installs see no change.
Deny and expired grants give no role (platform #811)
From platform #811 every check that asks whether a grant gives its role counts only a live allow grant: one with no
expiry, or an expiry in the future. There is no migration and no API shape change.
- A principal whose only grant in a workspace is a
denyis refused there (403) and the workspace switcher does not list it. Before, it was admitted. - Behaviour change: removing or demoting a workspace's last admin answers 409 the workspace must keep at least one
admin when the only other
ws_adminrows have lapsed or aredeny. Before, those rows counted as admins. - The member list's platform-admin badge, the console's effective platform roles and
egret init's check that an admin exists count only liveallowgrants (KI-329 to KI-331).
Vended credentials last 15 minutes (platform #812)
From platform #812 the S3 credentials egret's Iceberg catalog vends are valid for 15 minutes instead of an hour. There is no migration.
- New key:
catalog.sts_token_validity_seconds(EGRET_CATALOG__STS_TOKEN_VALIDITY_SECONDS), default 900, from 900 to 43200. A value outside that range stops the server at start. See Configuration keys. - At start, egret writes the lifetime into every S3 warehouse the catalog already holds, and logs it:
vended credential lifetime seconds=900 warehouses_changed=1
- Credentials handed out before the upgrade stay valid until their own expiry, up to an hour (KI-315).
- An engine that loads a table again gets fresh credentials. Trino was checked reading and writing past the 15 minutes; StarRocks was not checked.
Writes refused when the profile set grows (platform #813)
From platform #813 a write that recompiles policy profiles is refused, and writes nothing, when an engine is bound to another profile while it runs. There is no migration.
- API change: a clearance change, a classification added to or removed from a catalog object, a classification
delete, and grant and rule writes under
/api/control-plane/permcan answer 409 with"code": "profile_set_changed"and"retryable": true. Before, the same race could end in a database deadlock. Retry the write. See Errors. - A table rename that meets the same race is refused with the rename hold's existing busy message, to retry.
- A write whose profiles include no Trino or StarRocks profile, and no
egret-adminset, no longer gives out engine usernames before it compiles, nor takes the lock that step needs.
Views follow renames (platform #814)
From platform #814 a view rename through egret's Iceberg catalog carries the view's grants, rules and catalog grants, as a table rename does, and a hand-written policy that reaches a table or view through a pattern is checked at a rename. There is no migration and no API change.
- A view rename that copies a restriction is held until the engines serve it, at most 90 seconds.
- Behaviour change: a rename is refused with a 409 naming the policy when an enabled hand-written policy with a deny, a mask, a row filter or an exclusion list reaches the old name through a pattern and not the new one (KI-320). Edit or migrate the policy, or choose a name it covers.
- Grants that earlier view renames left on old names are not moved. Write them on the new name, then delete the old ones.
Group delete removes its grants (migration 0212, platform #815)
From platform #815 deleting a local group deletes the grants that name it. Migration 0212 deletes the group grants that earlier deletes left behind (KI-324). They gave nobody access, so nobody's access changes.
Row filters by a column classification on Trino, and the attach notice (platform #818)
From platform #818 there is no migration.
- Behaviour change: on Trino a row filter by classification now filters every table where the classification is only on columns, as StarRocks already did, through one row-filter policy per such table. At start, egret recompiles the Trino profiles this reaches, so a rule written before the upgrade starts filtering those tables without another write (KI-287). People who read every row of such a table on Trino before the upgrade see only the filtered rows after it; Who can read? shows the rule.
- API change:
PUT /api/control-plane/warehouses/{warehouse_id}/resource-tagsanswers{"ok": true, "notices": [...]}. Each notice has acodeand amessage; the one code today isclearance_masks_pending_table(KI-307). See Control plane: catalog. - API change: the rule effect no longer carries
trinoColumnOnly, and explain no longer carriesrow_filter_not_applied.
The attach notice for a view (platform #820)
From platform #820 there is no migration.
- API change:
PUT /api/control-plane/warehouses/{warehouse_id}/resource-tagscan answer a second notice code,clearance_on_view, when a whole-table classification with a clearance is attached to a name that is a view in the catalog on a warehouse a StarRocks engine serves. Before, such an attach answeredclearance_masks_pending_table, whose message promised masks once the table exists; a view never becomes a table. A name the catalog does not have still answersclearance_masks_pending_table. A client that matches oncodeshould handle both. See Tagging. - Behaviour change: the
skippedreason ofPOST /api/control-plane/perm/compile/{service_id}for a whole-table clearance on a view says that it is a view and gets no masks, instead of not protected until the table exists.
Trino metadata tables follow masks, row filters and denies (platform #821)
From platform #821 there is no migration.
- Behaviour change: on Trino, a person a mask, row filter or select deny restricts on a table is now refused
(Access Denied) on every metadata table of that table (
orders$files,orders$partitions,orders$history, …). Before, they could read column bounds, partition values and counts there (KI-341). People the policy exempts or does not restrict read them as before. egret recompiles the affected Trino profiles; the new policies are namedperm-hidden-meta-…. Profiles that egret's permission model does not compile get nothing.
Warning on StarRocks engines (platform #822)
From platform #822 there is no migration and no API change. Every StarRocks engine bound to a policy profile shows a warning that StarRocks serves Iceberg metadata tables without asking Ranger (KI-340): on the Governance engine page, the Control plane engine page and Register external engine.
StarRocks engines default to Egret's patched image (platform #826)
From platform #826 there is no migration and no API change.
- Behaviour change: a new provisioned StarRocks engine runs
ghcr.io/egret-data/egret-starrocks-fe:4.1.7-egret.1for its front end andstarrocks/cn-ubuntu:4.1.7for its compute nodes (both pinned by digest), instead of the official 4.1.6 images. The patched front end fixes KI-340 (Iceberg metadata tables read without a privilege check) and KI-345 (masks and row filters skipped for prepared statements, which Data API endpoints with parameters use). The local development stack'sstarrocksservice runs the patchedegret-starrocks-allin1image. - Existing engines keep their image. Move each StarRocks engine onto the patched image with
PUT /api/control-plane/engines/{id}as described under Egret's patched StarRocks image on Engines and Ranger; its pods restart. From 4.1.4 or 4.1.6 this is an upgrade to 4.1.7. Run an external StarRocks engine on the same image. - The warning about both holes is no longer shown for a provisioned engine on the patched image; it still shows for every other StarRocks engine bound to a profile, and always for an external one.
- The cluster must be able to pull from
ghcr.io/egret-data.
New users get an engine username at creation (platform #823)
From platform #823 there is no migration and no API shape change.
- Behaviour change:
POST /api/control-plane/users,egret create-adminand a first SSO sign-in give the new user an engine username at once; the answer'susernameis no longernull(KI-342). Service accounts are unchanged. - At start: egret gives a username to every existing person who has none. A person whose would-be name a stored grant principal or rule exemption already uses is left without one, and the server logs a warning; allocate theirs by hand from a grant dialog, which answers 409 naming those rows until they are resolved.
StarRocks engines default to egret-starrocks-fe 4.1.7-egret.3 (platform #827)
From platform #827 there is no migration and no API change.
- Behaviour change: a new provisioned StarRocks engine runs
ghcr.io/egret-data/egret-starrocks-fe:4.1.7-egret.3(pinned by digest) instead of4.1.7-egret.1; the compute nodes stay on the officialstarrocks/cn-ubuntu:4.1.7. It also fixes KI-337 (_fileand_posinSELECT *under a row filter), KI-346 (no masks or row filters through the HTTP SQL API and Arrow Flight SQL), KI-347 (FILES()with no privilege), KI-348 (materialized views stored past their creator's masks and row filters) and KI-349 (SHOW CREATE CATALOGwith no privilege). The local development stack'sstarrocksservice runsegret-starrocks-allin1:4.1.7-egret.3. - New refusals on the patched image:
FILES()needs the OPERATE privilege on SYSTEM (error 5211), and creating a materialized view over a table where a mask or row filter applies to the creator is refused (error 5212), whichever columns the view reads; an existing materialized view of such a creator stops refreshing.SHOW CREATE CATALOGneeds a privilege on the catalog. - Existing engines keep their image, including those on
4.1.7-egret.1. Move each one withPUT /api/control-plane/engines/{id}as described under Egret's patched StarRocks image on Engines and Ranger; its pods restart. - The warning now names every hole, and is shown for every StarRocks engine bound to a profile unless it runs
egret-starrocks-fe4.1.7-egret.3or later, so it comes back for an engine on4.1.7-egret.1.
Engines accept connections only from Egret (platform #828)
From platform #828 there is no migration and no API change.
- Behaviour change (Helm chart): the chart renders
NetworkPolicy/egret-engine-isolationinengineNamespace, on by default. Only the engine namespace's own pods, Egret's pods and the StarRocks operator (8030 and 9030) can connect to the engines; workflow task pods, app pods and anything else in the cluster are refused. See Engine network policy. - An engine Ingress needs a value: if an engine is reached through an Ingress, add the ingress controller to
engineNetworkPolicy.ingressFrom(for example- namespaceSelector: { matchLabels: { kubernetes.io/metadata.name: ingress-nginx } }) before upgrading, or that Ingress stops getting traffic. - The operator elsewhere: if the StarRocks operator does not run in
starrocks, setengineNetworkPolicy.operatorNamespaces. - To keep the old behaviour, set
engineNetworkPolicy.enabled=false.
StarRocks engines default to egret-starrocks-fe 4.1.7-egret.4 (platform #832)
From platform #832 there is no migration and no API change.
- Behaviour change: a new provisioned StarRocks engine runs
ghcr.io/egret-data/egret-starrocks-fe:4.1.7-egret.4(pinned by digest) instead of4.1.7-egret.3; the compute nodes stay on the officialstarrocks/cn-ubuntu:4.1.7. It also fixes KI-350 (EXPLAIN COSTSshows the statistics of hidden rows) and KI-351 (loads, exports andSELECT INTO OUTFILEwith the nodes' own cloud identity). The local development stack'sstarrocksservice runsegret-starrocks-allin1:4.1.7-egret.4. - New refusals on the patched image:
EXPLAIN COSTSover a table where a mask or row filter applies to the person is refused (error 5213).BROKER LOAD,EXPORT,SELECT ... INTO OUTFILEandENGINE = filetables need the OPERATE privilege on SYSTEM (error 5214) unless every location is on an object store and the statement carries that store's own keys; HDFS and local paths always need it. Egret itself runs none of these statements. - The image ships StarRocks' AuditLoader plugin at
/opt/egret/auditloader.zip. Nothing installs it yet. - Existing engines keep their image, including those on
4.1.7-egret.3. Move each one withPUT /api/control-plane/engines/{id}as described under Egret's patched StarRocks image on Engines and Ranger; its pods restart. - The warning now also names KI-350 and KI-351, and is shown for every StarRocks engine bound to a profile unless it
runs
egret-starrocks-fe4.1.7-egret.4or later, so it comes back for an engine on4.1.7-egret.3.
Egret's own engine policies are kept in line (governance SP2a)
From platform #836, Egret derives its own policies on each profile from the engines bound to it and the active platform
admins, and brings the stored policies in line at every change and every start. These are the egret-admin - …
policies, plus on Trino egret-user-impersonate-self, egret-user-execute-query, egret-query-timeout and
egret-delegator-impersonate. See Platform admins on the engines.
There is no migration and no API change.
-
Behaviour change: the first start of the new version deletes the policies of these names that are no longer wanted:
egret-delegator-impersonateon a profile whose Trino engine no longer impersonates with a delegator;- all of them on a profile with no delegating engine bound (unbound, deleted, open or external engines);
egret-admin - …policies for a resource hierarchy the profile's service definition no longer has, and allegret-admin - …policies when there is no active platform admin.
Each profile that changes gets one new policy version. A hand-written policy that an operator gave one of these names is treated as Egret's own and is updated or deleted with them.
-
A start that finds nothing to change no longer raises the policy version. Before, every start raised it by 3 on each Trino profile with a delegating engine.
-
The
all - …defaults written byseed-defaultsare not touched. -
If migrating a profile to the permission model is refused (422, not equivalent) because one of these policies differs, recompile the profile first (
POST /api/control-plane/perm/compile/{service_id}) to bring them in line, then migrate again.
Masks on a whole table, schema or catalog take effect (platform #837)
Before platform #837, a mask rule by path that left Column empty compiled without the column level, and Trino and StarRocks applied it to no column. Those columns came back unmasked although the rule was listed as live. From #837 the rule masks every column below its path, as the rule dialog says.
There is no migration. At its first start the new version recompiles each policy profile that still serves such a mask, and the plugins download the new policies once. Later starts skip profiles already repaired.
Before upgrading, run GET /api/control-plane/perm/overlaps (or open each engine's Overlaps tab). It lists every
pair of masks or row filters stored in a profile's download that can decide the same request two ways. Resolve every
pair in which one member is a mask by path with an empty Column: delete one of the two, or narrow one so they no
longer meet. Such a pair has no effect today, because one member masks nothing. After the upgrade, recompiling the
profile would make the pair real, so egret refuses the recompile:
- the profile keeps serving its previous compile, so its whole-table, schema and catalog masks stay inert;
- every write that recompiles the profile is refused with a 409 conflict naming the pair until the pair is resolved. That includes grants, rules, catalog grants, workspace membership and role changes on the profile's catalogs, and any classification (tag) rule write in the installation, which recompiles every profile;
- the server logs the refusal at error level at every start. On the Governance overview, Needs attention lists a Critical finding, The last compile of 1 profile failed; engines keep the previous compile. The refusal names rules A and B., with the profile's line reading Refused at boot: masks with no column stay inert (previous compile served); writes recompiling this profile are refused until these rules are resolved. and links to both rules.
The pair's coordinate on the Overlaps tab does not say which member has an empty Column; open each rule to see. If the recompile fails because of a database error or a lock timeout, the line reads Boot recompile failed: masks with no column stay inert (previous compile served); the next boot retries., and writes are not blocked by it. Any other refusal, such as an expansion ceiling, shows the same line but keeps refusing writes until it is fixed, as it did before the upgrade.
What readers notice after the upgrade:
- columns under a whole-table, schema or catalog mask are masked for everyone the rule does not exempt;
- on Trino, the metadata tables (
$files,$partitions,$snapshots, …) of every table under a schema or catalog mask are denied to the same people; - on StarRocks,
SELECT *on those tables is refused to them (error 5204); - a rule migrated earlier from a hand-written masking policy that named no column now masks; the original never did. Review migrated mask rules with an empty Column.
A mask on a whole catalog does not apply to the catalog's information_schema. The engine's Policies tab lists it
as, for example, wh.!information_schema.*.* (! marks an excluded value). A mask on a whole table lists as
wh.sales.orders.*. A hand-written masking policy that names no column is left as it is and still masks nothing;
migrating it is refused until its missing levels are set (see Migrate policies).
Trino on OPA, preview (platform #838)
Migration 0213 adds mechanism to every policy profile, with the default ranger, and applied_mechanism to every
engine. Nothing changes until [governance.opa] enabled is turned on, which it is not by default (changed in a later release; see below), and a profile is
switched. See Trino on OPA.
- API addition:
ProfileDto.mechanism,PATCH /api/control-plane/policies/services/{service}andGET /api/control-plane/engines/{id}/opa-plugin-config.
Trino on OPA, console and limits (platform #839)
No migration. [governance.opa] enabled stays false by default (changed in a later release; see below). See Trino on OPA.
- Console: the Access control section on a Trino profile's Advanced tab switches between Ranger and OPA; Download Trino config and an external engine's Plugin config tab show the OPA files for a profile on OPA.
- New keys:
[governance.opa] batch_body_limit_bytes(default 24 MiB, 4 to 64 MiB; it was a fixed 4 MiB) andbody_read_timeout_ms(default 5000, 1 to 60000). A value outside its range stops Egret at startup. - API additions:
external_engines_warningon the 200 and 502 answers of the switch,external_engines_unchangedon the 502, andengines_not_reappliedon an explain profile. - Behaviour: an OPA request whose body does not arrive within
body_read_timeout_msis answered 408 and counted in the newegret_opa_unread_total. Restrict/opa/to the engines' network: it is now required.
Workflow outputs: Loop outputs, Loop retry and flow outputs (platform #840)
One migration adds columns for execution and task-run outputs; it only adds columns and applies at boot. There is no backfill: an execution that ended before the upgrade has no outputs. Behaviour change for stored flows: a flow saved earlier can give a different answer, because each change makes egret do what Kestra does. See Flow control and Flow outputs.
| Flow | Before | Now |
|---|---|---|
A Loop with outputs: | Accepted, never evaluated; {{ outputs.loop.outputs }} failed to render | Evaluated at the end of each iteration and collected in outputs.<loop>.outputs |
Any Loop run | No counters | iterationCount, runningIterations and terminatedIterations |
A Loop output that fails to render or convert | Ignored | The iteration gets FAILED; with transmitFailed: true the Loop fails |
fetchType: STORE (or AUTO over a kestra://, file:// or nsfile:// values:) | Ignored | One outputs.ion file per iteration; the list holds {uri} |
A retry: on a Loop or on an ancestor of it | Dropped for the tasks inside each iteration | Inherited by every task and Subflow of each iteration |
A failed flowable task under an ancestor's or the flow's retry: | Its parent stayed RUNNING forever | Its parent ends FAILED (bug fix) |
A flow-level outputs: | Never evaluated | Evaluated when the execution ends; a failure ends it FAILED |
{{ execution.outputs }} and a Subflow parent's outputs.<id>.outputs | Always {} | The evaluated outputs; a child whose declared outputs were not stored fails the Subflow run |
{{ trigger.outputs }} in a Flow trigger's inputs: | Failed (trigger unknown) | The triggering execution's outputs |
GET of one execution | No outputs | An outputs field (SECRET values are ******); the list does not carry it |
A parent reading its Subflow child's FILE output with read() | Refused | Allowed, for the files the child published |
Limits that exist in Egret only (Kestra has none):
- One
Loopiteration's outputs may serialise to at most 1 MiB and aLoop's whole list to 16 MiB; a flow's outputs to 16 MiB per execution. Beyond a limit the iteration or execution fails with a message that points tofetchType: STOREor to aFILEoutput. - A
type: FILEoutput must name a file of the execution itself or of itsLoopfamily; anything else is refused withegret refuses output <id>: <uri> is not a file of this execution. A parent cannot re-publish itsSubflowchild's file. - A
SECREToutput withfetchType: STOREis refused, when you save and when it runs. OtherSECREToutputs are sealed withsecrets.master_keyand shown as******; without a master key the output fails and names the setting. - Duplicate output ids inside a
Loop'soutputs:are refused when you save (duplicate_output_id), andsecret()is refused in an output'svalue:. - A
dependsOnFlow trigger does not fire on an event whose mergedtrigger.outputswould pass 16 MiB; the log names the sizes and the window is kept.
Known differences from Kestra: the parent flow's outputs: are not evaluated inside each Loop iteration; a STORE file is
named outputs.ion and nextOffset is not written; a Subflow child that ended before it ran and declares only literal outputs
fails the Subflow run; a retry: with behavior: CREATE_NEW_EXECUTION that reaches a task inside a Loop is refused when it
runs. A SECRET value that an author renders into a Subflow's inputs: or a STRING flow output is stored in clear and
returned by the API; keep SECRET values in SECRET outputs and inputs.
Rolling back
There is no supported in-place rollback. Restore the database from the backup taken in step 2, then start the previous binary. Object storage is not changed by migrations, but files written by the newer version stay in the bucket.
Trino engines authenticate and refuse plain-HTTP identity
From platform #842 every provisioned Trino engine authenticates, and its coordinator refuses authentication over plain HTTP
(http-server.authentication.allow-insecure-over-http=false). There is a migration (0215, one column that records which
security revision an engine was last applied with) and one API field, securityReapplyNeeded.
The new settings take effect when an engine is next applied (re-apply, or any change that applies it). Until then it keeps the configuration of its last apply.
- Re-apply every provisioned Trino engine after the upgrade. In Control plane → Engines the engines that still need it show a Re-apply needed badge; the badge clears after the next successful apply. An engine with JWT only and no password users never shows it.
- Direct plain-HTTP clients stop working once an engine is re-applied:
trino --server http://<engine>:8080 --user xwith no password gets 403 Authentication over HTTP is not enabled. Point such clients at the engine's ingress, or at HTTPS on port 8443 where the engine serves it (delegation-capable engines), with a password or a JWT. An engine with neither has no direct client path, only Egret's own. /v1/infostays open. Egret's monitor sendsX-Forwarded-Proto: httpswith a credential; delegated queries use HTTPS on port 8443. The ingress sends the header too (simulated with a hand-set header; not measured against a real ingress controller).- External engines are not changed by Egret.
See Security & Exposure and KI-355 in Known issues.
The OPA surface moves to its own port (platform #843)
Egret's OPA routes (/opa/) leave the API port 8080 and are served on their own listener, [governance.opa] listen, 8082 by
default. Port 8080 now answers 404 for /opa/; /ranger/, /oauth/token and the Iceberg REST catalog stay there. There is a
migration (0216, one column, applied_opa_url, that records the OPA URL each engine was last applied with). Nothing changes
while [governance.opa] enabled is false. See Trino on OPA.
- New keys:
[governance.opa] listenandengine_url, checked only while[governance.opa] enabledistrue. Egret then refuses to start whenlistenhas the port ofserver.portor, withapps.originset, of the apps listener, or whenengine_urlis set but is not an absolutehttp(s)URL with a host. Whenengine_urlis unset, engines get[catalog] public_urlwith the port oflisten; ifpublic_urlis an ingress hostname rather than Egret's in-cluster address, setengine_url. - Provisioned engines re-apply themselves. At start, with OPA enabled, Egret re-applies each provisioned Trino engine on an OPA profile whose recorded OPA URL differs from the current one, including engines applied before the upgrade. A failure is logged per engine as a warning and does not stop the server; apply that engine again with any change that applies it. The pass runs in the background after the new Egret starts serving, and each re-applied coordinator restarts.
- Queries on provisioned OPA engines fail during the upgrade. From the moment the new Egret serves until an engine has been
re-applied and its coordinator has restarted, that engine still asks port 8080 for
/opa/, which now answers 404, so its queries are refused. During a rolling update, old and new Egret pods serve side by side: an engine already re-applied to the OPA port is also refused whenever its request reaches an old pod, which has no OPA listener. On Docker the window includes the Egret container recreate. How long this lasts depends on the number of engines and on how fast each coordinator restarts. Upgrade in a maintenance window, or when the query load on OPA engines is low. Engines on the Ranger mechanism are not affected. - External engines re-install their files. Download the OPA plugin files again (Control plane → Engines → <engine> → Plugin
config, or
GET /api/control-plane/engines/{id}/opa-plugin-config, which now returns the OPA port's URL), install them and restart the coordinator. From the upgrade until then the engine asks port 8080 and fails every query. - Firewalls: allow the OPA port (8082 by default) from the engines to Egret. Anything between them that only allowed 8080 blocks OPA.
- Helm: new values
opa.enabled(defaultfalse),opa.port(8082) andopa.extraFrom, and a newNetworkPolicy/egret-ingress, rendered whenengineNetworkPolicy.enabled, that admits the OPA port only fromengineNamespaceandopa.extraFrom. WithengineNetworkPolicy.enabled,egret-ingressadmits only 8080, 8081 (apps) and the OPA port to the backend pod: anything that reached another port on it is now refused. Add the namespace of an external Trino on OPA toopa.extraFrom. See Kubernetes.
OPA is on by default
[governance.opa] enabled now defaults to true, and so does the Helm value opa.enabled. Profiles stay on Ranger until an operator
switches them, so the change alone moves no enforcement. What changes is that, where ranger.enabled is on (it is off by default), Egret now binds the OPA listener, port 8082 by
default, and mounts the OPA surface with no configuration change, so a profile can be switched to OPA without touching configuration first. With ranger.enabled off, nothing binds 8082 and a switch to OPA is refused. See
Trino on OPA.
- Turning it off:
[governance.opa] enabled = false,EGRET_GOVERNANCE__OPA__ENABLED=false, or Helmopa.enabled=false. The chart sets the variable fromopa.enabled. Switch any profile on OPA back to Ranger first: with the key off, its engines fail every query. - Installs outside Helm with
ranger.enabledon can fail to start after the upgrade, with no config change. Egret now validates and binds[governance.opa] listen(default0.0.0.0:8082) and runs the 1 s snapshot refresher. Start-up stops, naming the key, when: port 8082 is already taken on the host;server.portorapps.listen(withapps.originset) is 8082; a leftover malformed[governance.opa] listenorengine_url, ignored while OPA was off, is now checked; or the OPA engine URL cannot be derived fromcatalog.public_url. Fix it by setting[governance.opa] listenandengine_url, orenabled = false. Helm installs are not affected, because the chart sets the listen value. - Network: the chart's
NetworkPolicy/egret-ingress(withengineNetworkPolicy.enabled) admits the OPA port only fromengineNamespaceandopa.extraFrom. Outside Kubernetes, keep port 8082 reachable from the engines only. - Tag-service warning: a Trino profile with no usable tag service now carries
no_tag_service_warningon thePATCH …/mechanismanswer and on each explain profile, and the console shows it. See Trino on OPA. - Known issues on OPA engines: KI-352 in Known limitations (KI-353 and KI-354 are fixed, see Known issues).
StarRocks engine posture (platform #847)
Nothing changes on its own when you upgrade: no migration rewrites an engine's image or sets a password, because the FE restarts. Migration 0217 adds one flag, which records a security upgrade that was stored but not applied.
- After the upgrade, open Control Plane → Infrastructure → Engines and look for Security upgrade needed. An engine created before platform #826 and #832 can still run an official StarRocks FE or an egret image before
4.1.7-egret.4, or have a passwordless FEroot. Open each one and press Upgrade security (orPOST /api/control-plane/engines/{id}/security-upgrade) in a quiet window: the FE and CN pods restart. A client outside egret that logs in asrootwith no password is refused afterwards. See Engine detail. - Look for Not governed too: with Ranger on, a StarRocks engine with no policy profile enforces none of egret's policies. Bind a profile in its settings.
- API change: the engine adds
notGoverned,securityUpgradeNeeded,securityUpgradeReasons,securityUpgradeFeImageandsecurityUpgradeBlockedRelease, and a new routePOST /api/control-plane/engines/{id}/security-upgrade. See Engines API.
StarRocks Query log (migration 0218)
A provisioned StarRocks engine gets a Query log tab. Migration 0218 adds the column that holds the loader user's secret, reserves the user name egret_query_log so no person can be given it, and adds the permission engine:audit.
- Existing engines set themselves up. When egret starts, it sets the Query log up once on every reachable provisioned StarRocks engine. It creates the audit database and table, the loader user and, on an engine whose image ships it, installs the plugin; the engine does not restart. Nothing runs on an engine that is not reachable at that moment: open its Query log tab and press Set up query log (
engine:update), orPOST /api/control-plane/engines/{id}/query-log/setup. - Engines on an image before
4.1.7-egret.4need Upgrade security first. Only that image ships the audit plugin. Such an engine showspluginNotShippedon the tab. Press Upgrade security (see the posture note above); the set-up then runs again by itself, and the Query log starts after the FE and CN pods are back. - Events from before the plugin's first refresh are not recorded. StarRocks hands events to the plugin about a minute after it is installed, so a new Query log starts a minute or two after the set-up.
- Who can read statements changes.
engine:auditis granted to every platform role that holdsengine:update. Roles that only holdengine:readsee the tab without the statement and error text. Grantengine:auditto other roles under Control Plane → Roles if they need it. - Direct SQL on the audit database is refused to everyone, engine admins included, on an engine bound to a Ranger profile. Egret adds the guard rows to the profile on its own; they cannot be edited.
plugin_enableandplugin_dirare refused infeConfig. An engine whosefeConfigalready overrides either key gets a 400 on its next update until you remove those keys.- API change: four routes under
/api/control-plane/engines/{id}/query-log. See Engines API. - Retention is 30 days, and there is no export and no rotation of the loader password.
StarRocks impersonation, CN password and engine delete (platform #850)
-
StarRocks engines in impersonation mode start working under Ranger. On upgrade, egret writes
egret-delegator-impersonateto their profile and creates a StarRocks user for each member of each workspace the engine serves, within seconds of start. Users made by hand for earlier tests (for example a passwordlessmember-sso) are not egret's: they are left as they are and a warning names them. Drop them asrootto let egret create its own; see Handing over a user egret did not create. -
Passworded StarRocks engines roll their FE and CN once on their next apply, because
MYSQL_PWDis now set on both. A CN that crash-loops today (KI-335) recovers then. An engine without a persistent front-end metadata volume loses its FE metadata on that roll, as on any roll. -
Engine delete now removes the FE metadata volume. The FE metadata of a deleted engine is gone; the table data stays in object storage.
-
Claims left by earlier deletes are not removed by the upgrade. List them, and delete those whose engine no longer exists before re-creating an engine of the same name:
kubectl get pvc -n egret-engines | grep '^fe-meta-' -
A user named
rootcannot be minted any more (the new user getsroot-2). One who already holds it keeps it and is not synced to StarRocks. -
Platform admins get a StarRocks user on every impersonation-mode engine assigned to a workspace.
-
Engines bound to no profile lose
GRANT IMPERSONATE ON ALL USERS. On their next apply or sweep (at most ten minutes after the upgrade) the delegator gets per-user grants for egret's users instead, and can no longer becomeroot. -
Orphan IMPERSONATE grants on users dropped before the upgrade stay. See the manual cleanup under StarRocks users for impersonation (KI-358).
-
Creating a StarRocks engine whose name left a metadata claim answers 409
engine_metadata_left_overwith thekubectlcommand that removes it.