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
cluster sharding #309
Comments
|
Update: PR #310 brought streaming of files over http and the Current work is happening in PR #317. A rough sharding implementation exists (triggered by Dev TODOs
Current Testing TODOs Dev NiceToHaves, future TODOs: |
|
-- State format change proposal -- At a high level I want the state format to support two new things
To implement 1. my proposal is to include a second map, ShallowPinMap, along with the PinMap and Version in the MapState. The ShallowPinMap will keep track of shallow pins and the tracked pins they rely on. There are a few methods for representing shallow pins:
I think either of these should work fine, and lean towards option A. If we go with option A pretty printing the state may get a bit easier as we won't need to fetch the reference pin to send back info on it. Displaying shallow pins is also a topic for discussion. Perhaps as in the sharding RFC all pins should display a field To implement 2. my proposal is to add a hidden field to the api "Pin" type. The only pins that will be made hidden are those that the sharding component adds to the pinset when constructing the clusterdag. Additionally the reporting functionality (pin ls and pin status) will need to change, though this should manifest itself as a simple check if a pin is hidden before sending out data in certain calls. @hsanjuan let me know your thoughts and suggestions for alternatives |
|
I see some problems:
I'm going to establish some glossary too:
We are trying to specify what these Considerations:
I need to let this sink a little while. I'm not sure right now if it's best to consolidate everything on a single |
I'm not sure I fully understand the utility of including the metapin reference in the cdag. Which operations/workflows start from the metadata and then move on to working on the data? For example when we make a sharding aware
Are you worried about the case where a shard is pinned with factor 1 through clusterDagA and factor 5 through clusterDagB but then clusterDagB is unpinned so the shard is replicated unnecessarily high? This seems pretty tricky and maybe I'm seeing now one of those reasons you'd want to keep track of parents of the shard. If you kept track of a set of parents you could look from the shardnode to the clusterDAGs and figure out your current max and min repl factors. During unpinning shardnodes would remove the unpinned parent ref and then update their max factor / allow themselves to unpin. Apart from this problem I'm not sure I am seeing the big picture, perhaps you could elaborate on your concerns if I'm missing some of them. I do think that in general it would be good to support multiple clusterDAGs referencing a shard but for the intended use case of sharding right now it does seem unlikely for people to hit on this. For the most part I like the terminology and the general idea. Keep me posted on your thoughts, I am going to attempt a rough draft of a state consisting of a map of cid objects to make this more concrete. |
You might be right. I just don't want things pinned on ipfs by cluster which we cannot track to the actual metapin. But tracking can be done by checking every metapin to find which one holds a shard. If a shard fails to pin though, it should be visible/obvious that it belongs to a certain metapin and the entrypoint for any operation to fix it (recover), should probably be the metapin.
Im worried that when we unpin a metapin, we unpin the cdag, and then we unpin the shards. But maybe some shards should not be unpinned because they are also used by a different cdag. This might happen if a user shards some data, then adds the same data with something else appended. The original shards made by cluster would be part of two cluster dags... ipfs has essentially this problem too, i think it keeps a list of parent-references to pins, but I can't remember. |
|
To your first point: that makes sense. There are other problems around this we should keep in mind. Notably that in the case we are sharding a file the original pinning operation of a shard by the sharding component can not know the clusterdag cid as the whole dag needs to be imported for that and we can't in general wait to pin shards. Maybe we could block put and then pin later when cluster dag is ready however. We could also include an update call to associate the shard and clusterdag after the fact. Either way we have to be careful to ensure that the shard is always associated with the metapin. This gets tough when we think about cluster failures during sharding. To your second point: this also makes sense and I see more clearly how tracking parent references in the shards would help with this. Maybe when the sharder updates the clusterdag reference on a shard cid object it can check for existence of the shardcid in the pinset and add the parent to the existing cid object. We could also associate the replication factors with the cdag. This way shards could figure out which repl factors they should switch to during an unpin. This seems better than sweeping through all metapins to see if a shard can be reached during any metapin unpin op. I guess it makes sense fundamentally that refcounting is the way to go over sweeping because we are dealing with acyclic graphs. |
|
Tracking bugs and work needed to polish the sharding branch: [x] Directories are not printed out by cluster add print |
|
I'm closing this and directing further discussion to #496 |
ZenGround0 commentedJan 29, 2018
•
edited
It's happening, this issue is to track work on ipfs-cluster sharding and file ingestion. See the link for a more in depth work plan.
Current TODOs
[x] basic file streaming from ctl to service over HTTP (multi-file, no dirs or symlinks yet)
[ ] factor a dex library out of go-ipfs and make it suitable for reading an HTTP multipart stream
[x] add a file's dag (non-sharded) to ipfs after importing in cluster
Work takes place on the feat/sharding branch. Current plan is to leave this branch separate from cluster master for the time being and make prs to feat/sharding. We will merge back to master upon reaching major milestones but expect many PRs before that.
Although we are pushing forward we are still lacking feedback. If you find yourself reading this issue and interested in contributing to this work consider leaving comments on the RFC linked above.
The text was updated successfully, but these errors were encountered: