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

hot/cold blockstore segregation (aka. splitstore) #4992

Merged
merged 150 commits into from
Mar 8, 2021
Merged

Conversation

vyzo
Copy link
Contributor

@vyzo vyzo commented Nov 24, 2020

Fixes #4753.

This is the implementation of splitstore, a hot/cold segregated blockstore that can be enabled with a feature flag.

On top of #5695

How to enable:
In .lotus/config.toml add the following section:

[Chainstore]
  EnableSplitstore = true

TODO:

  • dynamic bloom filter sizing
  • move lmdb support out to a branch, to reduce surface and keep it out of the dependency graph.
  • appropriate options for badger hotstore; it currently uses as the coldstore, but we need to check if those actually make sense and tune; especially verify that value log is GC'ed and what is the correct setting for the GC threshold.
  • batch delete support in blockstores.
  • splitstore unit test.
  • Properly open the Splitstore (not just the Coldstore) in lotus-shed when enabled by the configuration.

Follow up:

chain/store/splitstore.go Outdated Show resolved Hide resolved
chain/store/splitstore.go Outdated Show resolved Hide resolved
Copy link
Member

@raulk raulk left a comment

Choose a reason for hiding this comment

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

Initial sweep; need to delve into the migration logic proper.

chain/store/splitstore/snoop.go Outdated Show resolved Hide resolved
chain/store/splitstore/snoop.go Outdated Show resolved Hide resolved
chain/store/splitstore/splitstore.go Outdated Show resolved Hide resolved
chain/store/splitstore/splitstore.go Outdated Show resolved Hide resolved
chain/store/splitstore/splitstore.go Outdated Show resolved Hide resolved
chain/store/splitstore/splitstore.go Outdated Show resolved Hide resolved
chain/store/splitstore/splitstore.go Outdated Show resolved Hide resolved
chain/store/splitstore/splitstore.go Outdated Show resolved Hide resolved
chain/store/splitstore/splitstore.go Outdated Show resolved Hide resolved
chain/store/splitstore/splitstore.go Outdated Show resolved Hide resolved
chain/store/splitstore/splitstore.go Outdated Show resolved Hide resolved
chain/store/splitstore/splitstore.go Outdated Show resolved Hide resolved
chain/store/splitstore/splitstore.go Outdated Show resolved Hide resolved
@ribasushi
Copy link
Collaborator

@vyzo @raulk from a conversation elsewhere I have the following requirement for this:

I'd want to undo the split in "capture" mode - there must be a way for both cold and hot must write to the same place without an itermediary/delay
this is pretty critical
this doesn't necesarily need to be an exposed config option: for the time being the capture-store needs a few codechanges in lotus anyway, so being ale to replace couple lines in fsrepo is enough for me
the ask is specifically for the interfaces not to diverge too far from the basis ipfs-blockstore one

@vyzo
Copy link
Contributor Author

vyzo commented Jan 26, 2021

we can simply add a config option that disables gc -- you will still use the splitstore, but persist all objects without deleting unreachable ones.

@vyzo vyzo changed the base branch from caching-blockstore to master January 28, 2021 18:03
@vyzo
Copy link
Contributor Author

vyzo commented Jan 28, 2021

RIPed the freecache stuff and rebased directly to master; will fix conflicts.

@ribasushi
Copy link
Collaborator

we can simply add a config option that disables gc -- you will still use the splitstore, but persist all objects without deleting unreachable ones.

For the specific case I need this for this is not relevant: both underlying blockstores need to be exchangeable with a single 3rd party one, in order to allow for synchronous-ish storage. This is why I focus on "keep the interface close enough", as "no code changes" and "use 2 stores" is not an option in my case either way.

@vyzo
Copy link
Contributor Author

vyzo commented Jan 28, 2021

Not sure I follow -- what do you want to exchange? You can simply use the coldstore.

@vyzo
Copy link
Contributor Author

vyzo commented Jan 28, 2021

Also the blockstore interface is not changing.

@vyzo vyzo force-pushed the feat/splitstore branch from 186c052 to 1c41145 Compare March 1, 2021 07:29
@vyzo vyzo changed the base branch from master to feat/segregate-blockstores March 1, 2021 07:30
@vyzo
Copy link
Contributor Author

vyzo commented Mar 1, 2021

rebased on #5695

@vyzo vyzo marked this pull request as ready for review March 1, 2021 07:38
@vyzo vyzo force-pushed the feat/splitstore branch from ce3ff15 to 0a2f2cf Compare March 5, 2021 12:50
@vyzo
Copy link
Contributor Author

vyzo commented Mar 5, 2021

rebased on next and fixed conflict.

Copy link
Contributor

@magik6k magik6k left a comment

Choose a reason for hiding this comment

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

(test lgtm too)

Copy link
Contributor

@arajasek arajasek left a comment

Choose a reason for hiding this comment

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

Broadly makes sense, and running well on my node for a few days

@magik6k magik6k merged commit 6591af9 into next Mar 8, 2021
@magik6k magik6k deleted the feat/splitstore branch March 8, 2021 21:01
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.

6 participants