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

Relationships

#3010 s3-datastore/serve: readResource without a version returns an older version; the latest marker is rewritten backwards

Opened by randybias · 10/5/2026

Summary

On swamp serve with @swamp/s3-datastore (Ceph RGW), a model method's context.readResource("<name>") with no version returned an older version (v16) while a newer version (v17) already existed. The latest marker in serve's datastore cache appears to be rewritten backwards between writes. The method then works from stale state and no error is raised.

Versions

  • swamp CLI, serve and worker: 20261003.192630.0-sha.bed0772a
  • @swamp/s3-datastore 2026.10.01.1, Ceph RGW 19.2.x
  • serve: --remote-only, one worker; the method runs on the worker and reads data through serve

Evidence (measured 2026-10-05)

A scheduled workflow runs every 6 h. Each run reads the previous run-lab record (no version) and writes a new version with previousRunId set to the run id it read.

swamp data get <model> run-lab --version N --server ...:

  • v16: runId 6cd492b7, previousRunId 1d20e165 (written 2026-10-04 12:41Z)
  • v17: runId 8e556842, previousRunId 6cd492b7 (written 2026-10-04 18:41Z)
  • v18: runId cb843bbe, previousRunId 6cd492b7 (written 2026-10-05 00:49Z)

v18 should name 8e556842: v17 existed 6 h before the read. The read at about 00:49Z returned v16.

Serve's cache directory for the record holds version directories 5-9 and a latest file. latest reads 18 with mtime 00:49:39Z, the time of the v18 write. So the file is correct right after a write; the read before it was not.

On 20260929.002922.0 we measured the same thing directly: a latest file said 10 while v12 existed, with an mtime 29 s AFTER v12 was written. That points to a datastore sync that writes an older latest back over a newer one.

Expected

readResource(name) with no version returns the highest version, or the call fails. It never returns an older version without warning.

Impact

Any method that diffs against its previous record silently uses old state. In our case changes are reported twice. A method that decides an action from its previous record can act on stale state.

Workaround

Read latest, then probe version+1, +2, ... until none answers, and use the highest.

02Bog Flow
◉OPEN○TRIAGED○IN PROGRESS○SHIPPED

Open

10/5/2026, 12:58:56 AM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.