Snapshot saving state commands (upgrade and import)
now save raft config peers as consensus peers in snapshot.
Snapshot index 1 -> 2 when saving from a fresh import to force
replication when bootstrapping.
License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
Added go tests
Refactored cluster connect graph to new file
Refactored dot file printing to new repo
Fixed code climate issues
Added sharness test
License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
added ConnectGraph type and serialization
added cli command hitting cluster api
added cluster api client method + endpoint calling into rpc
added rpc calling into main cluster component
added clustercomponent's function to collect ConnectGraph
added functionality in ipfsconn to retrieve ipfs swarm peers
added dot file printing given ConnectGraphSerial
License: MIT
Signed-off-by: Wyatt Daviau <wdaviau@cs.stanford.edu>
The StateSync() function did not take into account that the maptracker
may think that some pinned items are local/remote when they
should not be. In those cases, it needs to trigger re-tracks.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
In go it doesn't matter if function returns 20 times. We need to do
a lot of error checking and that's how it should be.
Each of those error checks are 3 lines of code
so it also doesn't matter if functions are a bit longer.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
This ensures that we don't re-pin something which is already correctly
pinned with the same allocations.
It also ensures that we do re-pin something when the replication
factor associated to it changes.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
This PR replaces ReplicationFactor with ReplicationFactorMax
and ReplicationFactor min.
This allows a CID to be pinned even though the desired
replication factor (max) is not reached, and prevents triggering
re-pinnings when the replication factor has not crossed the
lower threshold (min).
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
It was comparing state.GetVersion() against state.Version, which
is the same, instead of against, mapstate.Version, which is the
constant for the current Version.
It was also returning a nil error, as the scope of the variable
assigned was not that of the outer level.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
This puts some sanity in this. It's not super correct (name of facilities
depend of the component and the main cluster component should not hard
code them), but it's clear enough. Imho, better than over-engineering
a more elegant approach.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>