fix(datastore): keep a peer's deletions deleted across pull and push (swamp-club #2999) #463
Loading…
Reference in a new issue
No description provided.
Delete branch "2999"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes swamp-club #2999.
Problem
After one peer ran
swamp data gcagainst a shared S3 datastore, a second peer (swamp servein the report) pulled but kept the GC'd files in its local cache. A pull only walked the remote index, so a file whose entry a peer had deleted stayed cached with no index entry. The next push walk saw it as new, uploaded it again and merged its entry back into the shard, which undid the GC. GCS has the same code and the same bug.Fix (S3 and GCS, identical shape)
Before a pull, push or preparePush replaces the index, it reads the last-synced
.datastore-index.jsonfrom disk. After an authoritative remote read, it removes each local file whose entry was in that index but is gone from the remote one, along with any directories that leaves empty.Testing
mainexcept the four safety tests. The safety tests cover: changed files are kept, missing objects keep their copy, a missing or empty remote index removes nothing, and a peer emptying a whole model's shard still removes its files. Full suites: S3 409/409, GCS 360/360.swamp extension source add, against MinIO (versioned) and fake-gcs-server,mainvs this branch:maindata gc, B pulls, then runs a model and pushesswamp servewith a workflow scheduled every minute (the report)Limits and residual risk
swamp data gconce on each affected peer. Both READMEs say this.Both manifests are bumped to
2026.10.06.1.🤖 Generated with Claude Code