mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 07:34:04 -08:00
Merge pull request #727 from prometheus/beorn7/fingerprint
Use an RW lock to checkpoint fingerprint mappings.
This commit is contained in:
commit
c86f5fdfd1
|
@ -141,10 +141,10 @@ func (m *fpMapper) maybeAddMapping(
|
|||
// A new mapping has to be created.
|
||||
mappedFP = m.nextMappedFP()
|
||||
mappedFPs[ms] = mappedFP
|
||||
m.mtx.RLock()
|
||||
m.mtx.Lock()
|
||||
// Checkpoint mappings after each change.
|
||||
err := m.p.checkpointFPMappings(m.mappings)
|
||||
m.mtx.RUnlock()
|
||||
m.mtx.Unlock()
|
||||
log.Infof(
|
||||
"Collision detected for fingerprint %v, metric %v, mapping to new fingerprint %v.",
|
||||
fp, collidingMetric, mappedFP,
|
||||
|
|
Loading…
Reference in a new issue