Improve stateDB reliability

- Close StateDB when stopping the node
- Lock the StateDB when doing checkpoints to avoid multiple instances of
  oppening the pebble DB at the same time.
This commit is contained in:
Eduard S
2021-02-01 16:00:16 +01:00
parent f0886b3d2a
commit 8517e6afa0
4 changed files with 45 additions and 14 deletions

View File

@@ -655,4 +655,10 @@ func (n *Node) Stop() {
log.Info("Stopping Coordinator...")
n.coord.Stop()
}
// Close kv DBs
n.sync.StateDB().Close()
if n.mode == ModeCoordinator {
n.coord.TxSelector().LocalAccountsDB().Close()
n.coord.BatchBuilder().LocalStateDB().Close()
}
}