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

feat: shed: blockstore/vlog to car export cmds #8265

Merged
merged 2 commits into from
Mar 10, 2022
Merged

Conversation

magik6k
Copy link
Contributor

@magik6k magik6k commented Mar 9, 2022

Just some tools to get data out of big badger datastores, and into car files.

@magik6k magik6k requested a review from a team as a code owner March 9, 2022 09:23
@codecov
Copy link

codecov bot commented Mar 9, 2022

Codecov Report

Merging #8265 (ffabb01) into master (5416ce5) will decrease coverage by 0.23%.
The diff coverage is 0.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8265      +/-   ##
==========================================
- Coverage   40.52%   40.29%   -0.24%     
==========================================
  Files         675      676       +1     
  Lines       73524    73878     +354     
==========================================
- Hits        29798    29771      -27     
- Misses      38505    38880     +375     
- Partials     5221     5227       +6     
Impacted Files Coverage Δ
cmd/lotus-shed/datastore-vlog.go 0.00% <0.00%> (ø)
cmd/lotus-shed/datastore.go 0.00% <ø> (ø)
cmd/lotus-shed/export.go 0.00% <0.00%> (ø)
chain/store/snapshot.go 65.04% <100.00%> (+0.69%) ⬆️
chain/actors/builtin/miner/diff.go 48.52% <0.00%> (-10.30%) ⬇️
chain/events/observer.go 71.64% <0.00%> (-6.72%) ⬇️
markets/retrievaladapter/client_blockstore.go 62.50% <0.00%> (-6.25%) ⬇️
node/hello/hello.go 63.63% <0.00%> (-3.41%) ⬇️
miner/miner.go 54.75% <0.00%> (-3.28%) ⬇️
blockstore/buffered.go 34.44% <0.00%> (-2.23%) ⬇️
... and 11 more

Copy link
Contributor

@ZenGround0 ZenGround0 left a comment

Choose a reason for hiding this comment

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

I don't know badger internals so this review is fairly shallow with only some high level fearmongering about repo lock safety. Even without knowing badger the general idea of car to badger seems really nice.

Usage: "convert badger blockstore .vlog to .car",
Flags: []cli.Flag{
&cli.PathFlag{
Name: "vlog",
Copy link
Contributor

Choose a reason for hiding this comment

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

For my own curiosity: what is a badger vlog? I see a bunch of .vlog files under datastore repos. What is the meaning of each vlog subunit? Is it a partition of data based on the key for example?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's basically an append-only (afaiu) k-v write log. The Entry/header structs below tell you more exactly what is in those files


var datastoreVlog2CarCmd = &cli.Command{
Name: "vlog2car",
Usage: "convert badger blockstore .vlog to .car",
Copy link
Contributor

Choose a reason for hiding this comment

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

Any warnings needed about the daemon needing to be turned off as in the following utility?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not seeing any interaction with the repo lock file, any chance for problems if the node is online?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

vlog files are append-only, so that's (probably) fine

@magik6k magik6k merged commit 9ce6a15 into master Mar 10, 2022
@magik6k magik6k deleted the feat/shed-car-tools branch March 10, 2022 22:21
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.

None yet

2 participants