Skip to content

Conversation

@gw0
Copy link
Contributor

@gw0 gw0 commented Dec 22, 2025

We need a tool for analyzing and checking the consistency of BadgerDB databases from Oasis node snapshots. It performs a full database scan, analysis with statistics, consistency validation, and integrity checks. It handles multiple BadgerDB versions (v2-v4) and data representations use by Oasis nodes (v20.x-v25.x). Works on majority of data.

@gw0 gw0 requested a review from martintomazic December 22, 2025 12:57
@gw0 gw0 self-assigned this Dec 22, 2025
Copy link

@martintomazic martintomazic left a comment

Choose a reason for hiding this comment

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

This replaces #40?

Comment on lines +59 to +65
opts.NumCompactors = 0
opts.CompactL0OnClose = false
opts.BypassLockGuard = true // Allow concurrent access
opts.DetectConflicts = false // Reduce overhead
// Keep default logger enabled for diagnostics

db, err = badger.Open(opts)

Choose a reason for hiding this comment

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

Using normal mode (badger.Open) might be risky, as during node lifetime, mkvs databases are opened in the managed mode (badger.OpenManaged). Other databases are always opened in the normal mode. E.g opening consensus-mkvs in normal mode and forcing compaction results in data loss.

But you also set opts.NumCompactors = 0 so this should be probably safe. Have you observed any such issues? If not I would just add a comment/warning that this combo should be never changed or we risk data loss.

@tjanez
Copy link
Member

tjanez commented Dec 27, 2025

This replaces #40?

As far as I understood @gw0, this is the second part of his work that works with #40.

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.

4 participants