Repository navigation
Description
spawn stage advertises a specific cost saving for a data-staging mechanism that
has no consumer, and whose upload cannot succeed in the first place. Three
independent confirmations below, all verified in the tree.
What it promises
cmd/stage.go:32-36, also published as docs-gen/stage.md:
Data staging enables cost-optimized data movement by:
- Replicating data once to regional buckets
- Allowing instances to download from local region (free)
- Avoiding repeated cross-region transfers ($0.09/GB)
Cost savings example: … Savings: $85.70 (93% reduction)
The bolded line is the half that does not exist.
1. Nothing reads the staged data
Every reference to the bucket family in the repo:
cmd/stage.go:169 primaryBucket := fmt.Sprintf("spawn-data-%s", primaryRegion) # write
cmd/stage.go:218 fmt.Fprintf(... "s3://spawn-data-%s/%s" ...) # echoes the URL
pkg/staging/staging.go:61 bucket := fmt.Sprintf("spawn-data-%s", primaryRegion) # write
pkg/staging/staging.go:104 destBucket := fmt.Sprintf("spawn-data-%s", destRegion) # cross-region copy
Two writes and a printf. And nothing consumes the key prefix it writes under:
$ grep -rn '"staging/' --include='*.go' . | grep -v 'pkg/staging\|_test'
(no output)
There is no launch flag, no bootstrap line, and no sweep-orchestrator path that
downloads staging/<id>/… onto an instance. The consumer would have to be
instance bootstrap, which this repo owns entirely — so this is no reader
anywhere, not merely none in this repo.
2. The bucket is never created, so the upload fails
UploadToPrimaryRegion (pkg/staging/staging.go:59-61) formats the bucket name
and goes straight to uploader.Upload. It never calls HeadBucket or
CreateBucket.
Compare its sibling in the same file: resolveSchedulesBucket
(staging.go:273-283) routes through ensureBucket (:287), which does
HeadBucket and creates on absence. The staging path has no equivalent.
Nothing else creates one either — no .sh, .yaml or Makefile references
spawn-data at all, and the 21 buckets measured in docs/infra-account.md
include no spawn-data-*.
So the first spawn stage upload in any account fails NoSuchBucket. Which also
means this has never run successfully — consistent with there being no
consumer to notice.
3. The metadata table is wired only to itself
spawn-staged-data is written at staging.go:152 and read at :165/:219/:260 —
but every read is spawn stage list / delete reading its own bookkeeping
(cmd/stage.go:250,344,363).
The two fields that exist to connect staged data to a workload — sweep_id
(:146) and destination (:149) — are written, unmarshalled at :208,211,
and then only printed. No sweep, launch or orchestrator code reads either. So
the table is a ledger of a transfer nothing consumes.
Nothing creates that table either: no CFN resource, no create-table in any
script, and the only two Go CreateTable calls are in pkg/registry and
pkg/autoscaler.
The decision
This is the #783 shape — the question is whether to finish it or withdraw it, and
the evidence says it was never finished rather than superseded.
- Finish it: create the buckets (reuse
ensureBucket), add the download
half to instance bootstrap, and have launch/sweep consultsweep_idso staged
data actually reaches a workload. - Withdraw it: remove
spawn stage,pkg/staging's staging half, and the
table. Notepkg/stagingmust not be removed wholesale — its
UploadScheduleParams/resolveSchedulesBucket/ensureBucketare live on
the schedules path (see Write side resolves an S3 location, read side guesses it: scheduled params and queue results can read the wrong bucket (or none) #804).
Either way the published cost claim should not survive in its current form: a
93% saving attributed to a mechanism that cannot run is the most load-bearing
sentence in the command's help text.
Activity
Withdraw spawn stage (#854)