Skip to content

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
// 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