Skip to content

internal/coord's CAS lease has zero importers: decide what holds a lease, or say in the doc that nothing does #569

Open

Description

@scttfrdmn

The observation

internal/coord — the CAS lease adopted as this project's coordination direction on 2026-08-03 — has
zero importers:

$ grep -rln 'objectfs/internal/coord' --include='*.go' .
$ grep -rn 'coord\.New' --include='*.go' .
$ echo $?
1

The package is complete and unusually careful. coord.New, Lease.Acquire/Renew/Release, Lease.Do
and the Guard whose every method re-asserts the CAS all exist; the package doc is one of the best in
the tree, stating the liveness limitation plainly ("a lease is a timeout, not a guarantee"), the reason
no absolute clock is trusted, and why a renewal writes a fresh nonce. It is tested — lease_test.go
constructs it eleven times — and it has a fuzz target. go test ./internal/coord/ passes.

Nothing in a mount can reach any of it.

Why this is not simply a bug

#283 delivered the lease as a primitive, and none of its nine acceptance criteria asked for a
production caller — correctly, because the criteria were about the primitive's own guarantees. #284
replaced executeStrongConsistency's fan-out, and internal/distributed/coordinator.go:688 now calls
backend.PutObjectIf directly, without a lease. So the CAS series landed exactly what it said it
would, and left a correct primitive with no consumer. That is a planning gap, not a defect in the code.

But it is the planning gap worth naming, because this repository has just paid for the same shape
twice. The v0.17.0 read-only mount was thirteen complete EROFS gates, a wired MountOptions field,
and a yaml:"read_only" tag that had never decoded a byte — a full implementation with no path to it,
which passed every presence check for six releases. internal/fuse/platform.go records a predecessor
of the same bug in the past tense. An unreferenced package is that shape at package granularity, and
the thing that makes it expensive is that it looks finished from every angle except use.

The question this issue is actually asking

What should hold a lease? The answer decides whether this package is load-bearing or dead code,
and both outcomes are fine — but leaving it undecided is what costs something, because the package
accrues maintenance (it already took a fix in #390) while protecting nothing.

Candidates worth evaluating, not a plan:

  • Nothing. A single-writer mount needs no mutual exclusion, and README states plainly that there is
    no concurrent-writer safety. If that is the intended posture, say so in the package doc and keep
    coord as the primitive a future feature builds on — deliberately, in writing.
  • The write path, to close the "two nodes writing the same object produce one winner and no error"
    gap README documents. This is the one that would change a stated integrity limitation, which makes it
    the interesting candidate and also the largest.
  • Directory rename, whose partial-move resumability already implies someone must not race someone
    else through the same prefix.
  • internal/distributed's coordinator, replacing its direct PutObjectIf calls — the smallest
    change, and the one whose value is limited by the package above it being experimental.

Acceptance criteria

  • A decision recorded on this issue about what, if anything, holds a lease
  • If the answer is "nothing for now": internal/coord's doc says so explicitly, and this issue
    closes as resolution: works-as-designed
  • If the answer names a consumer: that wiring is filed as its own issue with a mutation-verified
    test proving the guard is reached, in the shape A read-only mount: --read-only for objectfs mount, and ro for the fstab helper #532's zero-writes assertion took
  • Either way, a test asserts the decision, so "unreferenced" stops being something only a manual
    grep discovers

Activity

  1. added
    type: technical-debt
    priority: medium
    area: core
    area: distributed
    effort: small
    needs-design
    on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: corearea: distributedeffort: smallneeds-designpriority: mediumtype: technical-debt

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions