Skip to content
This repository has been archived by the owner on Jul 15, 2018. It is now read-only.

STALLED: db: add BadgerDB #58

Closed
wants to merge 5 commits into from
Closed

STALLED: db: add BadgerDB #58

wants to merge 5 commits into from

Commits on Nov 4, 2017

  1. db: add BadgerDB

    Updates #30
    
    Adds a backend for BadgerDB as requested at
    #30 (comment)
    and tests for it along.
    
    BadgerDB has a few problems:
    a) It doesn't have a BatchDelete, our fallback is thus Delete
    because if do DeleteAsync, by the time batch.Write is invoked,
    we can't be sure that the deletions have ran
    b) Retrieving values from iterators requires a secondary allocation
    equal to the length of the current key.
    See https://godoc.org/github.com/dgraph-io/badger#KV.NewIterator
    c) It seems to have arbitrary options for the size of the
    log file varying between 10MB to 2GB. Currently with our
    DB API, we can't pass in the required file size unless we
    invoke:
    ```go
    db.NewBadgerDBWithOptions(&db.Options{
      ValueLogFileSize: desiredFileSize,
    })
    ```
    
    Anyways, I've arbitrarily set the default value log file size to 1GB
    given that Tendermint does a whole lot of heavy lifting with
    keyvalue stores <-- cite my sources
    odeke-em authored and melekes committed Nov 4, 2017
    Configuration menu
    Copy the full SHA
    dce7cab View commit details
    Browse the repository at this point in the history
  2. update deps

    melekes committed Nov 4, 2017
    Configuration menu
    Copy the full SHA
    ac4290b View commit details
    Browse the repository at this point in the history
  3. make tests pass

    TODO:
    - IteratorPrefix does not count in prefix
    - badgerDBIterator#Error should return err from Key() or Value()
    melekes committed Nov 4, 2017
    Configuration menu
    Copy the full SHA
    2a54ceb View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2017

  1. db/BadgerDB: fix *vet feedback from previous commits + Iter.lastErr

    Fixed the code + tests to conform to *vet warnings
    and also add a getter and setter for badgerDBIterator's
    lastErr.
    
    Thanks to @melekes for the suggestions.
    odeke-em committed Nov 5, 2017
    Configuration menu
    Copy the full SHA
    534cd7b View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2017

  1. db/BadgerDB: add common benchmarks vs GoLevelDB + latest v0.1

    Uncovered dgraph-io/badger#308
    which perhaps will require us to use the latest BadgerDB
    since they no longer use v0.8(which we started with)
    plus until that issue is resolved, our benchmarks are invalid
    or spuriously error out.
    odeke-em committed Nov 6, 2017
    Configuration menu
    Copy the full SHA
    dfe935f View commit details
    Browse the repository at this point in the history