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
|
||||
// collisions.
|
||||
type fpMapper struct {
|
||||
// highestMappedFP has to be aligned for atomic operations.
|
||||
highestMappedFP clientmodel.Fingerprint
|
||||
|
||||
mtx sync.RWMutex // Protects mappings.
|
||||
mappings fpMappings
|
||||
|
||||
fpToSeries *seriesMap
|
||||
p *persistence
|
||||
highestMappedFP clientmodel.Fingerprint
|
||||
fpToSeries *seriesMap
|
||||
p *persistence
|
||||
}
|
||||
|
||||
// newFPMapper loads the collision map from the persistence and
|
||||
|
|
|
@ -79,6 +79,11 @@ const (
|
|||
type syncStrategy func() bool
|
||||
|
||||
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
|
||||
fpToSeries *seriesMap
|
||||
|
||||
|
@ -90,10 +95,6 @@ type memorySeriesStorage struct {
|
|||
checkpointInterval time.Duration
|
||||
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
|
||||
mapper *fpMapper
|
||||
|
||||
|
|
Loading…
Reference in New Issue