Skip to content

Add gitaly db subcmd to manage badgerDB

Divya Rani requested to merge 6134-badger-tool into master

In Gitaly, we are using BadgerDB to store WAL log entries and metadata. This MR introduces gitaly db subcommand that allows for listing keys and values stored in BadgerDB for debugging purpose. This iteration focuses solely on reading from a local BadgerDB instance.

Example usage:

gitaly db list --db-path <storage-path>

gitaly db list --db-path <storage-path> --format-keys

gitaly db get  --db-path <storage-path> "p/\x00\x00\x00\x00\x00\x00\x00\x01/applied_lsn"

Output:

$ gitaly db list --db-path <storage-path> --format-keys                                    
"p/1/applied_lsn"
"p/1/kv/raft/cluster/applied_lsn"
"p/1/kv/raft/cluster/cluster"
"p/1/kv/raft/self/storage"
"partition_id_seq"

$ gitaly db list  --db-path <storage-path>                            
"p/\x00\x00\x00\x00\x00\x00\x00\x01/applied_lsn"
"p/\x00\x00\x00\x00\x00\x00\x00\x01/kv/raft/cluster/applied_lsn"
"p/\x00\x00\x00\x00\x00\x00\x00\x01/kv/raft/cluster/cluster"
"p/\x00\x00\x00\x00\x00\x00\x00\x01/kv/raft/self/storage"
"partition_id_seq"

Closes #6134 (closed)

Edited by Divya Rani

Merge request reports

Loading