rotationalio / honu

Adaptive consistency replication with reinforcement learning for large scale globally distributed storage.
BSD 3-Clause "New" or "Revised" License
12 stars 2 forks source link

Pickle Fix #9

Closed bbengfort closed 2 years ago

bbengfort commented 2 years ago

This commit fixes a pickle we were in with a production implementation that uses Honu (even though Honu is still in a prototype phase). The following changes were made:

  1. Implementing a basic Transaction interface to ensure that multiple access operations in Put and Delete are consistent.
  2. Implementing a WithNamespace() option to use more than the default namespace.
  3. Returning object metadata from Put and Delete
  4. Updating the leveldb implementation to use a global lock for read/write transactions
  5. Updating the leveldb implementation to use namespace::key prefixes for namespace storage.
codecov[bot] commented 2 years ago

Codecov Report

Merging #9 (2ae77f3) into main (5294643) will increase coverage by 2.14%. The diff coverage is 53.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main       #9      +/-   ##
==========================================
+ Coverage   41.96%   44.10%   +2.14%     
==========================================
  Files           6        6              
  Lines         305      331      +26     
==========================================
+ Hits          128      146      +18     
- Misses        151      155       +4     
- Partials       26       30       +4     
Impacted Files Coverage Δ
honu.go 43.92% <41.37%> (+0.76%) :arrow_up:
options/options.go 92.30% <90.00%> (-7.70%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5294643...2ae77f3. Read the comment docs.

tl6kk commented 2 years ago

Benchmark results before PR #9

BenchmarkHonuGet-8      849062      1427 ns/op
BenchmarkLevelDBGet-8       2105570     569.2 ns/op     
BenchmarkHonuPut-8      15304       74503 ns/op     
BenchmarkLevelDBPut-8       23002       58611 ns/op 
BenchmarkHonuDelete-8       50568       24840 ns/op 
BenchmarkLevelDBDelete-8    283647      4004 ns/op  
BenchmarkHonuIter-8     91710       11033 ns/op     
BenchmarkLevelDBIter-8      464310      2585 ns/op      
BenchmarkHonuObject-8       858931      1358 ns/op  

before

Benchmark results after PR #9

BenchmarkHonuGet-8      816619      1454 ns/op      
BenchmarkLevelDBGet-8       2024266     564.2 ns/op 
BenchmarkHonuPut-8      15522       72811 ns/op 
BenchmarkLevelDBPut-8       23102       58457 ns/op
BenchmarkHonuDelete-8       49892       27404 ns/op 
BenchmarkLevelDBDelete-8    286095      3671 ns/op
BenchmarkHonuIter-8     89802       11757 ns/op
BenchmarkLevelDBIter-8      464150      2548 ns/op
BenchmarkHonuObject-8       804229      1435 ns/op

after

Before - After:

    Honu        LevelDB
Get -27 ns/op   5 ns/op
Put 1692 ns/op  154 ns/op
Delete  -2564 ns/op 333 ns/op
Iter    -724 ns/op  37 ns/op