Fix race in shard
engine was accessed outside of an RLock which can cause a race when montitoring goroutines access the shard while it's closed/closing.pull/8370/head
parent
ef6b0e214b
commit
041262af0e
|
@ -958,10 +958,14 @@ func (s *Shard) CreateSnapshot() (string, error) {
|
|||
}
|
||||
|
||||
func (s *Shard) ForEachMeasurementTagKey(name []byte, fn func(key []byte) error) error {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
return s.engine.ForEachMeasurementTagKey(name, fn)
|
||||
}
|
||||
|
||||
func (s *Shard) TagKeyCardinality(name, key []byte) int {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
return s.engine.TagKeyCardinality(name, key)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue