Repository navigation
Closed
Labels
area: configConfiguration management and validationeffort: smallSmall effort - 2-4 hourspriority: mediumImportant but not urgenttype: documentationDocumentation improvements or additions
Description
Summary
Add input validation for cluster configuration and create docs/admin-guide/distributed.md documenting the distributed architecture, configuration reference, upgrade procedure, and cache sizing formula.
Validation Changes (internal/config/config.go)
Add these checks to the config validation pass:
| Condition | Error message |
|---|---|
cluster.enabled = true AND cluster.advertise_addr = "" |
cluster.advertise_addr is required when cluster.enabled is true |
cluster.persistent_log = true AND cluster.data_dir = "" |
cluster.data_dir is required when cluster.persistent_log is true |
cluster.enabled = true AND len(cluster.seeds) == 0 |
Warning (not error): cluster.seeds is empty; node will not join an existing cluster |
objectfs mount --dry-run output
When cluster.enabled = true, --dry-run prints:
Cluster config:
enabled: true
node_id: node-1
advertise_addr: 10.0.1.1:7946
seeds: 10.0.1.2:7946, 10.0.1.3:7946
persistent_log: true
data_dir: /var/lib/objectfs/node-1
New doc: docs/admin-guide/distributed.md
Sections:
- Architecture overview — ASCII diagram showing gossip + Raft + FUSE data path; which layer handles what
- Config reference — every
cluster.*field, type, default, description - Upgrade procedure — in-memory → persistent log migration (rename data dir, set
persistent_log = true, restart one node at a time) - Cache sizing formula:
cache_size_gb ≥ (hot_dataset_gb × replication_factor) / node_count; worked example - Consistency modes — when does ObjectFS choose Eventual vs Session vs Strong?
- Limitations and roadmap — explicit list of what is NOT production-ready yet
configs/example.yaml changes
Add commented-out cluster section:
# cluster:
# enabled: false
# node_id: "" # default: hostname
# advertise_addr: "" # required if enabled: "host:7946"
# seeds: [] # peer addresses to join
# persistent_log: false # set true for production (requires data_dir)
# data_dir: "" # e.g. /var/lib/objectfs
# peer_fetch_timeout: 500msAcceptance Criteria
- Config validation catches
advertise_addrmissing with descriptive error - Config validation catches
data_dirmissing with descriptive error -
--dry-runprints cluster section only when cluster is enabled -
docs/admin-guide/distributed.mdexists with all 6 sections -
configs/example.yamlincludes commented cluster section - Doc linked from README and included in
mkdocs.ymlnav -
go test ./internal/config/...passes (table-driven validation tests)
Dependencies
- Requires A3-1 (persistent_log config option)
- Requires B1-1 (
--dry-runflag for mount subcommand)
Metadata
Metadata
Assignees
Labels
area: configConfiguration management and validationeffort: smallSmall effort - 2-4 hourspriority: mediumImportant but not urgenttype: documentationDocumentation improvements or additions
Activity
scttfrdmn commentedon Aug 9, 2026
Moved to v0.14.0. The validation table in this issue is written against
cluster.persistent_logandcluster.data_dir, and neither key exists inClusterConfig— zero hits acrossinternal/config. So the work as scoped is to validate fields that would have to be added first, and the fields belong with the persistence they configure (#150/#151 landed the bbolt implementations; nothing on the mount path reaches them).Validation for a key that does not exist would be a test asserting that a config file is rejected for naming something ObjectFS has no concept of, which strict decoding already does generically. The useful version of this issue is: add the keys with the feature, then validate them — which is a v0.14.0 shape.
scttfrdmn commentedon Aug 9, 2026
Re-checked against
c47be1bnow that #147 has merged. Two of the three validation rows are writable today; one is still blocked.cluster.enabled = trueANDadvertise_addr = ""config.ClusterConfig(config.go:695,698) and nothing validates the pair — grepped, there is noadvertisereference anywhere in the validation pass. This row can be implemented as specified.cluster.persistent_log = trueANDdata_dir = ""internal/configorinternal/distributed. This was the original reason for deferral and nothing since has added them.cluster.enabled = trueAND no seedsseed_nodes(SeedNodes), notseeds. The issue body sayslen(cluster.seeds) == 0; using that name in the docs would failTestDocumentedConfigYAMLMatchesTheSchema.The
--dry-runblock in the body needs the same corrections plus one more: it showsadvertise_addr: 10.0.1.1:7946andpersistent_log: true. The defaultListenAddris0.0.0.0:8080(internal/distributed/cluster.go:246), not port 7946 — that number appears only in test fixtures, presumably carried over from memberlist's convention — andpersistent_logshould come out of the example entirely until the field exists.Suggested rescope, so this stops waiting on a field nobody has scheduled: implement the two writable rows and the
--dry-runblock now, drop thepersistent_log/data_dirrow, and let it come back with whatever change introduces persistent logging. That is the same split #148 just got — the parts that describe real behaviour get written, the parts that describe a spec wait for the spec to become code.Also worth noting for
distributed.md: the "cache sizing formula" this issue shares with #148 multiplies hot dataset size byreplication_factor, and that factor does not mean what the formula assumes. It is a selection width — only the first node returned is used, because S3 holds the single copy (see the field comment ininternal/distributed/cluster.go). Each node caches what it reads, so a per-node cache figure has no replication term in it.feat(config): refuse a wildcard advertise_addr, and an operator guide…
docs: day-two operations and troubleshooting, and a gate for them (#148…