From 2ec4485cadba0111a90570102a17d91c8c794a78 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 15 Sep 2021 09:20:11 +0300 Subject: [PATCH] vendor: update github.com/valyala/histogram from v1.1.2 to v1.2.0 in order to fix https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1612 --- go.mod | 2 +- go.sum | 8 ++++---- vendor/github.com/valyala/fastrand/fastrand.go | 5 +++++ vendor/github.com/valyala/histogram/go.mod | 2 +- vendor/github.com/valyala/histogram/go.sum | 4 ++-- vendor/github.com/valyala/histogram/histogram.go | 4 ++++ vendor/modules.txt | 4 ++-- 7 files changed, 19 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index a66c19b..1202ec8 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/VictoriaMetrics/metrics -require github.com/valyala/histogram v1.1.2 +require github.com/valyala/histogram v1.2.0 go 1.12 diff --git a/go.sum b/go.sum index b121944..b94ade6 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ -github.com/valyala/fastrand v1.0.0 h1:LUKT9aKer2dVQNUi3waewTbKV+7H17kvWFNKs2ObdkI= -github.com/valyala/fastrand v1.0.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ= -github.com/valyala/histogram v1.1.2 h1:vOk5VrGjMBIoPR5k6wA8vBaC8toeJ8XO0yfRjFEc1h8= -github.com/valyala/histogram v1.1.2/go.mod h1:CZAr6gK9dbD7hYx2s8WSPh0p5x5wETjC+2b3PJVtEdg= +github.com/valyala/fastrand v1.1.0 h1:f+5HkLW4rsgzdNoleUOB69hyT9IlD2ZQh9GyDMfb5G8= +github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ= +github.com/valyala/histogram v1.2.0 h1:wyYGAZZt3CpwUiIb9AU/Zbllg1llXyrtApRS815OLoQ= +github.com/valyala/histogram v1.2.0/go.mod h1:Hb4kBwb4UxsaNbbbh+RRz8ZR6pdodR57tzWUS3BUzXY= diff --git a/vendor/github.com/valyala/fastrand/fastrand.go b/vendor/github.com/valyala/fastrand/fastrand.go index 3ea9177..8d25b56 100644 --- a/vendor/github.com/valyala/fastrand/fastrand.go +++ b/vendor/github.com/valyala/fastrand/fastrand.go @@ -68,6 +68,11 @@ func (r *RNG) Uint32n(maxN uint32) uint32 { return uint32((uint64(x) * uint64(maxN)) >> 32) } +// Seed sets the r state to n. +func (r *RNG) Seed(n uint32) { + r.x = n +} + func getRandomUint32() uint32 { x := time.Now().UnixNano() return uint32((x >> 32) ^ x) diff --git a/vendor/github.com/valyala/histogram/go.mod b/vendor/github.com/valyala/histogram/go.mod index 984efbe..cc65b00 100644 --- a/vendor/github.com/valyala/histogram/go.mod +++ b/vendor/github.com/valyala/histogram/go.mod @@ -2,4 +2,4 @@ module github.com/valyala/histogram go 1.12 -require github.com/valyala/fastrand v1.0.0 +require github.com/valyala/fastrand v1.1.0 diff --git a/vendor/github.com/valyala/histogram/go.sum b/vendor/github.com/valyala/histogram/go.sum index 2b3e848..c5ca588 100644 --- a/vendor/github.com/valyala/histogram/go.sum +++ b/vendor/github.com/valyala/histogram/go.sum @@ -1,2 +1,2 @@ -github.com/valyala/fastrand v1.0.0 h1:LUKT9aKer2dVQNUi3waewTbKV+7H17kvWFNKs2ObdkI= -github.com/valyala/fastrand v1.0.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ= +github.com/valyala/fastrand v1.1.0 h1:f+5HkLW4rsgzdNoleUOB69hyT9IlD2ZQh9GyDMfb5G8= +github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ= diff --git a/vendor/github.com/valyala/histogram/histogram.go b/vendor/github.com/valyala/histogram/histogram.go index e90dd70..71be2af 100644 --- a/vendor/github.com/valyala/histogram/histogram.go +++ b/vendor/github.com/valyala/histogram/histogram.go @@ -49,6 +49,10 @@ func (f *Fast) Reset() { f.a = nil f.tmp = nil } + // Reset rng state in order to get repeatable results + // for the same sequence of values passed to Fast.Update. + // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1612 + f.rng.Seed(1) } // Update updates the f with v. diff --git a/vendor/modules.txt b/vendor/modules.txt index f915051..3852fff 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/valyala/fastrand v1.0.0 +# github.com/valyala/fastrand v1.1.0 github.com/valyala/fastrand -# github.com/valyala/histogram v1.1.2 +# github.com/valyala/histogram v1.2.0 github.com/valyala/histogram