Repository navigation
Description
Context
The distributed layer (internal/distributed/ClusterManager) is completely disconnected from the running application. internal/adapter/adapter.go never instantiates it. internal/fuse/filesystem.go's FileSystem struct has no coordinator field. As a result, all the distributed infrastructure built in v0.11.0 has no effect on actual filesystem operations.
What to implement
internal/fuse/filesystem.go:
Add coordinator types.DistributedCoordinator field to FileSystem struct. Default is nil — when nil, all existing code paths are completely unchanged (zero overhead, zero behavior change for single-node users).
Add a WithCoordinator(coord types.DistributedCoordinator) mount option function that sets this field.
internal/adapter/adapter.go:
Add clusterMgr *distributed.ClusterManager field to Adapter struct.
In Adapter.Start(), after the backend and cache are initialized, check a.config.Cluster.Enabled. If true:
- Construct
distributed.NewClusterManager(&a.config.Cluster) - Call
cm.SetBackend(a.backend)andcm.SetCache(a.cache) - Call
cm.Start(ctx) - Store as
a.clusterMgr - Pass
fuse.WithCoordinator(cm.GetCoordinator())when creating the mount manager
In Adapter.Stop(), call a.clusterMgr.Stop() before unmounting (if non-nil).
Add Enabled bool field to ClusterConfig in internal/config/config.go so cluster mode is explicitly opt-in.
Acceptance criteria
- All existing single-node tests pass unchanged
FileSystem.coordinatoris nil when cluster is disabled; no code branch is taken- New test: create Adapter with
config.Cluster.Enabled = true, call Start, verify ClusterManager starts and is stopped on Stop go test -race ./internal/adapter/... ./internal/fuse/...passes
Sequencing
Depends on A1-1 (ConsensusLog interface) and A1-2 (DistributedCoordinator interface). Must land before A2-2, A2-3, A2-4.
Activity
scttfrdmn commentedon Jul 30, 2026
Note from the v0.10.0 review — this cannot compile as written
Flagging a blocker found while auditing the distributed package, so the work is not attempted
against a false premise.
config.ClusterConfiganddistributed.ClusterConfigare disjoint types. The former(
internal/config/config.go) has 7 fields plus Redis; the latter(
internal/distributed/cluster.go) has 18, with different names. So the natural implementation:is a type error. A translation layer between the two is needed, and no currently-filed issue
covers it. That should either be added to this issue's scope or split out as a prerequisite.
distributed.ClusterConfighas noEnabledfield, even thoughinternal/distributed/doc.goshows example code setting it in two places. Those examples do not compile. The gating flag
exists only on
config.ClusterConfig, so the enable/disable decision has to happen in theadapter before constructing the distributed config.
Also relevant to sequencing:
Adapter(internal/adapter/adapter.go) andFileSystem(
internal/fuse/filesystem.go) both currently have no cluster or coordinator field at all, andClusterManager.GetCoordinatorhas no non-test caller. Wiring is genuinely from scratch ratherthan connecting two existing halves.
See #169 for a broader evaluation of whether the consensus direction is the right one before
this lands.
scttfrdmn commentedon Aug 2, 2026
Correction: two of this issue's steps are type errors as written
Re-verified against
mainduring the v0.10.1 audit. The intent is right; three specifics are not.1.
config.ClusterConfiganddistributed.ClusterConfigare disjoint types. The issue says to calldistributed.NewClusterManager(&a.config.Cluster). That does not compile:config.ClusterConfig(internal/config/config.go:401)distributed.ClusterConfig(internal/distributed/cluster.go:36)NodeID,ListenAddr,AdvertiseAddr,SeedNodes,ReplicationFactor,ConsistencyLevelEnabled,Redis RedisConfigJoinTimeout,ElectionTimeout,HeartbeatInterval,LeadershipTTL,GossipInterval,GossipFanout,MaxGossipPacket,CacheReplication,MaxConcurrentOps,OperationTimeout,RetryAttempts,RetryBackoffSix of eight fields overlap by name, which is what makes the mistake easy. The work item is therefore a translation function —
func clusterConfigFrom(c config.ClusterConfig) *distributed.ClusterConfig— not a pointer cast. It has to decide what to do with the twelve distributed-only fields (NewClusterManagerdefaults them, so passing zero values is acceptable but should be explicit) and withRedis, which the distributed type cannot carry at all.2.
Enabledalready exists onconfig.ClusterConfig(config.go:402). The step "AddEnabled boolfield toClusterConfigininternal/config/config.go" is already done. It isdistributed.ClusterConfigthat lacks it — and that is arguably correct, since whether to construct a manager is the caller's decision, not the manager's.3.
NewClusterManagerreturns two values,(*ClusterManager, error)(cluster.go:182). The issue's step 1 shows a single-value call.Related, and worth fixing in the same change:
internal/distributed/doc.gohas two examples that do not compile against the type they claim to configure —:79and:316setEnabled: true,:324setsFailureTimeout, anddistributed.ClusterConfighas neither field. The struct listing at:232-245is a third, independent shape: it listsEnabledandFailureTimeoutand omits the twelve real fields. Whoever wires this up will read those examples first.What is accurate and unchanged:
internal/adapter/adapter.gonever instantiatesClusterManager;FileSystemhas no coordinator field;SetBackend(cluster.go:621),SetCache(:633), andGetCoordinator(:664) all exist with the signatures the issue assumes. The nil-coordinator-is-zero-overhead design is sound.One addition to the acceptance criteria: assert the translated values, not that translation happened. A test that constructs the manager and checks it is non-nil would pass on a function that ignored its argument. v0.10.1 shipped fixes for eighteen config fields that were settable and read by nothing, all of which had that shape.
fix(sdk): the Python SDK wrote config files the daemon refused to sta…
fix(distributed): a size failure that arrived as a timeout, and a bac…
feat(cluster): make cluster.enabled actually start cluster coordinati…
release: 0.13.0 (#411)