ipfs-cluster / ipfs-cluster

Pinset orchestration for IPFS
https://ipfscluster.io
Other
1.49k stars 288 forks source link

[CRDT] peers rm reallocates all CIDs, even though peer will not be removed #842

Open kishansagathiya opened 5 years ago

kishansagathiya commented 5 years ago

Additional information:

Describe the bug:

For CRDT consensus, consensus.RmPeer method is a no-op, so ctl peers rm and respective API should be a no-op as well, but it is not.

In cluster method PeerRemove, we assume that peer will be removed and re-allocate all its CIDs to other peers https://github.com/ipfs/ipfs-cluster/blob/b96c2b664d907a1133381d0358b7960dcca0027a/cluster.go#L812-L820

cluster.PeerRemove should not have this side-effect and should be no-op in case of CRDT consensus.

lanzafame commented 5 years ago

In the case of CRDT consensus, I would expect that ctl peers rm would remove that peer from my trusted peerset and making sure to reallocate any pins that they have.

hsanjuan commented 5 years ago

Hmm this is rough edge, particularly if a follower runs peer rm and triggers repinnings only meaninful to itself. I need some time to think an approach.