Skip to content
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

ipfs block rm #2914

Closed
daviddias opened this issue Jun 28, 2016 · 14 comments
Closed

ipfs block rm #2914

daviddias opened this issue Jun 28, 2016 · 14 comments
Assignees
Labels
exp/expert Having worked on the specific codebase is important kind/enhancement A net-new feature or improvement to an existing feature topic/blockstore Topic blockstore

Comments

@daviddias
Copy link
Member

Currently, the only way of deleting blocks in go-ipfs is through repo gc. In js-ipfs land, since the Block Service exposes an interface to delete, we also have exposed that on the block API. It is very convenient for testing and a quick way to delete a specific block.

Can we expose this feature in go-ipfs too?

@daviddias daviddias added kind/enhancement A net-new feature or improvement to an existing feature topic/blockstore Topic blockstore exp/novice Someone with a little familiarity can pick up labels Jun 28, 2016
@Kubuxu
Copy link
Member

Kubuxu commented Jun 28, 2016

Is should be really easy as we also have Delete call in blockstore. Problem with deleting block is that it might be component of different file or directory and as user would probably expect the removal of all blocks connected to file or directory it is even bigger issues.

@Kubuxu Kubuxu added the need/community-input Needs input from the wider community label Jun 28, 2016
@daviddias
Copy link
Member Author

@Kubuxu that would be something for the files api. The block API is really well scoped as the put and get only also return or add a single block

@Kubuxu
Copy link
Member

Kubuxu commented Jun 28, 2016

Ahh, right. So yeah, ipfs block rm should be possible and quite easy to do.

@Kubuxu Kubuxu removed the need/community-input Needs input from the wider community label Jun 28, 2016
@kevina
Copy link
Contributor

kevina commented Jun 28, 2016

How should removing pinned blocks be handled? Disallow? Allow and ignore pin? (This could then cause many problems with ipfs commands, for example the garbage collector will abort) Allow and attempt to do something about the pin? (Not so easy unless the pin a a direct pin.)

@whyrusleeping
Copy link
Member

Yeah, we need to make sure we don't remove blocks that are pinned.

@daviddias
Copy link
Member Author

Good point. If a block is pinned, it should error saying that it is pinned

@kevina
Copy link
Contributor

kevina commented Jun 28, 2016

I agree at least by default. However, for performance reasons, we might want to add an option to disable this detection if the user knows what they are doing.

I am not 100% sure I understand the pining code but it seams that to detect indirect pins all recursive pins need to be walked, thus making pin detection expensive. It looks like there might be some caching going on in the datastore under the prefix 'local/pins/indirect/keys/' but it doesn't seam like this is used by pin.IsPinnedWithType().

@whyrusleeping
Copy link
Member

Yeah, pin detection is expensive. We can optimize with various caching structures though in the future.

@Kubuxu Kubuxu added exp/wizard Extensive knowledge (implications, ramifications) required exp/expert Having worked on the specific codebase is important and removed exp/novice Someone with a little familiarity can pick up exp/wizard Extensive knowledge (implications, ramifications) required labels Jun 28, 2016
@kevina
Copy link
Contributor

kevina commented Jun 28, 2016

I know the issues involved so I take responsibility for this one.

@RichardLitt
Copy link
Member

Participating.

@daviddias
Copy link
Member Author

Any update on this one? :)

@kevina
Copy link
Contributor

kevina commented Aug 15, 2016

@diasdavid please see #2962

@whyrusleeping
Copy link
Member

we have this now :)

@daviddias
Copy link
Member Author

woot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/expert Having worked on the specific codebase is important kind/enhancement A net-new feature or improvement to an existing feature topic/blockstore Topic blockstore
Projects
None yet
Development

No branches or pull requests

5 participants