Repository navigation
docs: day-two operations and troubleshooting, and a gate for them (#148) - #419
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, alow 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 /nonexistentnames the bucket and says nothing about the directory.Two entries exist to stop a correct system being read as broken:
tarover a dataset larger thanthe 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 statusexits 0 when clustering is disabled — the default rather than afault. 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, secretrotation, and what to alert on. Grow/shrink mechanics are cross-linked to
distributed.mdratherthan duplicated.
Stop, do not kill is the load-bearing part: a
SIGKILLleaves the kernel holding a mount whoseserver is gone and loses any dirty range that had not reached S3, which is why the systemd unit's
ExecStoprunsobjectfs unmountunderTimeoutStopSec=90.objectfs: shutdown failed, so data may not have reached S3is named as a stop-the-rollout signal — it is the one message this programexists 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:
cluster statusprintsRole: n/aon every node; the order is the operator's to chooseConsistencyEventual"cluster.persistent_log, nocluster.data_dirAn 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 whatthese pages get wrong — one parses YAML blocks, one checks Go symbols, one resolves links, one checks
changelog entries, and a
curlagainst a metrics endpoint is prose to all four.NewDefault(), and everyhttp://URL checked, not one correctoccurrence.
objectfs <sub>invocation checked against the five commands the binary has, so a plausibleobjectfs doctorfails rather than shipping.objectfs_*name cross-checked againstsdks/testdata/metrics-scrape.txt, a real scrape ofa running registry. A grep for an unpublished metric returns nothing, which is indistinguishable
from a healthy system.
9 mutations run; 2 initially survived. A metrics
curlrepointed at Prometheus's own 9090passed, because the page names
127.0.0.1:8080further down in the TCP-versus-UDP paragraph and asubstring 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_ratein order to say the gauge deliberately does not exist. Exempting it wouldhave 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 issuesgo test -race ./...— clean, full suiteCGO_ENABLED=1 go test -covermode=atomic ...then./scripts/coverage-gate.sh coverage.out .coverage-floors) — 35 packages at or above floorlinux/amd64 golang:1.26-alpinecontainer 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