Skip to content

Commit 9601784

Browse files
authored
Merge branch 'master' into load-balance-search-commands-to-shards
2 parents 23ce91b + 68d8c59 commit 9601784

File tree

29 files changed

+329
-115
lines changed

29 files changed

+329
-115
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
go-version: ${{ matrix.go-version }}
3333

3434
- name: Checkout code
35-
uses: actions/checkout@v5
35+
uses: actions/checkout@v6
3636

3737
- name: Setup Test environment
3838
env:
@@ -83,7 +83,7 @@ jobs:
8383

8484
steps:
8585
- name: Checkout code
86-
uses: actions/checkout@v5
86+
uses: actions/checkout@v6
8787

8888
- name: Run tests
8989
uses: ./.github/actions/run-tests

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
steps:
3737
- name: Checkout repository
38-
uses: actions/checkout@v5
38+
uses: actions/checkout@v6
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL

.github/workflows/doctests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
go-version: ${{ matrix.go-version }}
3737

3838
- name: Checkout code
39-
uses: actions/checkout@v5
39+
uses: actions/checkout@v6
4040

4141
- name: Test doc examples
4242
working-directory: ./doctests

.github/workflows/golangci-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
name: lint
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v5
23+
- uses: actions/checkout@v6
2424
- name: golangci-lint
25-
uses: golangci/golangci-lint-action@v9.0.0
25+
uses: golangci/golangci-lint-action@v9.1.0
2626
with:
2727
verify: true
2828

.github/workflows/spellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- name: Checkout
9-
uses: actions/checkout@v5
9+
uses: actions/checkout@v6
1010
- name: Check Spelling
1111
uses: rojopolis/[email protected]
1212
with:

.github/workflows/stale-issues.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
# First step: Handle regular issues (excluding needs-information)
2222
- name: Mark regular issues as stale
23-
uses: actions/stale@v9
23+
uses: actions/stale@v10
2424
with:
2525
repo-token: ${{ secrets.GITHUB_TOKEN }}
2626

@@ -64,7 +64,7 @@ jobs:
6464

6565
# Second step: Handle needs-information issues with accelerated timeline
6666
- name: Mark needs-information issues as stale
67-
uses: actions/stale@v9
67+
uses: actions/stale@v10
6868
with:
6969
repo-token: ${{ secrets.GITHUB_TOKEN }}
7070

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020

2121
steps:
2222
- name: Checkout code
23-
uses: actions/checkout@v5
23+
uses: actions/checkout@v6
2424

2525
- name: Clone Redis EE docker repository
26-
uses: actions/checkout@v5
26+
uses: actions/checkout@v6
2727
with:
2828
repository: RedisLabs/redis-ee-docker
2929
path: redis-ee

RELEASE-NOTES.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Release Notes
22

