ipfs-cluster/pintracker/stateless
Hector Sanjuan 11124ee224 Fix: repinning does not re-allocate as needed
Long story: Since #1768 there has been a recurring repinning test failure with
Raft consensus.

Per the test, if a pin is allocated to a peer that has been shutdown,
submitting the pin again should re-allocate it to a peer that is still
running.

Investigation on why this test fails and why it fails only in Raft lead to
realizing that this and other similar tests, were passing by chance. The
needed re-allocations were made not by the new submission of the pin, but by
the automatic-repinning feature. The actual resubmitted pin was carrying the
same allocations (one of them being the peer that was down), but it was
silently failing because the RedirectToLeader() code path was using
cc.ctx and hitting the peer that had been shutdown, which caused it to error.

Fixing the context propagation, meant that we would re-overwrite the pin with
the old allocations, thus the actual behaviour did not pass the test.

So, on one side, this fix an number of tests that had not disabled automatic
repinning and was probably getting in the way of things. On the other side,
this removes a condition that prevents re-allocation of pins if they exists
and options have not changed.

I don't fully understand why this was there though, since the Allocate() code
does return the old allocations anyways when they are enough, so it should not
re-allocate randomly. I suspect this was preventing some misbehaviour in the
Allocate() code from the time before it was improved with multiple allocators
etc.
2022-09-27 12:31:24 +02:00
..
config_test.go pintracker: PriorityPinMaxAge and PriorityPinMaxRetries 2021-11-30 04:20:35 +01:00
config.go Migrate from ipfs/ipfs-cluster to ipfs-cluster/ipfs-cluster 2022-06-16 17:43:30 +02:00
stateless_test.go Dependency upgrades (#1755) 2022-09-06 16:57:17 +02:00
stateless.go Fix: repinning does not re-allocate as needed 2022-09-27 12:31:24 +02:00