Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublicTeam
Assigneesstack72

Relationships

#1877 commitSeq fast path disarms on every run and cannot re-arm if any index entry is unhydrated

Opened by sbahra · 8/27/2026· Shipped 8/27/2026

The commitSeq zero-diff fast path disarms on the first local write of every run and, once a single index entry is missing from the local cache, can never re-arm. Two independent causes compound; either alone would be survivable.

Observed on a repo with ~16k index entries after migrating to shard-first with swamp datastore migrate-index.

1. buildV2State drops commitSeq

buildV2State (s3_cache_sync.ts:1078) rebuilds the sidecar and explicitly carries forward remoteIndexETag, lastVerifiedAt, lastCatalogHash and dataKeyMigrated — but not commitSeq. markDirty (:1104) calls it on the first local write of any run, so the field is silently discarded there and then.

tryCommitSeqFastPath (:1209) bails on commitSeq === undefined, so from that moment the run is on the slow path.

2. The only restore is gated on full local hydration

commitSeq is written back into the sidecar in four places (:2333, :2384, :2756, :2918), and the push-writeback path guards it with await this.localHasAllRemoteEntries() (:2985). That predicate stats every non-internal index entry and returns false on the first one missing locally.

So the sidecar can only re-arm at the end of a push, and only if the local cache is a complete superset of the index. One un-hydrated object anywhere disables the fast path indefinitely — not for one run, but until someone notices and pulls.

Observed sequence

after `swamp data gc`          commitSeq: 3     localDirty: false   armed
after two workflow runs        commitSeq: null  localDirty: true    disarmed
  -> 4 entries in the index absent locally (v105 of two
     report-swamp-workflow-summary instances)
  -> localHasAllRemoteEntries() = false, so no writeback restored it
`swamp datastore sync --pull`  pulled 5 files, 0 entries now missing
`swamp datastore sync --push`  commitSeq: 8     localDirty: false   armed

Nothing in the product surfaces this. swamp datastore status reports healthy throughout, and the only symptom is that every command silently pays the slow path — the index read plus a full stat walk of the cache — which is exactly what shard-first indexing and the commitSeq fast path exist to avoid.

Suggested fixes

  • Carry commitSeq through buildV2State alongside the other preserved fields. Losing it on a dirty-marking write looks like an omission rather than intent: the value describes remote state, and marking the local cache dirty says nothing about the remote.
  • Reconsider the hydration gate, or make its failure visible. A repo using lazy hydration, or one where any object was written by another writer and not yet pulled, is permanently excluded from the fast path with no warning. At minimum a debug line naming the first missing entry would turn an invisible never-arms into a one-command fix.

Related: #1874 (migrate-index aborting on prefixes partitionKeyFromPath does not cover).

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

Environment

  • Extension: @swamp/s3-datastore@2026.08.26.1
  • swamp: 20260720.234931.0-sha.4770b0fd
  • OS: linux (x86_64)
  • Deno: 2.8.3
  • Shell: /bin/bash
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 4 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

8/27/2026, 8:08:07 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack728/27/2026, 7:01:37 PM

Sign in to post a ripple.