Skip to content
  • senthil's avatar
    FAB-1233 State DB recovery · c0dc54bd
    senthil authored
    
    
    We need to recover the state DB when
    (i) the peer fails during commit (partial written state).
    (ii) the database gets corrupted.
    
    We introduce a new state in DB called savepoint, and update
    it with the block height once all valid tx in the last/recent block is
    committed.
    
    Whenever peer starts (first boot up or after a failure), we compare the
    savepoint in DB and block height to see whether the state DB is in
    consistent state. If not, we execute the following steps:
    (i) retrieve all required blocks (#blocks = block height - savepoint)
    from block storage,
    (ii) compute write set for valid tx, commits these values, & update the
    savepoint.
    
    Change-Id: I769d1391de511d3cdb55c40692beb829e2cc5c2f
    Signed-off-by: default avatarsenthil <cendhu@gmail.com>
    c0dc54bd