Skip to content

Commit

Permalink
Fixed redis cache to use multi batch size (thanos-io#5893)
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Ryabov <[email protected]>

Signed-off-by: Ivan Ryabov <[email protected]>
  • Loading branch information
abbyssoul authored and Nathaniel Graham committed May 18, 2023
1 parent f2550cd commit 962c032
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
## Unreleased

### Fixed

- [#5844](https://github.com/thanos-io/thanos/pull/5844) Query Frontend: Fixes @ modifier time range when splitting queries by interval.
- [#5854](https://github.com/thanos-io/thanos/pull/5854) Query Frontend: Handles `lookback_delta` param in query frontend.
- [#5230](https://github.com/thanos-io/thanos/pull/5230) Rule: Stateless ruler support restoring `for` state from query API servers. The query API servers should be able to access the remote write storage.
- [#5880](https://github.com/thanos-io/thanos/pull/5880) Query Frontend: Fixes some edge cases of query sharding analysis.
- [#5893](https://github.com/thanos-io/thanos/pull/5893) Cache: fixed redis client not respecting `SetMultiBatchSize` config value.

### Added

Expand Down
3 changes: 2 additions & 1 deletion pkg/cacheutil/redis_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,9 @@ func (c *RedisClient) SetMulti(ctx context.Context, data map[string][]byte, ttl
keys = append(keys, k)
}
err := doWithBatch(ctx, len(data), c.config.SetMultiBatchSize, c.setMultiGate, func(startIndex, endIndex int) error {
currentKeys := keys[startIndex:endIndex]
_, err := c.Pipelined(ctx, func(p redis.Pipeliner) error {
for _, key := range keys {
for _, key := range currentKeys {
p.SetEX(ctx, key, data[key], ttl)
}
return nil
Expand Down

0 comments on commit 962c032

Please sign in to comment.