Skip to content

Commit 3f80a8a

Browse files
committed
Merge branch 'master' into client_info
Signed-off-by: monkey92t <[email protected]>
2 parents edf8d14 + 6ecbcf6 commit 3f80a8a

20 files changed

+1665
-46
lines changed

.github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
go-version: [1.18.x, 1.19.x]
19+
go-version: [1.18.x, 1.19.x, 1.20.x]
2020

2121
services:
2222
redis:
23-
image: redis
23+
image: redis:7.2-rc
2424
options: >-
2525
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
2626
ports:
2727
- 6379:6379
2828

2929
steps:
3030
- name: Set up ${{ matrix.go-version }}
31-
uses: actions/setup-go@v3
31+
uses: actions/setup-go@v4
3232
with:
3333
go-version: ${{ matrix.go-version }}
3434

CHANGELOG.md

+56
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,59 @@
1+
## [9.0.3](https://github.com/redis/go-redis/compare/v9.0.2...v9.0.3) (2023-04-02)
2+
3+
### New Features
4+
5+
- feat(scan): scan time.Time sets the default decoding (#2413)
6+
- Add support for CLUSTER LINKS command (#2504)
7+
- Add support for acl dryrun command (#2502)
8+
- Add support for COMMAND GETKEYS & COMMAND GETKEYSANDFLAGS (#2500)
9+
- Add support for LCS Command (#2480)
10+
- Add support for BZMPOP (#2456)
11+
- Adding support for ZMPOP command (#2408)
12+
- Add support for LMPOP (#2440)
13+
- feat: remove pool unused fields (#2438)
14+
- Expiretime and PExpireTime (#2426)
15+
- Implement `FUNCTION` group of commands (#2475)
16+
- feat(zadd): add ZAddLT and ZAddGT (#2429)
17+
- Add: Support for COMMAND LIST command (#2491)
18+
- Add support for BLMPOP (#2442)
19+
- feat: check pipeline.Do to prevent confusion with Exec (#2517)
20+
- Function stats, function kill, fcall and fcall_ro (#2486)
21+
- feat: Add support for CLUSTER SHARDS command (#2507)
22+
- feat(cmd): support for adding byte,bit parameters to the bitpos command (#2498)
23+
24+
### Fixed
25+
26+
- fix: eval api cmd.SetFirstKeyPos (#2501)
27+
- fix: limit the number of connections created (#2441)
28+
- fixed #2462 v9 continue support dragonfly, it's Hello command return "NOAUTH Authentication required" error (#2479)
29+
- Fix for internal/hscan/structmap.go:89:23: undefined: reflect.Pointer (#2458)
30+
- fix: group lag can be null (#2448)
31+
32+
### Maintenance
33+
34+
- Updating to the latest version of redis (#2508)
35+
- Allowing for running tests on a port other than the fixed 6380 (#2466)
36+
- redis 7.0.8 in tests (#2450)
37+
- docs: Update redisotel example for v9 (#2425)
38+
- chore: update go mod, Upgrade golang.org/x/net version to 0.7.0 (#2476)
39+
- chore: add Chinese translation (#2436)
40+
- chore(deps): bump github.com/bsm/gomega from 1.20.0 to 1.26.0 (#2421)
41+
- chore(deps): bump github.com/bsm/ginkgo/v2 from 2.5.0 to 2.7.0 (#2420)
42+
- chore(deps): bump actions/setup-go from 3 to 4 (#2495)
43+
- docs: add instructions for the HSet api (#2503)
44+
- docs: add reading lag field comment (#2451)
45+
- test: update go mod before testing(go mod tidy) (#2423)
46+
- docs: fix comment typo (#2505)
47+
- test: remove testify (#2463)
48+
- refactor: change ListElementCmd to KeyValuesCmd. (#2443)
49+
- fix(appendArg): appendArg case special type (#2489)
50+
51+
## [9.0.2](https://github.com/redis/go-redis/compare/v9.0.1...v9.0.2) (2023-02-01)
52+
53+
### Features
54+
55+
* upgrade OpenTelemetry, use the new metrics API. ([#2410](https://github.com/redis/go-redis/issues/2410)) ([e29e42c](https://github.com/redis/go-redis/commit/e29e42cde2755ab910d04185025dc43ce6f59c65))
56+
157
## v9 2023-01-30
258

359
### Breaking

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ bench: testdeps
2323

2424
testdata/redis:
2525
mkdir -p $@
26-
wget -qO- https://download.redis.io/releases/redis-7.0.8.tar.gz | tar xvz --strip-components=1 -C $@
26+
wget -qO- https://download.redis.io/releases/redis-7.2-rc1.tar.gz | tar xvz --strip-components=1 -C $@
2727

2828
testdata/redis/src/redis-server: testdata/redis
2929
cd $< && make all

cluster_test.go

+61
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,61 @@ var _ = Describe("ClusterClient", func() {
677677
Expect(assertSlotsEqual(res, wanted)).NotTo(HaveOccurred())
678678
})
679679

680+
It("should CLUSTER SHARDS", func() {
681+
res, err := client.ClusterShards(ctx).Result()
682+
Expect(err).NotTo(HaveOccurred())
683+
Expect(res).NotTo(BeEmpty())
684+
685+
// Iterate over the ClusterShard results and validate the fields.
686+
for _, shard := range res {
687+
Expect(shard.Slots).NotTo(BeEmpty())
688+
for _, slotRange := range shard.Slots {
689+
Expect(slotRange.Start).To(BeNumerically(">=", 0))
690+
Expect(slotRange.End).To(BeNumerically(">=", slotRange.Start))
691+
}
692+
693+
Expect(shard.Nodes).NotTo(BeEmpty())
694+
for _, node := range shard.Nodes {
695+
Expect(node.ID).NotTo(BeEmpty())
696+
Expect(node.Endpoint).NotTo(BeEmpty())
697+
Expect(node.IP).NotTo(BeEmpty())
698+
Expect(node.Port).To(BeNumerically(">", 0))
699+
700+
validRoles := []string{"master", "slave", "replica"}
701+
Expect(validRoles).To(ContainElement(node.Role))
702+
703+
Expect(node.ReplicationOffset).To(BeNumerically(">=", 0))
704+
705+
validHealthStatuses := []string{"online", "failed", "loading"}
706+
Expect(validHealthStatuses).To(ContainElement(node.Health))
707+
}
708+
}
709+
})
710+
711+
It("should CLUSTER LINKS", func() {
712+
res, err := client.ClusterLinks(ctx).Result()
713+
Expect(err).NotTo(HaveOccurred())
714+
Expect(res).NotTo(BeEmpty())
715+
716+
// Iterate over the ClusterLink results and validate the map keys.
717+
for _, link := range res {
718+
719+
Expect(link.Direction).NotTo(BeEmpty())
720+
Expect([]string{"from", "to"}).To(ContainElement(link.Direction))
721+
Expect(link.Node).NotTo(BeEmpty())
722+
Expect(link.CreateTime).To(BeNumerically(">", 0))
723+
724+
Expect(link.Events).NotTo(BeEmpty())
725+
validEventChars := []rune{'r', 'w'}
726+
for _, eventChar := range link.Events {
727+
Expect(validEventChars).To(ContainElement(eventChar))
728+
}
729+
730+
Expect(link.SendBufferAllocated).To(BeNumerically(">=", 0))
731+
Expect(link.SendBufferUsed).To(BeNumerically(">=", 0))
732+
}
733+
})
734+
680735
It("should cluster client setname", func() {
681736
err := client.ForEachShard(ctx, func(ctx context.Context, c *redis.Client) error {
682737
return c.Ping(ctx).Err()
@@ -691,6 +746,12 @@ var _ = Describe("ClusterClient", func() {
691746
})
692747
})
693748

749+
It("should CLUSTER MYSHARDID", func() {
750+
shardID, err := client.ClusterMyShardID(ctx).Result()
751+
Expect(err).NotTo(HaveOccurred())
752+
Expect(shardID).ToNot(BeEmpty())
753+
})
754+
694755
It("should CLUSTER NODES", func() {
695756
res, err := client.ClusterNodes(ctx).Result()
696757
Expect(err).NotTo(HaveOccurred())

0 commit comments

Comments
 (0)