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

[ filesystem backend] Add dcrtime database fsck #46

Merged
merged 1 commit into from Feb 22, 2019

Conversation

@marcopeereboom
Copy link
Member

commented Feb 6, 2019

This code goes through all timestamp directories and verifies that the contents match the global database and the flush record. It identified some results of bugs that were fixed during the duration of the live version.

@lukebp

lukebp approved these changes Feb 14, 2019

Copy link
Member

left a comment

I tested the dcrtime_fsck tool and it was working as expected. I'm not that familiar with this codebase, but the code review LGTM.

cmd/dcrtime_fsck/dcrtime_fsck.go Show resolved Hide resolved
dcrtimed/backend/filesystem/dump.go Outdated Show resolved Hide resolved
dcrtimed/backend/filesystem/dump.go Outdated Show resolved Hide resolved
dcrtimed/backend/filesystem/dump.go Outdated Show resolved Hide resolved
@lukebp

lukebp approved these changes Feb 15, 2019

@marcopeereboom marcopeereboom force-pushed the marcopeereboom:fsck branch 2 times, most recently from a29a808 to 602b11e Feb 18, 2019

@lukebp

lukebp approved these changes Feb 18, 2019

@marcopeereboom marcopeereboom changed the title [ WIP] Add dcrtime database fsck [ filesystem backend] Add dcrtime database fsck Feb 19, 2019

cmd/dcrtime_dumpdb/dcrtime_dumpdb.go Outdated Show resolved Hide resolved
cmd/dcrtime_fsck/dcrtime_fsck.go Outdated Show resolved Hide resolved

@marcopeereboom marcopeereboom force-pushed the marcopeereboom:fsck branch from 602b11e to 7f377c8 Feb 22, 2019

@dajohi

dajohi approved these changes Feb 22, 2019

Copy link
Member

left a comment

tested and didn't seem to break anything

Implement fsck
This fsck travels into all directories in a filesystem dcrtime database
and ensures that all hashes and timestamps are consistent. It also
verifies that flushed records are in fact stored on the blockchain and
verifies the merkle roots in the flush record and reality.

It currently fixes data errors caused by three bugs. These bugs have
since been fixed but the data incoherence was never corrected.

The fsck has a journaling function which records all actions taken. This
is useful in case at a later time there needs to be a correction.

@marcopeereboom marcopeereboom force-pushed the marcopeereboom:fsck branch from 7f377c8 to 3d97721 Feb 22, 2019

@marcopeereboom marcopeereboom merged commit d496e2f into decred:master Feb 22, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@marcopeereboom marcopeereboom deleted the marcopeereboom:fsck branch Feb 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.