Skip to content

Commit

Permalink
[FAB-1762] Refactor couchdb history db to leveldb.
Browse files Browse the repository at this point in the history
- Utilize leveldb for history of keys instead of couchdb

- Single leveldb database serves all chains to optimize
  footprint (same structure as leveldb block index database
  and leveldb state database)

- Block commit writes a history key for each key/value
  that is updated in a tran, in the form:
   ns~key~blocknum~trannum

- History database is an index for history of key writes
  over time.  The key values are not included to reduce
  size of database.

- GetHistoryForKey() finds all records starting with ~ns~key
  and returns the transactions that updated the key.

- Subsequent changeset will lookup and return the txid
  and historic value from the block storage.  Client can
  then GetTransactionById to see the historic transactions.

- Since history db size is much reduced, it is now enabled
  by default in core.yaml.

- Upon crash recovery, ledger initialization will ensure
  that both state db and history db in sync with block storage

Reused existing test logic, therefore the changeset
is relatively large to ensure tests still pass.

Change-Id: I79103aa39957f58d246de5b5295fb40a4b9c033b
Signed-off-by: denyeart <enyeart@us.ibm.com>
  • Loading branch information
denyeart committed Jan 26, 2017
1 parent 135d923 commit 2c98262
Show file tree
Hide file tree
Showing 22 changed files with 652 additions and 703 deletions.
260 changes: 0 additions & 260 deletions core/ledger/kvledger/history/histmgr/couchdbhistmgr/couchdb_histmgr.go

This file was deleted.

Loading

0 comments on commit 2c98262

Please sign in to comment.