diff --git a/storage/remote/ewma.go b/storage/remote/ewma.go index d974bc3bb..82b6dd101 100644 --- a/storage/remote/ewma.go +++ b/storage/remote/ewma.go @@ -29,8 +29,10 @@ type ewmaRate struct { mutex sync.Mutex } -func newEWMARate(alpha float64, interval time.Duration) ewmaRate { - return ewmaRate{ +// newEWMARate always allocates a new ewmaRate, as this guarantees the atomically +// accessed int64 will be aligned on ARM. See prometheus#2666. +func newEWMARate(alpha float64, interval time.Duration) *ewmaRate { + return &ewmaRate{ alpha: alpha, interval: interval, } diff --git a/storage/remote/queue_manager.go b/storage/remote/queue_manager.go index ad462d176..6813566a4 100644 --- a/storage/remote/queue_manager.go +++ b/storage/remote/queue_manager.go @@ -185,7 +185,7 @@ type QueueManager struct { quit chan struct{} wg sync.WaitGroup - samplesIn, samplesOut, samplesOutDuration ewmaRate + samplesIn, samplesOut, samplesOutDuration *ewmaRate integralAccumulator float64 }