diff --git a/cmd/ipfs-cluster-service/daemon.go b/cmd/ipfs-cluster-service/daemon.go index 50a8bf22..e05b19cc 100644 --- a/cmd/ipfs-cluster-service/daemon.go +++ b/cmd/ipfs-cluster-service/daemon.go @@ -199,8 +199,6 @@ func createCluster( alloc, err := balanced.New(cfgs.BalancedAlloc) checkErr("creating allocator", err) - ipfscluster.ReadyTimeout = cfgs.Raft.WaitForLeaderTimeout + 5*time.Second - cons, err := setupConsensus( cfgHelper, host, @@ -290,6 +288,7 @@ func setupConsensus( if err != nil { return nil, errors.Wrap(err, "creating Raft component") } + ipfscluster.ReadyTimeout = cfgs.Raft.WaitForLeaderTimeout + 5*time.Second return rft, nil case cfgs.Crdt.ConfigKey(): convrdt, err := crdt.New( @@ -302,6 +301,9 @@ func setupConsensus( if err != nil { return nil, errors.Wrap(err, "creating CRDT component") } + // go-ds-crdt migrations are the main cause that may need + // additional time for this consensus layer to be ready. + ipfscluster.ReadyTimeout = 356 * 24 * time.Hour return convrdt, nil default: return nil, errors.New("unknown consensus component")