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

WIP: Add audit method to fix corrupted databases #154

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Frando
Copy link
Contributor

@Frando Frando commented Nov 12, 2018

This adds an audit method that calls hypercore's recently added audit method on all writers. It should remove corrupted blocks. Does not work currently because after an audit that resulted in the removal of a block the reported length of the hypercore is wrong. @mafintosh is working on a fix in hypercore for this.


function finish () {
var errs = results.map(r => r.err).filter(r => r)
if (errs.length) cb(errs, results)

Choose a reason for hiding this comment

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

Is it a good idea to pass the errors as array? Its against common convention of it being an Error instance.

@martinheidegger
Copy link

@Frando I am wondering if .audit shouldn't use ._lock to prevent write operations from interfering with the result?

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

Successfully merging this pull request may close these issues.

2 participants