Skip to content

docs: day-two operations and troubleshooting, and a gate for them (#148) - #419

Merged
scttfrdmn merged 2 commits into
mainfrom
docs/148-operations-troubleshooting
Aug 9, 2026
Merged

scttfrdmn merged 2 commits into
mainfrom
docs/148-operations-troubleshooting

Conversation

@scttfrdmn

Copy link
Copy Markdown
Owner

Closes #148. The day-two half of the admin guide, completing the pair started by #152 (PR #418).

The two pages

docs/admin-guide/troubleshooting.md — a decision tree for four symptoms: a mount that fails, a
low cache hit rate, gossip that never forms, and S3 costs above expectation. Every branch ends at a
command, and where a branch has no diagnostic it says so — knowing a question cannot be answered
from outside is worth more than a suggestion that reads like one.

The mount branch opens with a message → exit code → branch table, because the codes already narrow
it: 2 is a wrong command line or config file, 1 is a correct command whose operation failed. Two
argument orderings are documented for the same reason — the config file is loaded before either
positional argument, and the storage URI is validated before the mount point, so objectfs mount s3://b /nonexistent names the bucket and says nothing about the directory.

Two entries exist to stop a correct system being read as broken:

  • A single-pass workload has a correctly near-zero hit rate. One tar over a dataset larger than
    the cache has no reuse to capture, so no amount of cache changes the number. The page establishes
    that reuse exists before it covers the causes a bigger cache fixes.
  • objectfs cluster status exits 0 when clustering is disabled — the default rather than a
    fault. A page documenting that as nonzero would have every single-node mount alerting.

The gossip branch documents the port collision that looks like a misconfiguration and is not: gossip
and metrics both default to 8080, UDP and TCP respectively, and both bind simultaneously because
those are separate port namespaces — verified by binding both in one process, not assumed. The
consequence worth stating is that a firewall rule written for "port 8080" without a protocol may open
only the one you were not thinking about.

docs/admin-guide/operations.md — upgrades (single-node and rolling), capacity changes, secret
rotation, and what to alert on. Grow/shrink mechanics are cross-linked to distributed.md rather
than duplicated.

Stop, do not kill is the load-bearing part: a SIGKILL leaves the kernel holding a mount whose
server is gone and loses any dirty range that had not reached S3, which is why the systemd unit's
ExecStop runs objectfs unmount under TimeoutStopSec=90. objectfs: shutdown failed, so data may not have reached S3 is named as a stop-the-rollout signal — it is the one message this program
exists to be able to print.

Secret rotation is documented as not rolling, with the reason: two secrets in one cluster is a
partition by design, so a rolling rotation would self-inflict the silent-partition failure the rest
of the guide is about. Reads and writes keep working through the restart window; what stops is cache
coherence, so a maintenance window is the right framing.

What #148 asked for that could not be written

Listed in each page's "What this page does not cover" rather than approximated — the same treatment
#152 got, and the same reason. All verified against the tree:

#148 specifies Reality
"upgrade one at a time, leader last" Nothing elects a leader on a mount path. cluster status prints Role: n/a on every node; the order is the operator's to choose
"leader failure recovery (Raft election)" and split-brain intervention No election to wait for, no split-brain state to resolve. Coordination is CAS against S3
"verify quorum before removing a node" No quorum condition exists anywhere
a node "degrades to ConsistencyEventual" Removed in 0.12.0; survives only as a comment recording the removal
"log rotation and data dir management" No cluster.persistent_log, no cluster.data_dir
gossip on 7946 memberlist's default. This project's is 8080

An upgrade procedure saying "leader last" is the costly one: it sends an operator looking for a
leader that never appears, which reads like a broken cluster.

The gate

internal/config/docs_admin_guide_test.go, 5 tests. The four existing doc gates cannot see what
these pages get wrong — one parses YAML blocks, one checks Go symbols, one resolves links, one checks
changelog entries, and a curl against a metrics endpoint is prose to all four.

  • Both ports derived from NewDefault(), and every http:// URL checked, not one correct
    occurrence.
  • Each objectfs <sub> invocation checked against the five commands the binary has, so a plausible
    objectfs doctor fails rather than shipping.
  • Every objectfs_* name cross-checked against sdks/testdata/metrics-scrape.txt, a real scrape of
    a running registry. A grep for an unpublished metric returns nothing, which is indistinguishable
    from a healthy system.
  • The leader, quorum and consistency phrases asserted absent.

9 mutations run; 2 initially survived. A metrics curl repointed at Prometheus's own 9090
passed, because the page names 127.0.0.1:8080 further down in the TCP-versus-UDP paragraph and a
substring check was satisfied by a sentence with nothing to do with the command. The same held when
only one of four URLs was wrong, hiding behind three correct siblings. Both caught now, by checking
whole URLs and all of them.

The test's own first run found a claim needing the opposite assertion: the page names
objectfs_cache_hit_rate in order to say the gauge deliberately does not exist. Exempting it would
have been the wrong repair — that claim is falsifiable too, and it becomes false the day someone adds
the gauge, at which point the page tells an operator to compute by hand a number the endpoint
publishes. So a negated name is checked for absence, and the negating sentence is required to
still be there.

Verification

  • go build ./..., gofmt -l ., go vet ./..., golangci-lint run — 0 issues
  • go test -race ./... — clean, full suite
  • Coverage gate under CI's own command (CGO_ENABLED=1 go test -covermode=atomic ... then
    ./scripts/coverage-gate.sh coverage.out .coverage-floors) — 35 packages at or above floor
  • All 18 doc gates pass in a linux/amd64 golang:1.26-alpine container as well as on darwin.
    Run because of feat(config): refuse a wildcard advertise_addr, and an operator guide for clustering (#152) #418's CI failure: a darwin-only measurement about UDP port 0 was falsified on
    Linux, which is the argument for measuring on the target platform rather than the development one

Two admin-guide pages, and internal/config/docs_admin_guide_test.go to keep them
true.

troubleshooting.md is a decision tree for four symptoms, every branch ending at a
command rather than at advice. The mount branch opens with a message-to-exit-code
table because the codes already narrow it: 2 is a wrong command line or config
file, 1 is a correct command whose operation failed, so the code alone says
whether to re-read the config or look at the host.

Two entries exist to stop a correct system being read as broken. A single-pass
workload has a correctly near-zero hit rate — one tar over a dataset larger than
the cache has no reuse to capture — so the page establishes that reuse exists
before enlarging anything. And `objectfs cluster status` exits 0 when clustering
is disabled, the default rather than a fault; documenting that as nonzero would
have every single-node mount alerting.

The gossip branch documents the port collision that looks like a misconfiguration
and is not. Gossip and metrics both default to 8080, UDP and TCP respectively,
and both bind at once because those are separate port namespaces — verified by
binding both in one process. The consequence worth stating is that a firewall
rule written for "port 8080" without a protocol may open only the one you were
not thinking about. #148's body specified 7946: memberlist's default, and this
project's nowhere.

operations.md covers upgrades, capacity changes, secret rotation and what to
alert on. Stop, do not kill, is the load-bearing part: a SIGKILL leaves the
kernel holding a mount whose server is gone and loses any dirty range that had
not reached S3, which is why the systemd unit's ExecStop runs `objectfs unmount`
under TimeoutStopSec=90. "objectfs: shutdown failed, so data may not have reached
S3" is named as a stop-the-rollout signal — it is the one message this program
exists to be able to print. Secret rotation is documented as not rolling, with
the reason: two secrets in one cluster is a partition by design, so rolling it
would self-inflict the silent partition the rest of the guide is about.

Two of #148's procedures could not be written and are listed as absent rather
than approximated, as #152's were. "Leader last" and "leader-failure recovery
(Raft election)" describe nothing — no leader is elected on a mount path, so
cluster status prints `Role: n/a` and the order is the operator's to choose; an
upgrade procedure saying "leader last" sends someone looking for a leader that
never appears, which reads like a broken cluster. "Verify quorum" and a node that
"degrades to ConsistencyEventual" are wrong twice: no quorum condition exists,
and that type was removed in 0.12.0. "Log rotation and data dir management" has
no keys.

The gate is the reason to trust the numbers, because the four existing doc tests
cannot see what these pages get wrong: one parses YAML blocks, one checks Go
symbols, one resolves links, one checks changelog entries, and a curl against a
metrics endpoint is prose to all four. The new test derives both ports from
NewDefault(), checks every http:// URL on each page rather than one correct
occurrence, checks each `objectfs <sub>` against the five commands the binary
has, cross-checks every objectfs_* name against sdks/testdata/metrics-scrape.txt
— a real scrape of a running registry — and asserts the leader, quorum and
consistency phrases stay absent.

Nine mutations, two of which initially survived. A metrics curl repointed at
Prometheus's own 9090 passed, because the page names 127.0.0.1:8080 further down
in the TCP-versus-UDP paragraph and a substring check was satisfied by a sentence
with nothing to do with the command; the same held when only one of four URLs was
wrong, hiding behind three correct siblings. Both are caught now. The test's own
first run also found a claim needing the opposite assertion: the page names
objectfs_cache_hit_rate in order to say the gauge deliberately does not exist, so
that name is checked for absence from the fixture. Exempting it would have missed
the day someone adds the gauge and the page starts telling operators to compute
by hand a number the endpoint publishes.

Verified: build, gofmt, vet, golangci-lint (0 issues), go test -race ./... clean,
coverage gate 35/35 under CI's own command, and all 18 doc gates passing in a
linux/amd64 container as well as on darwin.
…a flag

Committing #148's two pages made them visible to the markdown gates for the
first time — every one of them enumerates pages with `git ls-files`, so an
untracked file is invisible to all of them and no pre-commit local run can see
the file it is about to add. TestDocumentedCLIInvocationsAreRunnable then failed
on both pages, and both failures were the gate's, not the docs'.

The invocation parser did not stop at a pipe. `|` was listed as shell noise and
skipped, after which the parser went on reading the next program's arguments as
though objectfs had been given them: `objectfs cluster status | grep -A5
Membership` was reported as passing an unrecognized --A5. It stops at |, ||, &&
and ; now. A bad flag before the pipe is still caught, verified by mutation — a
fix that had simply stopped checking would look identical from a passing test.

The flag list was checked against main.go alone, which left a whole subcommand's
flags unverified. cluster.go declares --json, --endpoint and its own --config, so
`objectfs cluster status --json` — a flag the binary parses, and one cluster.go
has a comment about documenting — was named as unrecognized.
TestCLIFlagsMatchTheBinary now scans every non-test file in cmd/objectfs and
fails if it finds no declarations at all, so a future subcommand's flags cannot
go unchecked the same way; --json and --endpoint joined cliFlags. Narrowing the
glob back to main.go resurfaces the false positive, which is how this was
verified rather than assumed.

Both defects reported a correct command as broken, which is the failure direction
worth fixing carefully: a gate that cries wolf teaches a reader to distrust it,
and the next real defect gets waved through with it.

Verified: build, gofmt, vet, golangci-lint (0 issues), go test -race ./... clean,
three mutations caught, and internal/config passing under -covermode=atomic in a
linux/amd64 container.
@scttfrdmn
scttfrdmn merged commit 1316e2f into main Aug 9, 2026
39 checks passed
@scttfrdmn
scttfrdmn deleted the docs/148-operations-troubleshooting branch August 9, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

B2-4: Day-two operations documentation

1 participant