protect assignment of warmup epoch with the mutex
This commit is contained in:
parent
6cc2112749
commit
83c30dc4c0
@ -118,8 +118,8 @@ type SplitStore struct {
|
|||||||
cfg *Config
|
cfg *Config
|
||||||
|
|
||||||
mx sync.Mutex
|
mx sync.Mutex
|
||||||
baseEpoch abi.ChainEpoch
|
warmupEpoch abi.ChainEpoch // protected by mx
|
||||||
warmupEpoch abi.ChainEpoch
|
baseEpoch abi.ChainEpoch // protected by compaction lock
|
||||||
|
|
||||||
coldPurgeSize int
|
coldPurgeSize int
|
||||||
|
|
||||||
@ -737,7 +737,9 @@ func (s *SplitStore) doWarmup(curTs *types.TipSet) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("error saving warm up epoch: %w", err)
|
return xerrors.Errorf("error saving warm up epoch: %w", err)
|
||||||
}
|
}
|
||||||
|
s.mx.Lock()
|
||||||
s.warmupEpoch = epoch
|
s.warmupEpoch = epoch
|
||||||
|
s.mx.Unlock()
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user