Skip to main content
← Back to list
01Issue
BugOpenSwamp CLIPublicTeam
AssigneesNone

Relationships

#1729 localHasAllRemoteEntries() permanently blocks sidecar update on partial caches

Opened by magistr · 8/19/2026

Summary

When using shard-first (v2) index, the push no-writeback path gates writing commitSeq to the sidecar on localHasAllRemoteEntries() (s3_cache_sync.ts:2358-2372). This method stats all index entries against the local cache and returns false if any file is missing or has a different size.

In a multi-writer setup (e.g. swamp serve on Unraid pushes data that a Mac workstation hasn't fully hydrated), this check always returns false. Result: commitSeq is never written to the sidecar, and the fast-path short-circuit is permanently dead.

Impact

Every CLI command takes the full slow path (~4.5s baseline instead of <1s). Measured on a repo with 129k index entries / 50MB index file.

Reproduction

  1. Set up S3 datastore with shard-first index (v2)
  2. Run workflows from swamp serve — they push data to S3
  3. On a different machine (Mac workstation), run any command
  4. Observe .datastore-sync-state.json never gets commitSeq populated
  5. Every command takes ~4-4.5s instead of fast-path ~1s

Suggested fix

For the push no-writeback path (pushed == 0 && deleted == 0), record commitSeq in the sidecar without the localHasAllRemoteEntries() gate. The push path's job is "did I push everything dirty?" — not "does my cache have everything the remote has". Cache completeness is the pull path's responsibility.

The localHasAllRemoteEntries() check should only gate marking the pull sidecar as clean (preventing the pull fast-path from skipping unfetched files).

References

  • s3_cache_sync.ts:2358-2372 (v2 no-writeback branch)
  • s3_cache_sync.ts:2309-2317 (v2 writeback branch — same gate)
  • s3_cache_sync.ts:2967-2984 (localHasAllRemoteEntries impl)

Upstream repository: https://github.com/systeminit/swamp-extensions

Environment

  • Extension: @swamp/s3-datastore@2026.08.12.1
  • swamp: 20260819.011806.0-sha.a9c7ee9a
  • OS: darwin (x86_64)
  • Deno: 2.8.3
  • Shell: /bin/zsh
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

8/19/2026, 5:24:50 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.