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

Make delete idempotent #30

Closed
Stebalien opened this issue Mar 6, 2018 · 3 comments
Closed

Make delete idempotent #30

Stebalien opened this issue Mar 6, 2018 · 3 comments

Comments

@Stebalien
Copy link
Member

Currently, delete on a non-existent key returns ErrNotFound. However, this isn't really all that useful. Additionally,

  1. badgerdb doesn't return an error when deleting a non-existent and making it do so will be a slight performance hit.
  2. Feat: Implement a PersistentDatastore by adding DiskUsage method #27 will cause deletes to succeed, sometimes, even when there was no value to be deleted (e.g., a concurrent delete and put where we resolve the put after the delete).
@whyrusleeping
Copy link
Member

hrm... I was against this until you threw my weakness at me. I love making things idempotent...

@kevina
Copy link
Contributor

kevina commented Jun 8, 2018

I think we should fix what every in #27 that causes delete to not return the correct value. I am against returning less information than we know.

At the specification level I would say that a datastore should have an option of not returning ErrNotFound but it should be allowed to. If it does return ErrNotFound it should do so consistently.

@Stebalien
Copy link
Member Author

Moving to: ipfs/go-datastore#104

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants