portworx / kvdb

Generic Key-Value interface
Apache License 2.0
40 stars 12 forks source link

kvdb quorum check #89

Closed sangleganesh closed 4 years ago

sangleganesh commented 4 years ago
  1. fatalCB change:

    • callback function passed an error allowing more to be passed to clients.
  2. on CAD/CAS errors:

    • call fatalCB
    • return the error since fatalCB may not abort the process.
  3. lock/unlock refresh errors:

    • call fatalCB with LockRefresh error. This allows client app to decide if to continue or abort.
    • stop refreshing if unlock fails and return success.
  4. Wrappers:

    • add a wrapper interface for log, which simply logs the input/output.
    • add a wrapper interface for quorum check.
    • allows setting kvdb state to quorum/no-quorum
    • when state is quorum - all calls go to wrapped kvdb
    • when not in quorum - call is immediately returned with kvdb not in quorum error.
    • add UTs
  5. Add error type to be returned when watch is closed because required indexes have been compacted (for etcd for example).

codecov-io commented 4 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@a0108bd). Click here to learn what that means. The diff coverage is 37.03%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #89   +/-   ##
=========================================
  Coverage          ?   69.85%           
=========================================
  Files             ?        7           
  Lines             ?     3473           
  Branches          ?        0           
=========================================
  Hits              ?     2426           
  Misses            ?      824           
  Partials          ?      223
Impacted Files Coverage Δ
common/common.go 15% <0%> (ø)
consul/kv_consul.go 73.03% <100%> (ø)
etcd/v2/kv_etcd.go 68.45% <100%> (ø)
consul/client.go 73.3% <100%> (ø)
zookeeper/kv_zookeeper.go 69.25% <100%> (ø)
etcd/v3/kv_etcd.go 68.99% <27.77%> (ø)

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 a0108bd...5c3d0d7. Read the comment docs.

sangleganesh commented 4 years ago

Closing the big PR and making smaller PR #90 and then a separate on for quorum checks.