From be5adbfda478efa11f2a1b3653e34c441d025386 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 22 Jan 2020 12:30:33 +0200 Subject: [PATCH] vendor: update github.com/VictoriaMetrics/fastcache from v1.5.5 to v1.5.7 --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/VictoriaMetrics/fastcache/file.go | 12 +++++++++++- vendor/modules.txt | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index a321b0516..6b776816a 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/VictoriaMetrics/VictoriaMetrics require ( cloud.google.com/go v0.51.0 // indirect cloud.google.com/go/storage v1.5.0 - github.com/VictoriaMetrics/fastcache v1.5.5 + github.com/VictoriaMetrics/fastcache v1.5.7 github.com/VictoriaMetrics/metrics v1.9.3 github.com/aws/aws-sdk-go v1.28.3 github.com/cespare/xxhash/v2 v2.1.1 diff --git a/go.sum b/go.sum index 10c552a10..5897de9c0 100644 --- a/go.sum +++ b/go.sum @@ -26,8 +26,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7 github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/VictoriaMetrics/fastcache v1.5.5 h1:HsBlzPgzKG0566YOl1mmfyz8SCU0zLKfbl9RDLsiLD8= -github.com/VictoriaMetrics/fastcache v1.5.5/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= +github.com/VictoriaMetrics/fastcache v1.5.7 h1:4y6y0G8PRzszQUYIQHHssv/jgPHAb5qQuuDNdCbyAgw= +github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= github.com/VictoriaMetrics/metrics v1.9.3 h1:+1kZnOIb8RY825Nb9q9yMrPcOYuPE2GrZWxUh59XnHI= github.com/VictoriaMetrics/metrics v1.9.3/go.mod h1:LU2j9qq7xqZYXz8tF3/RQnB2z2MbZms5TDiIg9/NHiQ= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= diff --git a/vendor/github.com/VictoriaMetrics/fastcache/file.go b/vendor/github.com/VictoriaMetrics/fastcache/file.go index 027c418f8..bab5484e8 100644 --- a/vendor/github.com/VictoriaMetrics/fastcache/file.go +++ b/vendor/github.com/VictoriaMetrics/fastcache/file.go @@ -118,7 +118,7 @@ func (c *Cache) save(dir string, workersCount int) error { var err error for i := 0; i < workersCount; i++ { result := <-results - if result != nil && err != nil { + if result != nil && err == nil { err = result } } @@ -173,6 +173,16 @@ func load(filePath string, maxBytes int) (*Cache, error) { if err != nil { return nil, err } + // Initialize buckets, which could be missing due to incomplete or corrupted files in the cache. + // It is better initializing such buckets instead of returning error, since the rest of buckets + // contain valid data. + for i := range c.buckets[:] { + b := &c.buckets[i] + if len(b.chunks) == 0 { + b.chunks = make([][]byte, maxBucketChunks) + b.m = make(map[uint64]uint64) + } + } return &c, nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index ca7037f2c..8bda05681 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -10,7 +10,7 @@ cloud.google.com/go/internal/version cloud.google.com/go/storage # github.com/BurntSushi/toml v0.3.1 github.com/BurntSushi/toml -# github.com/VictoriaMetrics/fastcache v1.5.5 +# github.com/VictoriaMetrics/fastcache v1.5.7 github.com/VictoriaMetrics/fastcache # github.com/VictoriaMetrics/metrics v1.9.3 github.com/VictoriaMetrics/metrics