Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

feat: fs pinstore #358

Merged
merged 18 commits into from
Sep 4, 2020
Merged

feat: fs pinstore #358

merged 18 commits into from
Sep 4, 2020

Conversation

koivunej
Copy link
Collaborator

@koivunej koivunej commented Sep 4, 2020

Adds filesystem based pin store. See adec0a8 for TL;DR.

Builds upon #357. Only last N commits are new after including 159a1c5. Even windows seems ok. base32lower is used to encode the cid names.

TODO:

  • at least the tests written for ipfs::repo::mem but will post another PR

The differences to other impls are not explained as I am not sure if I am up to date with the other implementations.

@koivunej koivunej marked this pull request as ready for review September 4, 2020 13:36
Joonas Koivunen added 18 commits September 4, 2020 17:32
this is implemented using a blockstore alike sharding implementation.
for recursive pins, a json Vec<String> is stored and used mostly
linearly (eh, something to improve). for direct pins, empty files are
used. the pin files have different file extensions.

lets see if this works in windows as well.
this allows using the owned permit and more importantly moving it to the
threadpool thread, which is not necessarily bound to the task lifetime.
there is just one permit per datastore at the moment, but making this
per cid for example shouldn't be too difficult.

having a global lock will be needed later on, not sure how to implement
it though.
@koivunej
Copy link
Collaborator Author

koivunej commented Sep 4, 2020

Rebased on top of master now that #357 got merged.

@koivunej
Copy link
Collaborator Author

koivunej commented Sep 4, 2020

In hindsight the e2c098c seems quite extra, lets see if I can drop it easily.

@koivunej
Copy link
Collaborator Author

koivunej commented Sep 4, 2020

Yeah sadly it's really non-trivial.

@koivunej
Copy link
Collaborator Author

koivunej commented Sep 4, 2020

I can move the http stuff and the blockstore splitting out if needed. Not really sure if it is needed.

Copy link
Contributor

@aphelionz aphelionz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 4, 2020

Build succeeded:

@bors bors bot merged commit 77bfbd3 into rs-ipfs:master Sep 4, 2020
bors bot added a commit that referenced this pull request Sep 4, 2020
360: test: common fs and mem pinstore tests r=aphelionz a=koivunej

Continues the long chain of pin PRs from #358. Refactors the previously custom tempdir hack and system polluting repo tests into a macro based which can be re-generated for each datastore implementation. Of course this revealed issues on both fs and mem pinstores but they were more about me not understanding the rules before three implementations :) Lets fix later if we find out more inconsistencies.

The macro approach is the only one I can see, looks pretty bad and if there are errors those will be even uglier.

Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
@koivunej koivunej mentioned this pull request Sep 5, 2020
@koivunej koivunej deleted the add_fs_pinstore branch September 24, 2020 12:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants