-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pins should support a replication factor #41
Comments
I'd like to be clear. Is this pinning blocks or pinning merkel dags that describe files? I.e., say I use Also, can this support clusters where nodes have limits that vary? |
@20zinnm right now its not pinning blocsk individually. It's equivalent to
yes, it should not be difficult to implement custom strategies for different limits. // fixed formatting ~ Kubuxu |
@hsanjuan I've been doing some reading concerning the Raft consensus algorithm you use in ipfs-cluster, and I wonder why a model like this wouldn't work:
This would allow for fine-grained distribution and replication at the block level to maximize the utilization of peers and allow them the ability to chose whether or not to take blocks. This is advantageous because it allows for heterogeneous peers (my raspberry pi with a gigabyte and a rack in the cloud with a petabyte can participate on the same cluster). |
Hello @20zinnm , As it was pointed out on irc, while your proposal offloads the tracking decision to the nodes, it does not allow to provide balancing strategies where comparison between nodes are needed (i.e. geographically or network-topology based decisions). Regarding block-level tracking, as I said, on this first approach we will not do it. A number of reasons were also provided on irc. I think you can accommodate your use case by sending the block hashes to cluster rather than the main hash, as cluster does not make distinctions. Would that work for you? |
This adds the possibility of using a replication factor is now supported. First, cluster peers collect and push metrics (Informer) to the Cluster leader regularly. The Informer is an interface that can be implemented in custom wayts to support custom metrics. Second, on a pin operation, using the information from the collected metrics, an Allocator can provide a list of preference as to where the new pin should be assigned. The Allocator is an interface allowing to provide different allocation strategies. Both Allocator and Informer are Cluster Componenets, and have access to the RPC API. The allocations are kept in the shared state. This is still missing re-allocations (although re-pinning something when a node is down - metrics missing) should effectively re-allocate content. License: MIT Signed-off-by: Hector Sanjuan <hector@protocol.ai>
This adds the possibility of using a replication factor is now supported. First, cluster peers collect and push metrics (Informer) to the Cluster leader regularly. The Informer is an interface that can be implemented in custom wayts to support custom metrics. Second, on a pin operation, using the information from the collected metrics, an Allocator can provide a list of preference as to where the new pin should be assigned. The Allocator is an interface allowing to provide different allocation strategies. Both Allocator and Informer are Cluster Componenets, and have access to the RPC API. The allocations are kept in the shared state. This is still missing re-allocations (although re-pinning something when a node is down - metrics missing) should effectively re-allocate content. License: MIT Signed-off-by: Hector Sanjuan <hector@protocol.ai>
New PeerManager, Allocator, Informer components have been added along with a new "replication_factor" configuration option. First, cluster peers collect and push metrics (Informer) to the Cluster leader regularly. The Informer is an interface that can be implemented in custom wayts to support custom metrics. Second, on a pin operation, using the information from the collected metrics, an Allocator can provide a list of preferences as to where the new pin should be assigned. The Allocator is an interface allowing to provide different allocation strategies. Both Allocator and Informer are Cluster Componenets, and have access to the RPC API. The allocations are kept in the shared state. Cluster peer failure detection is still missing and re-allocation is still missing, although re-pinning something when a node is down/metrics missing does re-allocate the pin somewhere else. License: MIT Signed-off-by: Hector Sanjuan <hector@protocol.ai>
New PeerManager, Allocator, Informer components have been added along with a new "replication_factor" configuration option. First, cluster peers collect and push metrics (Informer) to the Cluster leader regularly. The Informer is an interface that can be implemented in custom wayts to support custom metrics. Second, on a pin operation, using the information from the collected metrics, an Allocator can provide a list of preferences as to where the new pin should be assigned. The Allocator is an interface allowing to provide different allocation strategies. Both Allocator and Informer are Cluster Componenets, and have access to the RPC API. The allocations are kept in the shared state. Cluster peer failure detection is still missing and re-allocation is still missing, although re-pinning something when a node is down/metrics missing does re-allocate the pin somewhere else. License: MIT Signed-off-by: Hector Sanjuan <hector@protocol.ai>
PR is in.The re-pinning on host failure has been moved to #45. |
What is the default replication factor in an ipfs-cluster? Would love to know that. |
It's defined in the config file, found by default at
`~/.ipfs-cluster/service.json`
…On Wed., 13 Feb. 2019, 16:33 Ganesh Prasad Kumble, ***@***.***> wrote:
What is the default replication factor in an ipfs-cluster?
Would love to know that.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFpnaOGxAQWHWbawQpeHGeKEWbgJCWbiks5vM7HCgaJpZM4L5yPX>
.
|
Thanks. What's the range for these replication factor variables here? I see the https://cluster.ipfs.io/documentation/configuration/#the-cluster-main-section describing the default values for replication factor, but not the range of values. |
Min is 0, max is whatever fits inside a golang int, and -1 has the special
meaning of all peers.
…On Wed., 13 Feb. 2019, 22:05 Ganesh Prasad Kumble, ***@***.***> wrote:
Thanks.
What's the range for these replication factor variables here?
I see the
https://cluster.ipfs.io/documentation/configuration/#the-cluster-main-section
describing the default values for replication factor, but not the range of
values.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFpnaCywRK-Fr8samhm_hwTFAzv-JgGGks5vM_-egaJpZM4L5yPX>
.
|
A Pin should not need to be pinned in every cluster member. We should be able to say that a pin needs to be pinned in 2, 3 cluster members.
We will start with a general replication factor for all pins, then maybe transition to replication factor per-pin.
These are thoughts for the first approach.
Replication factor
-1
means Pin everywhere. If replication factor is larger than the number of clusters then it is assumed to be as large.Pinning
We need a
PeerMonitor
component which is able to decide, when a pin request arrives, which peer comes next. The decision should be based on pluggable modules: for a start, we will start with one which attempts to evenly distribute the pins, although it should easily support other metrics like disk space etc.Every commit log entry asking to Pin something must be tagged with the peers which are in charge. The Pin Tracker will receive the task and if it is tagged itself on a pin it will pin. Alternatively it will store the pin and mark it as
remote
.If the
PinTracker
receives a Pin which is already known, it should unpin if it is no longer tagged among the hosts that are in charge of pinning. Somewhere in the pipeline we probably should detect re-pinnings and not change pinning peers stupidly.Unpinning
Unpinning works as usual removing the pin only where it is pinned.
Re-pinning on peer failure
The peer monitor should detect hosts which are down (or hosts whose
ipfs
daemon is down).Upon a certain time threshold ( say 5 mins, configurable). It should grep the status for pins assigned to that host and re-pin them to new hosts.The peer monitor should also receive updates from the peer manager and make sure that there are no pins assigned to hosts that are no longer in the cluster.
For the moment there is no re-rebalancing when a node comes back online.
This assumes there is a single peer monitor for the whole cluster. While monitoring the local ipfs daemon could be done by each peer (and triggering rebalances for that), if all nodes watch eachothers this will cause havoc when triggering rebalances. The Raft cluster leader should probably be in charge then. But this conflicts with being completely abstracted from the consensus algorithm below. If we had a non-leader-based consensus we could assume a distributed lottery to select someone. It makes no sense to re-implement code to choose a peer from the cluster when Raft has it all. Also, running the rebalance process in the Raft leader saves redirection for every new pin request.
UX
We need to attack
ipfs-cluster-ctl
to provide more human readable outputs as the API formats are more stable.status
should probably show succinctly which pins are underreplicated or peers in error, 1 line per pin.The text was updated successfully, but these errors were encountered: