Consensus WAL uses AutoFile/Group

This commit is contained in:
Jae Kwon
2016-10-28 15:01:14 -07:00
parent 480f44f16c
commit 1788a68b1c
9 changed files with 106 additions and 246 deletions

View File

@ -343,6 +343,7 @@ func (cs *ConsensusState) startRoutines(maxSteps int) {
func (cs *ConsensusState) OnStop() {
cs.BaseService.OnStop()
// Make BaseService.Wait() wait until cs.wal.Wait()
if cs.wal != nil && cs.IsRunning() {
cs.wal.Wait()
}
@ -658,7 +659,7 @@ func (cs *ConsensusState) receiveRoutine(maxSteps int) {
// close wal now that we're done writing to it
if cs.wal != nil {
cs.wal.Close()
cs.wal.Stop()
}
return
}