Workspace storage: no guard against mismatched S3/filesystem backend across frontends
What
#13012 ("feat(workspace): use filesystem storage without S3") added an automatic fallback: use S3 if configured, else fall back to a plain filesystem directory, coordinated through Postgres/GORM revision locking. The PR's own description flags the risk it leaves open:
"Equal path strings do not prove shared storage; this is an operator responsibility." "This PR does not copy or migrate existing data. A backend change on populated metadata still requires a separate copy/verification procedure."
The risk
Nothing at runtime verifies that every frontend sharing one metadata database is actually pointed at the same blob storage. Two concrete failure modes:
- Multi-frontend split-brain: one frontend has S3 configured, a sibling frontend (sharing the same Postgres metadata) doesn't and falls back to local filesystem. Both believe they're serving the same workspace; files silently diverge per-frontend with no error.
- Silent backend-change data loss: an operator switches a populated instance from S3 to filesystem (or back) without a migration step. Existing files become orphaned/invisible with no warning at startup.
The relevant code path is core/application/studio_files.go (around where strict/fallback mode is computed, roughly lines 54-100).
The multi-frontend over the in-process bus test — the one test that would plausibly catch the split-brain scenario — was red/cancelled on the final pre-merge CI run (4111bf2d6), and wasn't re-verified green afterward as far as I can tell.
Ask
- Add a stored backend-identity fingerprint (e.g. a marker written to the shared metadata store recording which backend + path each frontend believes it's using) and check it at startup, failing loudly on mismatch instead of silently diverging.
- At minimum, document the operator responsibility prominently (startup log warning, docs) rather than leaving it only in the PR description.
- Re-run
multi-frontend over the in-process busclean and confirm it actually exercises the S3-vs-fallback mismatch case; strengthen it if it doesn't.
References
- #13012