mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Align int64s for atomic operations
This commit is contained in:
parent
d4bd3397ae
commit
112a778922
|
@ -23,12 +23,14 @@ type fpMappings map[clientmodel.Fingerprint]map[string]clientmodel.Fingerprint
|
||||||
// fpMapper is used to map fingerprints in order to work around fingerprint
|
// fpMapper is used to map fingerprints in order to work around fingerprint
|
||||||
// collisions.
|
// collisions.
|
||||||
type fpMapper struct {
|
type fpMapper struct {
|
||||||
|
// highestMappedFP has to be aligned for atomic operations.
|
||||||
|
highestMappedFP clientmodel.Fingerprint
|
||||||
|
|
||||||
mtx sync.RWMutex // Protects mappings.
|
mtx sync.RWMutex // Protects mappings.
|
||||||
mappings fpMappings
|
mappings fpMappings
|
||||||
|
|
||||||
fpToSeries *seriesMap
|
fpToSeries *seriesMap
|
||||||
p *persistence
|
p *persistence
|
||||||
highestMappedFP clientmodel.Fingerprint
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// newFPMapper loads the collision map from the persistence and
|
// newFPMapper loads the collision map from the persistence and
|
||||||
|
|
|
@ -79,6 +79,11 @@ const (
|
||||||
type syncStrategy func() bool
|
type syncStrategy func() bool
|
||||||
|
|
||||||
type memorySeriesStorage struct {
|
type memorySeriesStorage struct {
|
||||||
|
// numChunksToPersist has to be aligned for atomic operations.
|
||||||
|
numChunksToPersist int64 // The number of chunks waiting for persistence.
|
||||||
|
maxChunksToPersist int // If numChunksToPersist reaches this threshold, ingestion will stall.
|
||||||
|
degraded bool
|
||||||
|
|
||||||
fpLocker *fingerprintLocker
|
fpLocker *fingerprintLocker
|
||||||
fpToSeries *seriesMap
|
fpToSeries *seriesMap
|
||||||
|
|
||||||
|
@ -90,10 +95,6 @@ type memorySeriesStorage struct {
|
||||||
checkpointInterval time.Duration
|
checkpointInterval time.Duration
|
||||||
checkpointDirtySeriesLimit int
|
checkpointDirtySeriesLimit int
|
||||||
|
|
||||||
numChunksToPersist int64 // The number of chunks waiting for persistence.
|
|
||||||
maxChunksToPersist int // If numChunksToPersist reaches this threshold, ingestion will stall.
|
|
||||||
degraded bool
|
|
||||||
|
|
||||||
persistence *persistence
|
persistence *persistence
|
||||||
mapper *fpMapper
|
mapper *fpMapper
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue