-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add disable_repinning cluster option #387
Conversation
There were the following issues with your Pull Request
Guidelines are available at https://github.com/ipfs/ipfs-cluster/blob/master/contribute.md This message was auto-generated by https://gitcop.com |
License: MIT Signed-off-by: Sina Mahmoodi <itz.s1na@gmail.com>
19b6208
to
0954c6d
Compare
Not sure what's causing your tests to fail locally but everything is passing on CI. If you follow GitCop's instructions for a valid signoff then this LGTM. |
@ZenGround0 Okay thanks, I have fixed the commit's signature. |
@s1na this looks good to me, do you think you can add a test? i.e. this test https://github.com/ipfs/ipfs-cluster/blob/master/ipfscluster_test.go#L1259 checks that re-allocation happens. Something similar (probably simpler) should check that re-allocation doesn't happen (setting DisableRepinning) at the beginning. Let us know if you find it too difficult though. |
cluster.go
Outdated
@@ -397,6 +397,10 @@ func (c *Cluster) watchPeers() { | |||
|
|||
// find all Cids pinned to a given peer and triggers re-pins on them. | |||
func (c *Cluster) repinFromPeer(p peer.ID) { | |||
if c.config.DisableRepinning { | |||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's add a logger.Warn("repinning is disabled. Will not re-allocate cids from %s")
* Test case creates a bunch of clusters, assigns a pin with replica factor of n-1 to them, and removes one of the peers randomly. It then tests to check that the number of clusters pinning the cid is n-2. * Add warn log to let user know that due to disable_repinning option, the cluster won't attempt to re-assign the pin. License: MIT Signed-off-by: Sina Mahmoodi <itz.s1na@gmail.com>
THANKS! |
This PR adds the option
disable_repinning
along with its default value, and test values.repinFromPeer
returns if this option is true.I'm having problems with running the tests to ensure everything is passing. I get
ipfscluster_test.go:69: bootstrap unsuccessful
, does anyone know what might be the cause?