3+
# 9.17.1 (2025-11-25)
4+
5+
## 🐛 Bug Fixes
6+
7+
- add wait to keyless commands list ([#3615](https://github.com/redis/go-redis/pull/3615)) by [@marcoferrer](https://github.com/marcoferrer)
8+
- fix(time): remove cached time optimization ([#3611](https://github.com/redis/go-redis/pull/3611)) by [@ndyakov](https://github.com/ndyakov)
9+
10+
## 🧰 Maintenance
11+
12+
- chore(deps): bump golangci/golangci-lint-action from 9.0.0 to 9.1.0 ([#3609](https://github.com/redis/go-redis/pull/3609))
13+
- chore(deps): bump actions/checkout from 5 to 6 ([#3610](https://github.com/redis/go-redis/pull/3610))
14+
- chore(script): fix help call in tag.sh ([#3606](https://github.com/redis/go-redis/pull/3606)) by [@ndyakov](https://github.com/ndyakov)
15+
16+
## Contributors
17+
We'd like to thank all the contributors who worked on this release!
18+
19+
[@marcoferrer](https://github.com/marcoferrer) and [@ndyakov](https://github.com/ndyakov)
20+
21+
---
22+
23+
**Full Changelog**: https://github.com/redis/go-redis/compare/v9.17.0...v9.17.1
24+
325
# 9.17.0 (2025-11-19)
426

527
## 🚀 Highlights

command.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ var keylessCommands = map[string]struct{}{
6565
"sync": {},
6666
"unsubscribe": {},
6767
"unwatch": {},
68+
"wait": {},
6869
}
6970

7071
// CmdTyper interface for getting command type

example/cluster-mget/README.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Redis Cluster MGET Example
2+
3+
This example demonstrates how to use the Redis Cluster client with the `MGET` command to retrieve multiple keys efficiently.
4+
5+
## Overview
6+
7+
The example shows:
8+
- Creating a Redis Cluster client
9+
- Setting 10 keys with individual `SET` commands
10+
- Retrieving all 10 keys in a single operation using `MGET`
11+
- Validating that the retrieved values match the expected values
12+
- Cleaning up by deleting the test keys
13+
14+
## Prerequisites
15+
16+
You need a running Redis Cluster. The example expects cluster nodes at:
17+
- `localhost:7000`
18+
- `localhost:7001`
19+
- `localhost:7002`
20+
21+
### Setting up a Redis Cluster (using Docker)
22+
23+
If you don't have a Redis Cluster running, you can use the docker-compose setup from the repository root:
24+
25+
```bash
26+
# From the go-redis repository root
27+
docker compose --profile cluster up -d
28+
```
29+
30+
This will start a Redis Cluster with nodes on ports 16600-16605.
31+
32+
If using the docker-compose cluster, update the `Addrs` in `main.go` to:
33+
```go
34+
Addrs: []string{
35+
"localhost:16600",
36+
"localhost:16601",
37+
"localhost:16602",
38+
},
39+
```
40+
41+
## Running the Example
42+
43+
```bash
44+
go run main.go
45+
```
46+
47+
## Expected Output
48+
49+
```
50+
✓ Connected to Redis cluster
51+
52+
=== Setting 10 keys ===
53+
✓ SET key0 = value0
54+
✓ SET key1 = value1
55+
✓ SET key2 = value2
56+
✓ SET key3 = value3
57+
✓ SET key4 = value4
58+
✓ SET key5 = value5
59+
✓ SET key6 = value6
60+
✓ SET key7 = value7
61+
✓ SET key8 = value8
62+
✓ SET key9 = value9
63+
64+
=== Retrieving keys with MGET ===
65+
66+
=== Validating MGET results ===
67+
✓ key0: value0
68+
✓ key1: value1
69+
✓ key2: value2
70+
✓ key3: value3
71+
✓ key4: value4
72+
✓ key5: value5
73+
✓ key6: value6
74+
✓ key7: value7
75+
✓ key8: value8
76+
✓ key9: value9
77+
78+
=== Summary ===
79+
✓ All values retrieved successfully and match expected values!
80+
81+
=== Cleaning up ===
82+
✓ Cleanup complete
83+
```
84+
85+
## Key Concepts
86+
87+
### MGET Command
88+
89+
`MGET` (Multiple GET) is a Redis command that retrieves the values of multiple keys in a single operation. This is more efficient than executing multiple individual `GET` commands.
90+
91+
**Syntax:**
92+
```go
93+
result, err := rdb.MGet(ctx, key1, key2, key3, ...).Result()
94+
```
95+
96+
**Returns:**
97+
- A slice of `interface{}` values
98+
- Each value corresponds to a key in the same order
99+
- `nil` is returned for keys that don't exist
100+
101+
### Cluster Client
102+
103+
The `ClusterClient` automatically handles:
104+
- Distributing keys across cluster nodes based on hash slots
105+
- Following cluster redirects
106+
- Maintaining connections to all cluster nodes
107+
- Retrying operations on cluster topology changes
108+
109+
For `MGET` operations in a cluster, the client may need to split the request across multiple nodes if the keys map to different hash slots.
110+
111+
## Code Highlights
112+
113+
```go
114+
// Create cluster client
115+
rdb := redis.NewClusterClient(&redis.ClusterOptions{
116+
Addrs: []string{
117+
"localhost:7000",
118+
"localhost:7001",
119+
"localhost:7002",
120+
},
121+
})
122+
123+
// Set individual keys
124+
for i := 0; i < 10; i++ {
125+
err := rdb.Set(ctx, fmt.Sprintf("key%d", i), fmt.Sprintf("value%d", i), 0).Err()
126+
// handle error
127+
}
128+
129+
// Retrieve all keys with MGET
130+
result, err := rdb.MGet(ctx, keys...).Result()
131+
132+
// Validate results
133+
for i, val := range result {
134+
actualValue, ok := val.(string)
135+
// validate actualValue matches expected
136+
}
137+
```
138+
139+
## Learn More
140+
141+
- [Redis MGET Documentation](https://redis.io/commands/mget/)
142+
- [Redis Cluster Specification](https://redis.io/topics/cluster-spec)
143+
- [go-redis Documentation](https://redis.uptrace.dev/)
144+

0 commit comments

Comments
 (0)