Skip to content

Commit 8f05aef

Browse files
authored
Merge branch 'master' into ndyakov/token-based-auth
2 parents cff6b9b + 42c3284 commit 8f05aef

File tree

32 files changed

+407
-48
lines changed

32 files changed

+407
-48
lines changed

.github/actions/run-tests/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ runs:
2525
2626
# Mapping of redis version to redis testing containers
2727
declare -A redis_version_mapping=(
28-
["8.0-RC2"]="8.0-RC2-pre"
28+
["8.0.1"]="8.0.1-pre"
2929
["7.4.2"]="rs-7.4.0-v2"
3030
["7.2.7"]="rs-7.2.0-v14"
3131
)

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Go
22

33
on:
44
push:
5-
branches: [master, v9, v9.7]
5+
branches: [master, v9, v9.7, v9.8]
66
pull_request:
7-
branches: [master, v9, v9.7]
7+
branches: [master, v9, v9.7, v9.8]
88

99
permissions:
1010
contents: read
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
redis-version:
21-
- "8.0-RC2" # 8.0 RC2
21+
- "8.0.1" # 8.0.1
2222
- "7.4.2" # should use redis stack 7.4
2323
go-version:
2424
- "1.23.x"
@@ -43,7 +43,7 @@ jobs:
4343
4444
# Mapping of redis version to redis testing containers
4545
declare -A redis_version_mapping=(
46-
["8.0-RC2"]="8.0-RC2-pre"
46+
["8.0.1"]="8.0.1-pre"
4747
["7.4.2"]="rs-7.4.0-v2"
4848
)
4949
if [[ -v redis_version_mapping[$REDIS_VERSION] ]]; then
@@ -72,7 +72,7 @@ jobs:
7272
fail-fast: false
7373
matrix:
7474
redis-version:
75-
- "8.0-RC2" # 8.0 RC2
75+
- "8.0.1" # 8.0.1
7676
- "7.4.2" # should use redis stack 7.4
7777
- "7.2.7" # should redis stack 7.2
7878
go-version:

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master ]
16+
branches: [master, v9, v9.7, v9.8]
1717
pull_request:
18-
# The branches below must be a subset of the branches above
19-
branches: [ master ]
18+
branches: [master, v9, v9.7, v9.8]
2019

2120
jobs:
2221
analyze:

.github/workflows/golangci-lint.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- master
99
- main
1010
- v9
11+
- v9.8
1112
pull_request:
1213

1314
permissions:
@@ -21,7 +22,7 @@ jobs:
2122
steps:
2223
- uses: actions/checkout@v4
2324
- name: golangci-lint
24-
uses: golangci/golangci-lint-action@v7.0.0
25+
uses: golangci/golangci-lint-action@v8.0.0
2526
with:
2627
verify: true
2728

.github/workflows/test-redis-enterprise.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: RE Tests
22

33
on:
44
push:
5-
branches: [master]
5+
branches: [master, v9, v9.7, v9.8]
66
pull_request:
77

88
permissions:

