34fdc329fc
This is the third implementation attempt. This time, rather than broadcasting PeerAdd/Join requests to the whole cluster, we use the consensus log to broadcast new peers joining. This makes it easier to recover from errors and to know who exactly is member of a cluster and who is not. The consensus is, after all, meant to agree on things, and the list of cluster peers is something everyone has to agree on. Raft itself uses a special log operation to maintain the peer set. The tests are almost unchanged from the previous attempts so it should be the same, except it doesn't seem possible to bootstrap a bunch of nodes at the same time using different bootstrap nodes. It works when using the same. I'm not sure this worked before either, but the code is simpler than recursively contacting peers, and scales better for larger clusters. Nodes have to be careful about joining clusters while keeping the state from a different cluster (disjoint logs). This may cause problems with Raft. License: MIT Signed-off-by: Hector Sanjuan <hector@protocol.ai>
13 lines
256 B
Go
13 lines
256 B
Go
// +build !debug,silent
|
|
|
|
package ipfscluster
|
|
|
|
func init() {
|
|
l := "CRITICAL"
|
|
SetFacilityLogLevel("cluster", l)
|
|
SetFacilityLogLevel("raft", l)
|
|
SetFacilityLogLevel("p2p-gorpc", l)
|
|
SetFacilityLogLevel("swarm2", l)
|
|
SetFacilityLogLevel("libp2p-raft", l)
|
|
}
|