kvmodernc.org/kv/kvaudit

kvaudit command

Command kvaudit verifies kv databases.

Installation:

$ go get modernc.org/kv/kvaudit

Usage:

kvaudit [-d] [-f key] [-l key] [-max n] [-s] [-v] file

Options:

-b	analyze allocated/free blocks sizes vs FLT buckets

-d	dump file to stdout in cdbmake[2] format even for empty -f and -l.

-f key	dump from key, first existing if empty

-l key	dump to key, last existing if empty

-max	maximum number of errors to report. Default 10.	The actual
	number of reported errors, if any, may be less because many
	errors do not allow to reliably continue the audit.

-s	List DB statistics

-v	List every error in addition to the overall one.

Arguments:

file	For example: ~/foo/bar.db

Implementation Notes

The performed verification is described at [0]. This tool was hacked quickly to assist with resolving [1].

Known Issues

In this first release there's no file locking checked or enforced. The auditing process will _not_ write to the DB, so this cannot introduce a DB corruption (it's opened in R/O mode anyway). However, if the DB is opened and updated by another process, the reported errors may be caused only by the updates.

In other words, to use this initial version properly, you must manually ensure that the audited database is not being updated by any other process.

Referenced from above:

[0]: http://godoc.org/modernc.org/lldb#Allocator.Verify
[1]: https://code.google.com/p/camlistore/issues/detail?id=216
[2]: http://cr.yp.to/cdb/cdbmake.html
Version
v1.0.6 (latest)
Published
May 18, 2023
Platform
linux/amd64
Imports
8 packages
Last checked
1 month ago

Tools for package owners.