Among other things, this fixes race condition test failures in libp2p and
random panics in go-log.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
Since indirect pins are of the form `indirect through <cid>`, let's use
a regexp to match them instead of an equality operator.
License: MIT
Signed-off-by: Lilith McMullen <iggnsthe@live.com>
This commit:
* Does not collect and return changed items when doing StateSync (they are
not used)
* Removes the StateSync RPC method (no longer used)
* Uses tracker.StatusAll() rather than requesting Status on each Cid (should
be faster with upcoming pintracker)
* Does not launch a go-routine to track every item. Track is an async
operation. This likely causes 1000s goroutines to be started with no good
reason.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
When StateSync() runs and triggers Untrack() on items
that have just been removed from the state but on which
Untrack() is underway, the operation tracker would be
reset to phase queued and in some cases stay so.
Also happened for Track()
This caused failures of TestClustersPin as SyncStatus()
is triggered regularly while Tracks() and Untracks() happen.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
This makes pubsubmon the default. The basic monitor is still usable
with a hidden --monitor basic flag.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
GetTTL returns duration. SetTTL should take duration too, not seconds.
This removes the original SetTTL method which used seconds.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
The monitor component should be in charge of deciding how it is
best to send metrics to other peers and what that means.
This adds the PublishMetric() method to the component interface
and moves that functionality from Cluster main component to the
basic monitor.
There is a behaviour change. Before, the metrics where sent only to
the leader, while the leader was the only peer to broadcast them everywhere.
Now, all peers broadcast all metrics everywhere. This is mostly
because we should not rely on the consensus layer providing a Leader(), so
we are taking the chance to remove this dependency.
Note that in any-case, pubsub monitoring should replace the
existing basic monitor. This is just paving the ground.
Additionally, in order to not duplicate the multiRPC code
in the monitor, I have moved that functionality to go-libp2p-gorpc
and added an rpcutil library to cluster which includes useful
methods to perform multiRPC requests (some of them existed in
util.go, others are new and help handling multiple contexts etc).
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>