RELEASE-NOTES.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Release Notes
2+
3+
# 9.8.0 (2025-04-30)
4+
5+
## 🚀 Highlights
6+
- **Redis 8 Support**: Full compatibility with Redis 8.0, including testing and CI integration
7+
- **Enhanced Hash Operations**: Added support for new hash commands (`HGETDEL`, `HGETEX`, `HSETEX`) and `HSTRLEN` command
8+
- **Search Improvements**: Enabled Search DIALECT 2 by default and added `CountOnly` argument for `FT.Search`
9+
10+
## ✨ New Features
11+
- Added support for new hash commands: `HGETDEL`, `HGETEX`, `HSETEX` ([#3305](https://github.com/redis/go-redis/pull/3305))
12+
- Added `HSTRLEN` command for hash operations ([#2843](https://github.com/redis/go-redis/pull/2843))
13+
- Added `Do` method for raw query by single connection from `pool.Conn()` ([#3182](https://github.com/redis/go-redis/pull/3182))
14+
- Prevent false-positive marshaling by treating zero time.Time as empty in isEmptyValue ([#3273](https://github.com/redis/go-redis/pull/3273))
15+
- Added FailoverClusterClient support for Universal client ([#2794](https://github.com/redis/go-redis/pull/2794))
16+
- Added support for cluster mode with `IsClusterMode` config parameter ([#3255](https://github.com/redis/go-redis/pull/3255))
17+
- Added client name support in `HELLO` RESP handshake ([#3294](https://github.com/redis/go-redis/pull/3294))
18+
- **Enabled Search DIALECT 2 by default** ([#3213](https://github.com/redis/go-redis/pull/3213))
19+
- Added read-only option for failover configurations ([#3281](https://github.com/redis/go-redis/pull/3281))
20+
- Added `CountOnly` argument for `FT.Search` to use `LIMIT 0 0` ([#3338](https://github.com/redis/go-redis/pull/3338))
21+
- Added `DB` option support in `NewFailoverClusterClient` ([#3342](https://github.com/redis/go-redis/pull/3342))
22+
- Added `nil` check for the options when creating a client ([#3363](https://github.com/redis/go-redis/pull/3363))
23+
24+
## 🐛 Bug Fixes
25+
- Fixed `PubSub` concurrency safety issues ([#3360](https://github.com/redis/go-redis/pull/3360))
26+
- Fixed panic caused when argument is `nil` ([#3353](https://github.com/redis/go-redis/pull/3353))
27+
- Improved error handling when fetching master node from sentinels ([#3349](https://github.com/redis/go-redis/pull/3349))
28+
- Fixed connection pool timeout issues and increased retries ([#3298](https://github.com/redis/go-redis/pull/3298))
29+
- Fixed context cancellation error leading to connection spikes on Primary instances ([#3190](https://github.com/redis/go-redis/pull/3190))
30+
- Fixed RedisCluster client to consider `MASTERDOWN` a retriable error ([#3164](https://github.com/redis/go-redis/pull/3164))
31+
- Fixed tracing to show complete commands instead of truncated versions ([#3290](https://github.com/redis/go-redis/pull/3290))
32+
- Fixed OpenTelemetry instrumentation to prevent multiple span reporting ([#3168](https://github.com/redis/go-redis/pull/3168))
33+
- Fixed `FT.Search` Limit argument and added `CountOnly` argument for limit 0 0 ([#3338](https://github.com/redis/go-redis/pull/3338))
34+
- Fixed missing command in interface ([#3344](https://github.com/redis/go-redis/pull/3344))
35+
- Fixed slot calculation for `COUNTKEYSINSLOT` command ([#3327](https://github.com/redis/go-redis/pull/3327))
36+
- Updated PubSub implementation with correct context ([#3329](https://github.com/redis/go-redis/pull/3329))
37+
38+
## 📚 Documentation
39+
- Added hash search examples ([#3357](https://github.com/redis/go-redis/pull/3357))
40+
- Fixed documentation comments ([#3351](https://github.com/redis/go-redis/pull/3351))
41+
- Added `CountOnly` search example ([#3345](https://github.com/redis/go-redis/pull/3345))
42+
- Added examples for list commands: `LLEN`, `LPOP`, `LPUSH`, `LRANGE`, `RPOP`, `RPUSH` ([#3234](https://github.com/redis/go-redis/pull/3234))
43+
- Added `SADD` and `SMEMBERS` command examples ([#3242](https://github.com/redis/go-redis/pull/3242))
44+
- Updated `README.md` to use Redis Discord guild ([#3331](https://github.com/redis/go-redis/pull/3331))
45+
- Updated `HExpire` command documentation ([#3355](https://github.com/redis/go-redis/pull/3355))
46+
- Featured OpenTelemetry instrumentation more prominently ([#3316](https://github.com/redis/go-redis/pull/3316))
47+
- Updated `README.md` with additional information ([#310ce55](https://github.com/redis/go-redis/commit/310ce55))
48+
49+
## ⚡ Performance and Reliability
50+
- Bound connection pool background dials to configured dial timeout ([#3089](https://github.com/redis/go-redis/pull/3089))
51+
- Ensured context isn't exhausted via concurrent query ([#3334](https://github.com/redis/go-redis/pull/3334))
52+
53+
## 🔧 Dependencies and Infrastructure
54+
- Updated testing image to Redis 8.0-RC2 ([#3361](https://github.com/redis/go-redis/pull/3361))
55+
- Enabled CI for Redis CE 8.0 ([#3274](https://github.com/redis/go-redis/pull/3274))
56+
- Updated various dependencies:
57+
- Bumped golangci/golangci-lint-action from 6.5.0 to 7.0.0 ([#3354](https://github.com/redis/go-redis/pull/3354))
58+
- Bumped rojopolis/spellcheck-github-actions ([#3336](https://github.com/redis/go-redis/pull/3336))
59+
- Bumped golang.org/x/net in example/otel ([#3308](https://github.com/redis/go-redis/pull/3308))
60+
- Migrated golangci-lint configuration to v2 format ([#3354](https://github.com/redis/go-redis/pull/3354))
61+
62+
## ⚠️ Breaking Changes
63+
- **Enabled Search DIALECT 2 by default** ([#3213](https://github.com/redis/go-redis/pull/3213))
64+
- Dropped RedisGears (Triggers and Functions) support ([#3321](https://github.com/redis/go-redis/pull/3321))
65+
- Dropped FT.PROFILE command that was never enabled ([#3323](https://github.com/redis/go-redis/pull/3323))
66+
67+
## 🔒 Security
68+
- Fixed network error handling on SETINFO (CVE-2025-29923) ([#3295](https://github.com/redis/go-redis/pull/3295))
69+
70+
## 🧪 Testing
71+
- Added integration tests for Redis 8 behavior changes in Redis Search ([#3337](https://github.com/redis/go-redis/pull/3337))
72+
- Added vector types INT8 and UINT8 tests ([#3299](https://github.com/redis/go-redis/pull/3299))
73+
- Added test codes for search_commands.go ([#3285](https://github.com/redis/go-redis/pull/3285))
74+
- Fixed example test sorting ([#3292](https://github.com/redis/go-redis/pull/3292))
75+
76+
## 👥 Contributors
77+
78+
We would like to thank all the contributors who made this release possible:
79+
80+
[@alexander-menshchikov](https://github.com/alexander-menshchikov), [@EXPEbdodla](https://github.com/EXPEbdodla), [@afti](https://github.com/afti), [@dmaier-redislabs](https://github.com/dmaier-redislabs), [@four_leaf_clover](https://github.com/four_leaf_clover), [@alohaglenn](https://github.com/alohaglenn), [@gh73962](https://github.com/gh73962), [@justinmir](https://github.com/justinmir), [@LINKIWI](https://github.com/LINKIWI), [@liushuangbill](https://github.com/liushuangbill), [@golang88](https://github.com/golang88), [@gnpaone](https://github.com/gnpaone), [@ndyakov](https://github.com/ndyakov), [@nikolaydubina](https://github.com/nikolaydubina), [@oleglacto](https://github.com/oleglacto), [@andy-stark-redis](https://github.com/andy-stark-redis), [@rodneyosodo](https://github.com/rodneyosodo), [@dependabot](https://github.com/dependabot), [@rfyiamcool](https://github.com/rfyiamcool), [@frankxjkuang](https://github.com/frankxjkuang), [@fukua95](https://github.com/fukua95), [@soleymani-milad](https://github.com/soleymani-milad), [@ofekshenawa](https://github.com/ofekshenawa), [@khasanovbi](https://github.com/khasanovbi)

example/del-keys-without-ttl/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.18
55
replace github.com/redis/go-redis/v9 => ../..
66

77
require (
8-
github.com/redis/go-redis/v9 v9.8.0-beta.1
8+
github.com/redis/go-redis/v9 v9.8.0
99
go.uber.org/zap v1.24.0
1010
)
1111

example/hll/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
replace github.com/redis/go-redis/v9 => ../..
66

7-
require github.com/redis/go-redis/v9 v9.8.0-beta.1
7+
require github.com/redis/go-redis/v9 v9.8.0
88

99
require (
1010
github.com/cespare/xxhash/v2 v2.3.0 // indirect

example/hset-struct/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ replace github.com/redis/go-redis/v9 => ../..
66

77
require (
88
github.com/davecgh/go-spew v1.1.1
9-
github.com/redis/go-redis/v9 v9.8.0-beta.1
9+
github.com/redis/go-redis/v9 v9.8.0
1010
)
1111

1212
require (

example/lua-scripting/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
replace github.com/redis/go-redis/v9 => ../..
66

7-
require github.com/redis/go-redis/v9 v9.8.0-beta.1
7+
require github.com/redis/go-redis/v9 v9.8.0
88

99
require (
1010
github.com/cespare/xxhash/v2 v2.3.0 // indirect

example/otel/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ replace github.com/redis/go-redis/extra/redisotel/v9 => ../../extra/redisotel
1111
replace github.com/redis/go-redis/extra/rediscmd/v9 => ../../extra/rediscmd
1212

1313
require (
14-
github.com/redis/go-redis/extra/redisotel/v9 v9.8.0-beta.1
15-
github.com/redis/go-redis/v9 v9.8.0-beta.1
14+
github.com/redis/go-redis/extra/redisotel/v9 v9.8.0
15+
github.com/redis/go-redis/v9 v9.8.0
1616
github.com/uptrace/uptrace-go v1.21.0
1717
go.opentelemetry.io/otel v1.22.0
1818
)
@@ -25,7 +25,7 @@ require (
2525
github.com/go-logr/stdr v1.2.2 // indirect
2626
github.com/golang/protobuf v1.5.3 // indirect
2727
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
28-
github.com/redis/go-redis/extra/rediscmd/v9 v9.8.0-beta.1 // indirect
28+
github.com/redis/go-redis/extra/rediscmd/v9 v9.8.0 // indirect
2929
go.opentelemetry.io/contrib/instrumentation/runtime v0.46.1 // indirect
3030
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0 // indirect
3131
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect

example/redis-bloom/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
replace github.com/redis/go-redis/v9 => ../..
66

7-
require github.com/redis/go-redis/v9 v9.8.0-beta.1
7+
require github.com/redis/go-redis/v9 v9.8.0
88

99
require (
1010
github.com/cespare/xxhash/v2 v2.3.0 // indirect

example/scan-struct/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ replace github.com/redis/go-redis/v9 => ../..
66

77
require (
88
github.com/davecgh/go-spew v1.1.1
9-
github.com/redis/go-redis/v9 v9.8.0-beta.1
9+
github.com/redis/go-redis/v9 v9.8.0
1010
)
1111

1212
require (

extra/rediscensus/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ replace github.com/redis/go-redis/v9 => ../..
77
replace github.com/redis/go-redis/extra/rediscmd/v9 => ../rediscmd
88

99
require (
10-
github.com/redis/go-redis/extra/rediscmd/v9 v9.8.0-beta.1
11-
github.com/redis/go-redis/v9 v9.8.0-beta.1
10+
github.com/redis/go-redis/extra/rediscmd/v9 v9.8.0
11+
github.com/redis/go-redis/v9 v9.8.0
1212
go.opencensus.io v0.24.0
1313
)
1414

extra/rediscmd/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ replace github.com/redis/go-redis/v9 => ../..
77
require (
88
github.com/bsm/ginkgo/v2 v2.12.0
99
github.com/bsm/gomega v1.27.10
10-
github.com/redis/go-redis/v9 v9.8.0-beta.1
10+
github.com/redis/go-redis/v9 v9.8.0
1111
)
1212

1313
require (

extra/redisotel/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ replace github.com/redis/go-redis/v9 => ../..
77
replace github.com/redis/go-redis/extra/rediscmd/v9 => ../rediscmd
88

99
require (
10-
github.com/redis/go-redis/extra/rediscmd/v9 v9.8.0-beta.1
11-
github.com/redis/go-redis/v9 v9.8.0-beta.1
10+
github.com/redis/go-redis/extra/rediscmd/v9 v9.8.0
11+
github.com/redis/go-redis/v9 v9.8.0
1212
go.opentelemetry.io/otel v1.22.0
1313
go.opentelemetry.io/otel/metric v1.22.0
1414
go.opentelemetry.io/otel/sdk v1.22.0

extra/redisotel/metrics.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,22 @@ func reportPoolStats(rdb *redis.Client, conf *config) error {
127127
return err
128128
}
129129

130+
hits, err := conf.meter.Int64ObservableUpDownCounter(
131+
"db.client.connections.hits",
132+
metric.WithDescription("The number of times free connection was found in the pool"),
133+
)
134+
if err != nil {
135+
return err
136+
}
137+
138+
misses, err := conf.meter.Int64ObservableUpDownCounter(
139+
"db.client.connections.misses",
140+
metric.WithDescription("The number of times free connection was not found in the pool"),
141+
)
142+
if err != nil {
143+
return err
144+
}
145+
130146
redisConf := rdb.Options()
131147
_, err = conf.meter.RegisterCallback(
132148
func(ctx context.Context, o metric.Observer) error {
@@ -140,13 +156,17 @@ func reportPoolStats(rdb *redis.Client, conf *config) error {
140156
o.ObserveInt64(usage, int64(stats.TotalConns-stats.IdleConns), metric.WithAttributes(usedAttrs...))
141157

142158
o.ObserveInt64(timeouts, int64(stats.Timeouts), metric.WithAttributes(labels...))
159+
o.ObserveInt64(hits, int64(stats.Hits), metric.WithAttributes(labels...))
160+
o.ObserveInt64(misses, int64(stats.Misses), metric.WithAttributes(labels...))
143161
return nil
144162
},
145163
idleMax,
146164
idleMin,
147165
connsMax,
148166
usage,
149167
timeouts,
168+
hits,
169+
misses,
150170
)
151171

152172
return err

extra/redisprometheus/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ replace github.com/redis/go-redis/v9 => ../..
66

77
require (
88
github.com/prometheus/client_golang v1.14.0
9-
github.com/redis/go-redis/v9 v9.8.0-beta.1
9+
github.com/redis/go-redis/v9 v9.8.0
1010
)
1111

1212
require (

helper/helper.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package helper
2+
3+
import "github.com/redis/go-redis/v9/internal/util"
4+
5+
func ParseFloat(s string) (float64, error) {
6+
return util.ParseStringToFloat(s)
7+
}
8+
9+
func MustParseFloat(s string) float64 {
10+
return util.MustParseFloat(s)
11+
}

internal/pool/pool.go

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ var timers = sync.Pool{
3333

3434
// Stats contains pool state information and accumulated stats.
3535
type Stats struct {
36-
Hits uint32 // number of times free connection was found in the pool
37-
Misses uint32 // number of times free connection was NOT found in the pool
38-
Timeouts uint32 // number of times a wait timeout occurred
36+
Hits uint32 // number of times free connection was found in the pool
37+
Misses uint32 // number of times free connection was NOT found in the pool
38+
Timeouts uint32 // number of times a wait timeout occurred
39+
WaitCount uint32 // number of times a connection was waited
40+
WaitDurationNs int64 // total time spent for waiting a connection in nanoseconds
3941

4042
TotalConns uint32 // number of total connections in the pool
4143
IdleConns uint32 // number of idle connections in the pool
@@ -90,7 +92,8 @@ type ConnPool struct {
9092
poolSize int
9193
idleConnsLen int
9294

93-
stats Stats
95+
stats Stats
96+
waitDurationNs atomic.Int64
9497

9598
_closed uint32 // atomic
9699
}
@@ -320,6 +323,7 @@ func (p *ConnPool) waitTurn(ctx context.Context) error {
320323
default:
321324
}
322325

326+
start := time.Now()
323327
timer := timers.Get().(*time.Timer)
324328
timer.Reset(p.cfg.PoolTimeout)
325329

@@ -331,6 +335,8 @@ func (p *ConnPool) waitTurn(ctx context.Context) error {
331335
timers.Put(timer)
332336
return ctx.Err()
333337
case p.queue <- struct{}{}:
338+
p.waitDurationNs.Add(time.Since(start).Nanoseconds())
339+
atomic.AddUint32(&p.stats.WaitCount, 1)
334340
if !timer.Stop() {
335341
<-timer.C
336342
}
@@ -457,9 +463,11 @@ func (p *ConnPool) IdleLen() int {
457463

458464
func (p *ConnPool) Stats() *Stats {
459465
return &Stats{
460-
Hits: atomic.LoadUint32(&p.stats.Hits),
461-
Misses: atomic.LoadUint32(&p.stats.Misses),
462-
Timeouts: atomic.LoadUint32(&p.stats.Timeouts),
466+
Hits: atomic.LoadUint32(&p.stats.Hits),
467+
Misses: atomic.LoadUint32(&p.stats.Misses),
468+
Timeouts: atomic.LoadUint32(&p.stats.Timeouts),
469+
WaitCount: atomic.LoadUint32(&p.stats.WaitCount),
470+
WaitDurationNs: p.waitDurationNs.Load(),
463471

464472
TotalConns: uint32(p.Len()),
465473
IdleConns: uint32(p.IdleLen()),

0 commit comments

Comments
 (0)