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

[storage] Interface Overhaul #251

Merged
merged 6 commits into from
Nov 25, 2020
Merged

Conversation

patrick-ogrady
Copy link
Contributor

@patrick-ogrady patrick-ogrady commented Nov 25, 2020

Related: https://github.com/coinbase/rosetta-sdk-go/tree/patrick/priority-lock

This PR updates the storage interface to provide access to more granular database locking and updates all files in storage to use this new interface.

Future Work

Overhaul BlockStorage, BalanceStorage, and CoinStorage to use WriteTransaction to reduce usage of global locking (i.e. pruning/reconciliation don't need to acquire the global database lock).

@patrick-ogrady patrick-ogrady requested a review from bobg November 25, 2020 17:40
@@ -171,15 +171,15 @@ func PerformanceBadgerOptions(dir string) badger.Options {
// This option will have a significant effect the memory. If the level is kept
// in-memory, read are faster but the tables will be kept in memory. By default,
// this is set to false.
opts.KeepL0InMemory = false
opts.KeepL0InMemory = true
Copy link
Contributor Author

@patrick-ogrady patrick-ogrady Nov 25, 2020

Choose a reason for hiding this comment

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

In practice, we saw this decrease read/write latency. In the future, we should probably write some benchmarks that allow us to compare db config changes more quantitatively.

@coveralls
Copy link

coveralls commented Nov 25, 2020

Pull Request Test Coverage Report for Build 12205

  • 59 of 78 (75.64%) changed or added relevant lines in 9 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 78.604%

Changes Missing Coverage Covered Lines Changed/Added Lines %
storage/badger_storage_configuration.go 0 4 0.0%
storage/badger_storage.go 23 38 60.53%
Totals Coverage Status
Change from base Build 12159: -0.1%
Covered Lines: 7770
Relevant Lines: 9885

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants