Description
Task Summary
Part of #6870. Add one on/off switch that hides the entire warehouse feature until it is fully
built. It defaults off, so merging these PRs changes nothing for users.
- The switch — a new config key
storage.warehouse.enabledinstorage.conf(default
false, overridable via theSTORAGE_WAREHOUSE_ENABLEDenv var). - Derived gate —
StorageConfig.warehousesEnabled = storage.warehouse.enabled && icebergCatalogType == "rest";
it is on only when the switch is on and the deployment uses the Lakekeeper (REST) catalog,
since per-user warehouses need it.
On its own this changes nothing; the later PRs check warehousesEnabled to decide whether to show
the UI, accept the API calls, and route a run to a chosen warehouse.
What "off" means, and how it must fail. Turning the switch off disables the feature as a whole,
reads included: results already written into a per-user warehouse become temporarily inaccessible.
That is deliberate — the switch is a kill switch, and an operator flipping it during an incident
does not want compute still reaching into user warehouses. No data is lost; it lives in the user's
own bucket and re-enabling the switch restores access.
What matters is how those reads fail. DocumentFactory.warehouseOf currently resolves an absent or
unparseable warehouse to the deployment's shared warehouse, so gating the read path naively would
route a /wh/<name>/… URI there and surface table not found — indistinguishable from data loss or
a broken deployment. It must instead fail explicitly, naming the situation, e.g. "this result is
stored in warehouse user-7-mybucket; per-user warehouses are disabled in this deployment."
The same applies with the switch on: a URI whose warehouse cannot be resolved should fail rather
than silently fall back to the shared warehouse. WorkflowService already refuses to start an
execution without a resolved warehouse ("never fall back to a system default silently"); the read
path should hold the same line.
Task Type
- Other (feature implementation)
Activity
feat(storage): add storage.warehouse.enabled feature flag (default of…
feat(storage): warehouse REST API, Lakekeeper client, and per-executi…
test(amber): cover exportOperatorsAsZip and the remaining ResultExpor…
feat: require a warehouse for every execution while the feature is en…