carlos / platform Public

minio: a take's copy needs version pinning, not create-only

MinIO does not enforce If-None-Match: * on a CopyObject destination, so
TestGenerationTakeMinio's second-copy assertion failed on its first real
run. Nothing relies on it: g-N is written only by the holder of lock
generation N, the lock's compare-and-swap makes that holder unique, and
an abandoned take's g-N is never named and is retired. The test now
records whether the provider honoured the condition and still requires
that the copy reads the exact source version, lands at its key in g-N,
and that a second copy leaves g-N's bytes unchanged. The spec's rev 5
note says copies into g-N do not depend on a destination condition.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 930aad58c88772825df1fbd4e154e845b4aeef85 parent e154ce9
2 files changed, +15 −5
  • docs/superpowers/specs/2026-11-12-region-ha-storage-generations-design.md +1 −0
  • internal/lease/gentake_minio_test.go +14 −5

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/specs/2026-11-12-region-ha-storage-generations-design.md b/docs/superpowers/specs/2026-11-12-region-ha-storage-generations-design.md
index 1a86b7ec9..e410d9b34 100644
--- a/docs/superpowers/specs/2026-11-12-region-ha-storage-generations-design.md
+++ b/docs/superpowers/specs/2026-11-12-region-ha-storage-generations-design.md
@@ -33,6 +33,7 @@ Sources: the wake-race review (`~/.cache/ha-flakes/wake-race/FINDINGS.md`, Astra
- **The keep rule applies only when head.json names the marker holder's generation** (build ruling, Task 14 R1) (§4 step 5).
- **Moves of a generations host stay refused**; the follow-up is discussion #1253 (§6.3).
- **The switch value `fast` gates §5.3**; `on` takes generations with today's acquire table (build plan, Task 10) (§5.3).
+- **Copies into g-N do not depend on the store enforcing a destination condition** (MinIO does not honour `If-None-Match: *` on CopyObject; the lock's compare-and-swap makes g-N's writer unique, and the copy relies only on version pinning) (controller ruling, 2026-11-19) (§4).
## 1. The problem, and what this retires
diff --git a/internal/lease/gentake_minio_test.go b/internal/lease/gentake_minio_test.go
index 731971af7..3f78e765b 100644
--- a/internal/lease/gentake_minio_test.go
+++ b/internal/lease/gentake_minio_test.go
@@ -297,15 +297,24 @@ func (m minioGen) take(t *testing.T) {
t.Errorf("B's copy %+v: want %s...?versionId=<id> -> %s..., If-None-Match *, 200", c, aPrefix, bPrefix)
}
}
- // If-None-Match: * on the destination is MinIO's: a second copy of the
- // same version onto it is refused (412), and nothing changes.
+ // The destination condition (If-None-Match: * on a CopyObject) is
+ // recorded, not required: MinIO does not enforce it. Nothing relies on
+ // it. g-N is written only by the holder of lock generation N, the lock's
+ // compare-and-swap makes that holder unique, and an abandoned take's g-N
+ // is never named by head.json and is retired. What a take does rely on
+ // is version pinning: each copy reads the exact source version (checked
+ // above and in the restore below) and lands at its own key in g-N. A
+ // second copy of the same version, honoured or not, leaves the same
+ // bytes there.
src, ver := parseCopySource(t, fx.bucket, cs[0].source)
before := currentBodies(t, fx, bPrefix)
- if _, _, err := fx.vs.CopyVersion(ctx, fx.bucket, src, ver, fx.bucket, cs[0].dst, true); !errors.Is(err, lease.ErrDestinationExists) {
- t.Fatalf("a second create-only copy onto %s: %v, want ErrDestinationExists (MinIO's 412)", cs[0].dst, err)
+ _, _, err = fx.vs.CopyVersion(ctx, fx.bucket, src, ver, fx.bucket, cs[0].dst, true)
+ t.Logf("a second create-only copy onto %s: %v (destination condition honoured: %v)", cs[0].dst, err, errors.Is(err, lease.ErrDestinationExists))
+ if err != nil && !errors.Is(err, lease.ErrDestinationExists) {
+ t.Fatalf("a second create-only copy onto %s: %v", cs[0].dst, err)
}
if after := currentBodies(t, fx, bPrefix); !mapsEqualBytes(before, after) {
- t.Fatal("the refused copy changed B's generation")
+ t.Fatal("a second copy of the same version changed B's generation's bytes")
}
bPath := filepath.Join(t.TempDir(), "w.example.com.db")