You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8d914dd
Browse filesBrowse the repository at this point in the historyBrowse files
bundle: read remote state files in one request instead of two (#7075)
## Changes
`stateFiler.Read` no longer calls `/api/2.0/workspace/get-status` before
`/api/2.0/workspace/export`. A 404 from export is mapped to
`fs.ErrNotExist`, which state pull already treats as "no state yet".
## Why
Every remote read of `resources.json`, `terraform.tfstate` and
`deployment.json` cost two sequential round trips. With deployment
history this sits on the critical path: the `resources.json` read
decides whether the CLI looks up `resources.deployment.json` and calls
GetDeployment.
The stat was never needed for state files; it came along with the code
it was copied from:
- #449 added it to the generic
workspace filer's `Read` when that switched to `/workspace/export`,
because non-direct export returns a directory as a DBC archive instead
of failing. It also replaced the explicit 404 mapping.
- #514 moved that filer to direct
download and kept the stat. The same week,
#515 removed the equivalent stat
from the DBFS filer and relied on SDK errors instead
(#450). The workspace filer was
never revisited.
- #2423 introduced `stateFiler` to
read state over `GET /workspace-files` (no 10 MB cap) and copied the
stat and directory guard as-is, with no stated reason.
- #6219 moved it to
`/workspace/export?direct_download=true` for scoped tokens. The stat
stayed; review focused on headers and goldens.
A directory at a state path is not a state file; its export now fails
with `parsing state` instead of `not a file`. `retry.Filer` only retries
overwrite writes (#7014), so the
stat was never retried and no retry coverage is lost.
## Tests
Acceptance goldens updated. `resources/jobs/request-summary` (from
#7077) shows the full per-command
request list: every `get-status` before a state file is gone; for files
that do not exist yet, a 404 `export` replaces it. Other goldens
(`user_agent`, `state`) change the same way. Not yet checked on a real
workspace: export's response for a missing path and for a directory.
This pull request and its description were written by Isaac.
Co-authored-by: Isaac <no-reply@databricks.com>
0 commit comments