From 83dd4d7200f83d8123fdb39d9f4748d04b8ab84e Mon Sep 17 00:00:00 2001 From: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> Date: Wed, 14 Feb 2024 21:02:52 +0200 Subject: [PATCH 01/20] Change RE image to edge-focal (#2884) * Change RE image to edge-focal * Fix typo * change tag to 7.2.4-108 --- .github/workflows/test-redis-enterprise.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-redis-enterprise.yml b/.github/workflows/test-redis-enterprise.yml index d14766fb..82946dd3 100644 --- a/.github/workflows/test-redis-enterprise.yml +++ b/.github/workflows/test-redis-enterprise.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: go-version: [1.21.x] - re-build: ["7.2.4-92"] + re-build: ["7.2.4-108"] steps: - name: Checkout code From ffe9125a2415c51921362742bc1fa01ed9dfebe9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 21:03:49 +0200 Subject: [PATCH 02/20] chore(deps): bump golangci/golangci-lint-action from 3 to 4 (#2890) Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3 to 4. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v3...v4) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> --- .github/workflows/golangci-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index e35ee85c..a139f5da 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -23,4 +23,4 @@ jobs: steps: - uses: actions/checkout@v4 - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 From a1577376e178e609522098e0cd1c8fd048ce7a03 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 21:04:25 +0200 Subject: [PATCH 03/20] chore(deps): bump rojopolis/spellcheck-github-actions (#2889) Bumps [rojopolis/spellcheck-github-actions](https://github.com/rojopolis/spellcheck-github-actions) from 0.35.0 to 0.36.0. - [Release notes](https://github.com/rojopolis/spellcheck-github-actions/releases) - [Changelog](https://github.com/rojopolis/spellcheck-github-actions/blob/master/CHANGELOG.md) - [Commits](https://github.com/rojopolis/spellcheck-github-actions/compare/0.35.0...0.36.0) --- updated-dependencies: - dependency-name: rojopolis/spellcheck-github-actions dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> --- .github/workflows/spellcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index a48781aa..f739a542 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -8,7 +8,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 - name: Check Spelling - uses: rojopolis/spellcheck-github-actions@0.35.0 + uses: rojopolis/spellcheck-github-actions@0.36.0 with: config_path: .github/spellcheck-settings.yml task_name: Markdown From 36bab9c8dc72a894c81a2d23171c95a0815af8d8 Mon Sep 17 00:00:00 2001 From: Oleg Stotsky Date: Thu, 15 Feb 2024 00:14:50 +0400 Subject: [PATCH 04/20] fix ConnPool race in newConn (#2885) Co-authored-by: Oleg Stotskiy Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> --- internal/pool/pool.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/pool/pool.go b/internal/pool/pool.go index 986c05d0..2125f3e1 100644 --- a/internal/pool/pool.go +++ b/internal/pool/pool.go @@ -168,9 +168,12 @@ func (p *ConnPool) newConn(ctx context.Context, pooled bool) (*Conn, error) { return nil, ErrClosed } + p.connsMu.Lock() if p.cfg.MaxActiveConns > 0 && p.poolSize >= p.cfg.MaxActiveConns { + p.connsMu.Unlock() return nil, ErrPoolExhausted } + p.connsMu.Unlock() cn, err := p.dialConn(ctx, pooled) if err != nil { @@ -180,6 +183,11 @@ func (p *ConnPool) newConn(ctx context.Context, pooled bool) (*Conn, error) { p.connsMu.Lock() defer p.connsMu.Unlock() + if p.cfg.MaxActiveConns > 0 && p.poolSize >= p.cfg.MaxActiveConns { + _ = cn.Close() + return nil, ErrPoolExhausted + } + p.conns = append(p.conns, cn) if pooled { // If pool is full remove the cn on next Put. From 8d2a022fd5fbe71ee011004295d6991d894e811b Mon Sep 17 00:00:00 2001 From: Nanthen Hale Date: Thu, 15 Feb 2024 04:15:30 +0800 Subject: [PATCH 05/20] Add support for specifying bitcount unit as byte or bit, byte default (#2887) * Add support for specifying bitcount unit as byte or bit, byte default * Add bitcount test * Test bitcount without unit specified --------- Co-authored-by: wanghongwei5 Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> --- bitmap_commands.go | 14 ++++++ bitmap_commands_test.go | 98 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 bitmap_commands_test.go diff --git a/bitmap_commands.go b/bitmap_commands.go index 550d7f52..d9fc50dc 100644 --- a/bitmap_commands.go +++ b/bitmap_commands.go @@ -2,6 +2,7 @@ package redis import ( "context" + "errors" ) type BitMapCmdable interface { @@ -37,15 +38,28 @@ func (c cmdable) SetBit(ctx context.Context, key string, offset int64, value int type BitCount struct { Start, End int64 + Unit string // BYTE(default) | BIT } +const BitCountIndexByte string = "BYTE" +const BitCountIndexBit string = "BIT" + func (c cmdable) BitCount(ctx context.Context, key string, bitCount *BitCount) *IntCmd { args := []interface{}{"bitcount", key} if bitCount != nil { + if bitCount.Unit == "" { + bitCount.Unit = "BYTE" + } + if bitCount.Unit != BitCountIndexByte && bitCount.Unit != BitCountIndexBit { + cmd := NewIntCmd(ctx) + cmd.SetErr(errors.New("redis: invalid bitcount index")) + return cmd + } args = append( args, bitCount.Start, bitCount.End, + string(bitCount.Unit), ) } cmd := NewIntCmd(ctx, args...) diff --git a/bitmap_commands_test.go b/bitmap_commands_test.go new file mode 100644 index 00000000..f3cc3205 --- /dev/null +++ b/bitmap_commands_test.go @@ -0,0 +1,98 @@ +package redis_test + +import ( + . "github.com/bsm/ginkgo/v2" + . "github.com/bsm/gomega" + "github.com/redis/go-redis/v9" +) + +type bitCountExpected struct { + Start int64 + End int64 + Expected int64 +} + +var _ = Describe("BitCountBite", func() { + var client *redis.Client + key := "bit_count_test" + + BeforeEach(func() { + client = redis.NewClient(redisOptions()) + Expect(client.FlushDB(ctx).Err()).NotTo(HaveOccurred()) + values := []int{0, 1, 0, 0, 1, 0, 1, 0, 1, 1} + for i, v := range values { + cmd := client.SetBit(ctx, key, int64(i), v) + Expect(cmd.Err()).NotTo(HaveOccurred()) + } + }) + + AfterEach(func() { + Expect(client.Close()).NotTo(HaveOccurred()) + }) + + It("bit count bite", func() { + var expected = []bitCountExpected{ + {0, 0, 0}, + {0, 1, 1}, + {0, 2, 1}, + {0, 3, 1}, + {0, 4, 2}, + {0, 5, 2}, + {0, 6, 3}, + {0, 7, 3}, + {0, 8, 4}, + {0, 9, 5}, + } + + for _, e := range expected { + cmd := client.BitCount(ctx, key, &redis.BitCount{Start: e.Start, End: e.End, Unit: redis.BitCountIndexBit}) + Expect(cmd.Err()).NotTo(HaveOccurred()) + Expect(cmd.Val()).To(Equal(e.Expected)) + } + }) +}) + +var _ = Describe("BitCountByte", func() { + var client *redis.Client + key := "bit_count_test" + + BeforeEach(func() { + client = redis.NewClient(redisOptions()) + Expect(client.FlushDB(ctx).Err()).NotTo(HaveOccurred()) + values := []int{0, 0, 0, 0, 0, 0, 0, 1, 1, 1} + for i, v := range values { + cmd := client.SetBit(ctx, key, int64(i), v) + Expect(cmd.Err()).NotTo(HaveOccurred()) + } + }) + + AfterEach(func() { + Expect(client.Close()).NotTo(HaveOccurred()) + }) + + It("bit count byte", func() { + var expected = []bitCountExpected{ + {0, 0, 1}, + {0, 1, 3}, + } + + for _, e := range expected { + cmd := client.BitCount(ctx, key, &redis.BitCount{Start: e.Start, End: e.End, Unit: redis.BitCountIndexByte}) + Expect(cmd.Err()).NotTo(HaveOccurred()) + Expect(cmd.Val()).To(Equal(e.Expected)) + } + }) + + It("bit count byte with no unit specified", func() { + var expected = []bitCountExpected{ + {0, 0, 1}, + {0, 1, 3}, + } + + for _, e := range expected { + cmd := client.BitCount(ctx, key, &redis.BitCount{Start: e.Start, End: e.End}) + Expect(cmd.Err()).NotTo(HaveOccurred()) + Expect(cmd.Val()).To(Equal(e.Expected)) + } + }) +}) From afffb47b0b169f0ce1097801db0104f231bf46be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 22:15:44 +0200 Subject: [PATCH 06/20] chore(deps): bump release-drafter/release-drafter from 5 to 6 (#2883) Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5 to 6. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/v5...v6) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-drafter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index eebb3e67..6695abfe 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5 + - uses: release-drafter/release-drafter@v6 with: # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml config-name: release-drafter-config.yml From 51897bc5bf5ad2e6ec4e126ce585a4c0d29eb8a0 Mon Sep 17 00:00:00 2001 From: limotley <54456437+limotley@users.noreply.github.com> Date: Wed, 14 Feb 2024 12:16:27 -0800 Subject: [PATCH 07/20] Remove unnecessary Node project definition file (#2863) Co-authored-by: Personalizer Team Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> --- package.json | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 package.json diff --git a/package.json b/package.json deleted file mode 100644 index 1a690047..00000000 --- a/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "redis", - "version": "9.4.0", - "main": "index.js", - "repository": "git@github.com:redis/go-redis.git", - "author": "Vladimir Mihailenco ", - "license": "BSD-2-clause" -} From 9133749cd3ef42459a8698b59ab212537db5fb98 Mon Sep 17 00:00:00 2001 From: "fengyun.rui" Date: Thu, 15 Feb 2024 04:16:50 +0800 Subject: [PATCH 08/20] test: add ut for util_test (#2840) Signed-off-by: rfyiamcool Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> --- internal/util_test.go | 53 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 internal/util_test.go diff --git a/internal/util_test.go b/internal/util_test.go new file mode 100644 index 00000000..f090ebaa --- /dev/null +++ b/internal/util_test.go @@ -0,0 +1,53 @@ +package internal + +import ( + "strings" + "testing" + + . "github.com/bsm/ginkgo/v2" + . "github.com/bsm/gomega" +) + +func BenchmarkToLowerStd(b *testing.B) { + str := "AaBbCcDdEeFfGgHhIiJjKk" + for i := 0; i < b.N; i++ { + _ = strings.ToLower(str) + } +} + +// util.ToLower is 3x faster than strings.ToLower. +func BenchmarkToLowerInternal(b *testing.B) { + str := "AaBbCcDdEeFfGgHhIiJjKk" + for i := 0; i < b.N; i++ { + _ = ToLower(str) + } +} + +func TestToLower(t *testing.T) { + It("toLower", func() { + str := "AaBbCcDdEeFfGg" + Expect(ToLower(str)).To(Equal(strings.ToLower(str))) + + str = "ABCDE" + Expect(ToLower(str)).To(Equal(strings.ToLower(str))) + + str = "ABCDE" + Expect(ToLower(str)).To(Equal(strings.ToLower(str))) + + str = "abced" + Expect(ToLower(str)).To(Equal(strings.ToLower(str))) + }) +} + +func TestIsLower(t *testing.T) { + It("isLower", func() { + str := "AaBbCcDdEeFfGg" + Expect(isLower(str)).To(BeFalse()) + + str = "ABCDE" + Expect(isLower(str)).To(BeFalse()) + + str = "abcdefg" + Expect(isLower(str)).To(BeTrue()) + }) +} From 7b9e81fd418e16d1317e6e896624a62b40cbbf80 Mon Sep 17 00:00:00 2001 From: "fengyun.rui" Date: Thu, 15 Feb 2024 04:22:32 +0800 Subject: [PATCH 09/20] fix: add bytes in scan struct example (#2836) * fix: add bytes in scan struct example Signed-off-by: rfyiamcool * fix: add bytes in scan struct example Signed-off-by: rfyiamcool --------- Signed-off-by: rfyiamcool Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> --- example/scan-struct/main.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/example/scan-struct/main.go b/example/scan-struct/main.go index 9d270b53..cc877b84 100644 --- a/example/scan-struct/main.go +++ b/example/scan-struct/main.go @@ -11,6 +11,7 @@ import ( type Model struct { Str1 string `redis:"str1"` Str2 string `redis:"str2"` + Bytes []byte `redis:"bytes"` Int int `redis:"int"` Bool bool `redis:"bool"` Ignored struct{} `redis:"-"` @@ -22,6 +23,7 @@ func main() { rdb := redis.NewClient(&redis.Options{ Addr: ":6379", }) + _ = rdb.FlushDB(ctx).Err() // Set some fields. if _, err := rdb.Pipelined(ctx, func(rdb redis.Pipeliner) error { @@ -29,6 +31,7 @@ func main() { rdb.HSet(ctx, "key", "str2", "world") rdb.HSet(ctx, "key", "int", 123) rdb.HSet(ctx, "key", "bool", 1) + rdb.HSet(ctx, "key", "bytes", []byte("this is bytes !")) return nil }); err != nil { panic(err) @@ -47,5 +50,28 @@ func main() { } spew.Dump(model1) + // Output: + // (main.Model) { + // Str1: (string) (len=5) "hello", + // Str2: (string) (len=5) "world", + // Bytes: ([]uint8) (len=15 cap=16) { + // 00000000 74 68 69 73 20 69 73 20 62 79 74 65 73 20 21 |this is bytes !| + // }, + // Int: (int) 123, + // Bool: (bool) true, + // Ignored: (struct {}) { + // } + // } + spew.Dump(model2) + // Output: + // (main.Model) { + // Str1: (string) (len=5) "hello", + // Str2: (string) "", + // Bytes: ([]uint8) , + // Int: (int) 123, + // Bool: (bool) false, + // Ignored: (struct {}) { + // } + // } } From 21ed15bbed2774a40fe831f7618332aa4f207fd1 Mon Sep 17 00:00:00 2001 From: Tiago Peczenyj Date: Wed, 14 Feb 2024 21:40:20 +0100 Subject: [PATCH 10/20] Add helpers to set libinfo without panic (#2724) * add helpers to set library name and library info without risk of panic if we try to set both * refactor code to use helpers * add example * refactor tests * fix testable example * simplify example * rename exampl * fix ring.go * update example --------- Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> --- command.go | 10 ++++++++++ commands_test.go | 4 ++-- example_test.go | 24 +++++++++++++++++++++++- redis.go | 7 +++---- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/command.go b/command.go index 06ed86ed..9fb9a831 100644 --- a/command.go +++ b/command.go @@ -5310,6 +5310,16 @@ type LibraryInfo struct { LibVer *string } +// WithLibraryName returns a valid LibraryInfo with library name only. +func WithLibraryName(libName string) LibraryInfo { + return LibraryInfo{LibName: &libName} +} + +// WithLibraryVersion returns a valid LibraryInfo with library version only. +func WithLibraryVersion(libVer string) LibraryInfo { + return LibraryInfo{LibVer: &libVer} +} + // ------------------------------------------- type InfoCmd struct { diff --git a/commands_test.go b/commands_test.go index 3d2ebf51..fbeff1c2 100644 --- a/commands_test.go +++ b/commands_test.go @@ -248,7 +248,7 @@ var _ = Describe("Commands", func() { // Test setting the libName libName := "go-redis" - libInfo := redis.LibraryInfo{LibName: &libName} + libInfo := redis.WithLibraryName(libName) setInfo := pipe.ClientSetInfo(ctx, libInfo) _, err := pipe.Exec(ctx) @@ -258,7 +258,7 @@ var _ = Describe("Commands", func() { // Test setting the libVer libVer := "vX.x" - libInfo = redis.LibraryInfo{LibVer: &libVer} + libInfo = redis.WithLibraryVersion(libVer) setInfo = pipe.ClientSetInfo(ctx, libInfo) _, err = pipe.Exec(ctx) diff --git a/example_test.go b/example_test.go index 67559fce..62aa8cb5 100644 --- a/example_test.go +++ b/example_test.go @@ -154,7 +154,7 @@ func ExampleClient() { // missing_key does not exist } -func ExampleConn() { +func ExampleConn_name() { conn := rdb.Conn() err := conn.ClientSetName(ctx, "foobar").Err() @@ -175,6 +175,28 @@ func ExampleConn() { // Output: foobar } +func ExampleConn_client_setInfo_libraryVersion() { + conn := rdb.Conn() + + err := conn.ClientSetInfo(ctx, redis.WithLibraryVersion("1.2.3")).Err() + if err != nil { + panic(err) + } + + // Open other connections. + for i := 0; i < 10; i++ { + go rdb.Ping(ctx) + } + + s, err := conn.ClientInfo(ctx).Result() + if err != nil { + panic(err) + } + + fmt.Println(s.LibVer) + // Output: 1.2.3 +} + func ExampleClient_Set() { // Last argument is expiration. Zero means the key has no // expiration time. diff --git a/redis.go b/redis.go index 4dd862b8..c8f51311 100644 --- a/redis.go +++ b/redis.go @@ -315,13 +315,12 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error { if !c.opt.DisableIndentity { libName := "" libVer := Version() + if c.opt.IdentitySuffix != "" { libName = c.opt.IdentitySuffix } - libInfo := LibraryInfo{LibName: &libName} - conn.ClientSetInfo(ctx, libInfo) - libInfo = LibraryInfo{LibVer: &libVer} - conn.ClientSetInfo(ctx, libInfo) + conn.ClientSetInfo(ctx, WithLibraryName(libName)) + conn.ClientSetInfo(ctx, WithLibraryVersion(libVer)) } _, err := conn.Pipelined(ctx, func(pipe Pipeliner) error { if !auth && password != "" { From 516abe867dbeaa337009dbaf2668b85011996bde Mon Sep 17 00:00:00 2001 From: John Du Hart Date: Wed, 14 Feb 2024 16:03:18 -0500 Subject: [PATCH 11/20] add CredentialsProvider to ClusterOptions (#2791) --- osscluster.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/osscluster.go b/osscluster.go index 9e5eb046..17f98d9d 100644 --- a/osscluster.go +++ b/osscluster.go @@ -62,9 +62,10 @@ type ClusterOptions struct { OnConnect func(ctx context.Context, cn *Conn) error - Protocol int - Username string - Password string + Protocol int + Username string + Password string + CredentialsProvider func() (username string, password string) MaxRetries int MinRetryBackoff time.Duration @@ -271,9 +272,10 @@ func (opt *ClusterOptions) clientOptions() *Options { Dialer: opt.Dialer, OnConnect: opt.OnConnect, - Protocol: opt.Protocol, - Username: opt.Username, - Password: opt.Password, + Protocol: opt.Protocol, + Username: opt.Username, + Password: opt.Password, + CredentialsProvider: opt.CredentialsProvider, MaxRetries: opt.MaxRetries, MinRetryBackoff: opt.MinRetryBackoff, From f0ecdb41905b812da0afcfe72d136aac76995be8 Mon Sep 17 00:00:00 2001 From: "fengyun.rui" Date: Thu, 15 Feb 2024 05:04:23 +0800 Subject: [PATCH 12/20] docs: update features (#2846) Signed-off-by: rfyiamcool Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 98edbe21..7ba24268 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,8 @@ key value NoSQL database that uses RocksDB as storage engine and is compatible w ## Features -- Redis 3 commands except QUIT, MONITOR, and SYNC. -- Automatic connection pooling with +- Redis commands except QUIT and SYNC. +- Automatic connection pooling. - [Pub/Sub](https://redis.uptrace.dev/guide/go-redis-pubsub.html). - [Pipelines and transactions](https://redis.uptrace.dev/guide/go-redis-pipelines.html). - [Scripting](https://redis.uptrace.dev/guide/lua-scripting.html). From d383038a0f9d9905a66d1738851852950db147ed Mon Sep 17 00:00:00 2001 From: "fengyun.rui" Date: Thu, 15 Feb 2024 05:05:05 +0800 Subject: [PATCH 13/20] feat: add object fraq command (#2844) * feat: add object fraq command Signed-off-by: rfyiamcool * feat: add object fraq command Signed-off-by: rfyiamcool --------- Signed-off-by: rfyiamcool Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> --- commands_test.go | 5 +++++ generic_commands.go | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/commands_test.go b/commands_test.go index fbeff1c2..81eb2eb6 100644 --- a/commands_test.go +++ b/commands_test.go @@ -686,6 +686,11 @@ var _ = Describe("Commands", func() { Expect(refCount.Err()).NotTo(HaveOccurred()) Expect(refCount.Val()).To(Equal(int64(1))) + client.ConfigSet(ctx, "maxmemory-policy", "volatile-lfu") + freq := client.ObjectFreq(ctx, "key") + Expect(freq.Err()).NotTo(HaveOccurred()) + client.ConfigSet(ctx, "maxmemory-policy", "noeviction") // default + err := client.ObjectEncoding(ctx, "key").Err() Expect(err).NotTo(HaveOccurred()) diff --git a/generic_commands.go b/generic_commands.go index bf1fb47d..dc6c3fe0 100644 --- a/generic_commands.go +++ b/generic_commands.go @@ -19,6 +19,7 @@ type GenericCmdable interface { Keys(ctx context.Context, pattern string) *StringSliceCmd Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *StatusCmd Move(ctx context.Context, key string, db int) *BoolCmd + ObjectFreq(ctx context.Context, key string) *IntCmd ObjectRefCount(ctx context.Context, key string) *IntCmd ObjectEncoding(ctx context.Context, key string) *StringCmd ObjectIdleTime(ctx context.Context, key string) *DurationCmd @@ -159,6 +160,12 @@ func (c cmdable) Move(ctx context.Context, key string, db int) *BoolCmd { return cmd } +func (c cmdable) ObjectFreq(ctx context.Context, key string) *IntCmd { + cmd := NewIntCmd(ctx, "object", "freq", key) + _ = c(ctx, cmd) + return cmd +} + func (c cmdable) ObjectRefCount(ctx context.Context, key string) *IntCmd { cmd := NewIntCmd(ctx, "object", "refcount", key) _ = c(ctx, cmd) From 8afc2b9314ea9f719219937f52f05484b4cc0ae2 Mon Sep 17 00:00:00 2001 From: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> Date: Wed, 14 Feb 2024 23:28:28 +0200 Subject: [PATCH 14/20] Remove freq object test from RE tests (#2904) --- commands_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands_test.go b/commands_test.go index 81eb2eb6..d30a9d8b 100644 --- a/commands_test.go +++ b/commands_test.go @@ -676,7 +676,7 @@ var _ = Describe("Commands", func() { Expect(get.Val()).To(Equal("hello")) }) - It("should Object", func() { + It("should Object", Label("NonRedisEnterprise"), func() { start := time.Now() set := client.Set(ctx, "key", "hello", 0) Expect(set.Err()).NotTo(HaveOccurred()) From 35de49a8da74319b347ca1ea64fc5aa0000c0096 Mon Sep 17 00:00:00 2001 From: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> Date: Thu, 15 Feb 2024 12:48:56 +0200 Subject: [PATCH 15/20] Speed up connections by sending SetInfo via a pipeline (#2880) * Send Client SetInfo via pipe * Fix ACL test * Add client set info to acl command rules --- commands_test.go | 4 ++-- redis.go | 19 ++++++++++--------- sentinel_test.go | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/commands_test.go b/commands_test.go index d30a9d8b..5af2797e 100644 --- a/commands_test.go +++ b/commands_test.go @@ -2105,7 +2105,7 @@ var _ = Describe("Commands", func() { logEntries, err := client.ACLLog(ctx, 10).Result() Expect(err).NotTo(HaveOccurred()) - Expect(len(logEntries)).To(Equal(4)) + Expect(len(logEntries)).To(Equal(1)) for _, entry := range logEntries { Expect(entry.Reason).To(Equal("command")) @@ -2121,7 +2121,7 @@ var _ = Describe("Commands", func() { limitedLogEntries, err := client.ACLLog(ctx, 2).Result() Expect(err).NotTo(HaveOccurred()) - Expect(len(limitedLogEntries)).To(Equal(2)) + Expect(len(limitedLogEntries)).To(Equal(1)) }) It("should ACL LOG RESET", Label("NonRedisEnterprise"), func() { diff --git a/redis.go b/redis.go index c8f51311..33477b53 100644 --- a/redis.go +++ b/redis.go @@ -312,16 +312,7 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error { // difficult to rely on error strings to determine all results. return err } - if !c.opt.DisableIndentity { - libName := "" - libVer := Version() - if c.opt.IdentitySuffix != "" { - libName = c.opt.IdentitySuffix - } - conn.ClientSetInfo(ctx, WithLibraryName(libName)) - conn.ClientSetInfo(ctx, WithLibraryVersion(libVer)) - } _, err := conn.Pipelined(ctx, func(pipe Pipeliner) error { if !auth && password != "" { if username != "" { @@ -343,6 +334,16 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error { pipe.ClientSetName(ctx, c.opt.ClientName) } + if !c.opt.DisableIndentity { + libName := "" + libVer := Version() + if c.opt.IdentitySuffix != "" { + libName = c.opt.IdentitySuffix + } + pipe.ClientSetInfo(ctx, WithLibraryName(libName)) + pipe.ClientSetInfo(ctx, WithLibraryVersion(libVer)) + } + return nil }) if err != nil { diff --git a/sentinel_test.go b/sentinel_test.go index 4c013f05..8bc6c578 100644 --- a/sentinel_test.go +++ b/sentinel_test.go @@ -324,7 +324,7 @@ var _ = Describe("SentinelAclAuth", func() { BeforeEach(func() { authCmd := redis.NewStatusCmd(ctx, "ACL", "SETUSER", aclSentinelUsername, "ON", ">"+aclSentinelPassword, "-@all", "+auth", "+client|getname", "+client|id", "+client|setname", - "+command", "+hello", "+ping", "+role", "+sentinel|get-master-addr-by-name", "+sentinel|master", + "+command", "+hello", "+ping", "+client|setinfo", "+role", "+sentinel|get-master-addr-by-name", "+sentinel|master", "+sentinel|myid", "+sentinel|replicas", "+sentinel|sentinels") for _, process := range sentinels() { From b5a9e5d2c67d804cd18f35382b4aebf0dfcd638e Mon Sep 17 00:00:00 2001 From: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> Date: Sun, 18 Feb 2024 19:16:42 +0200 Subject: [PATCH 16/20] Bump go-redis version to 9.5.0 (#2905) * Bump go-redis version to 9.4.1 * Bump go-redis version to 9.5.0 --- example/del-keys-without-ttl/go.mod | 2 +- example/hll/go.mod | 2 +- example/lua-scripting/go.mod | 2 +- example/otel/go.mod | 6 +++--- example/redis-bloom/go.mod | 2 +- example/scan-struct/go.mod | 2 +- extra/rediscensus/go.mod | 4 ++-- extra/rediscmd/go.mod | 2 +- extra/redisotel/go.mod | 4 ++-- extra/redisprometheus/go.mod | 2 +- version.go | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/example/del-keys-without-ttl/go.mod b/example/del-keys-without-ttl/go.mod index c37ea4ad..5ba3c335 100644 --- a/example/del-keys-without-ttl/go.mod +++ b/example/del-keys-without-ttl/go.mod @@ -5,7 +5,7 @@ go 1.18 replace github.com/redis/go-redis/v9 => ../.. require ( - github.com/redis/go-redis/v9 v9.4.0 + github.com/redis/go-redis/v9 v9.5.0 go.uber.org/zap v1.24.0 ) diff --git a/example/hll/go.mod b/example/hll/go.mod index 37b8b7ca..126ba355 100644 --- a/example/hll/go.mod +++ b/example/hll/go.mod @@ -4,7 +4,7 @@ go 1.18 replace github.com/redis/go-redis/v9 => ../.. -require github.com/redis/go-redis/v9 v9.4.0 +require github.com/redis/go-redis/v9 v9.5.0 require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect diff --git a/example/lua-scripting/go.mod b/example/lua-scripting/go.mod index 52d39763..14f1bde4 100644 --- a/example/lua-scripting/go.mod +++ b/example/lua-scripting/go.mod @@ -4,7 +4,7 @@ go 1.18 replace github.com/redis/go-redis/v9 => ../.. -require github.com/redis/go-redis/v9 v9.4.0 +require github.com/redis/go-redis/v9 v9.5.0 require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect diff --git a/example/otel/go.mod b/example/otel/go.mod index 3b2a7a00..b821ecc5 100644 --- a/example/otel/go.mod +++ b/example/otel/go.mod @@ -9,8 +9,8 @@ replace github.com/redis/go-redis/extra/redisotel/v9 => ../../extra/redisotel replace github.com/redis/go-redis/extra/rediscmd/v9 => ../../extra/rediscmd require ( - github.com/redis/go-redis/extra/redisotel/v9 v9.4.0 - github.com/redis/go-redis/v9 v9.4.0 + github.com/redis/go-redis/extra/redisotel/v9 v9.5.0 + github.com/redis/go-redis/v9 v9.5.0 github.com/uptrace/uptrace-go v1.21.0 go.opentelemetry.io/otel v1.21.0 ) @@ -23,7 +23,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect - github.com/redis/go-redis/extra/rediscmd/v9 v9.4.0 // indirect + github.com/redis/go-redis/extra/rediscmd/v9 v9.5.0 // indirect go.opentelemetry.io/contrib/instrumentation/runtime v0.46.1 // indirect go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.17.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.43.0 // indirect diff --git a/example/redis-bloom/go.mod b/example/redis-bloom/go.mod index d7af7cfa..b9c26864 100644 --- a/example/redis-bloom/go.mod +++ b/example/redis-bloom/go.mod @@ -4,7 +4,7 @@ go 1.18 replace github.com/redis/go-redis/v9 => ../.. -require github.com/redis/go-redis/v9 v9.4.0 +require github.com/redis/go-redis/v9 v9.5.0 require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect diff --git a/example/scan-struct/go.mod b/example/scan-struct/go.mod index 84d8e4a6..7ec7ab21 100644 --- a/example/scan-struct/go.mod +++ b/example/scan-struct/go.mod @@ -6,7 +6,7 @@ replace github.com/redis/go-redis/v9 => ../.. require ( github.com/davecgh/go-spew v1.1.1 - github.com/redis/go-redis/v9 v9.4.0 + github.com/redis/go-redis/v9 v9.5.0 ) require ( diff --git a/extra/rediscensus/go.mod b/extra/rediscensus/go.mod index adf5a9f6..f37a3d4e 100644 --- a/extra/rediscensus/go.mod +++ b/extra/rediscensus/go.mod @@ -8,7 +8,7 @@ replace github.com/redis/go-redis/extra/rediscmd/v9 => ../rediscmd require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/redis/go-redis/extra/rediscmd/v9 v9.4.0 - github.com/redis/go-redis/v9 v9.4.0 + github.com/redis/go-redis/extra/rediscmd/v9 v9.5.0 + github.com/redis/go-redis/v9 v9.5.0 go.opencensus.io v0.24.0 ) diff --git a/extra/rediscmd/go.mod b/extra/rediscmd/go.mod index f27efd0b..5f1c7cdc 100644 --- a/extra/rediscmd/go.mod +++ b/extra/rediscmd/go.mod @@ -7,5 +7,5 @@ replace github.com/redis/go-redis/v9 => ../.. require ( github.com/bsm/ginkgo/v2 v2.7.0 github.com/bsm/gomega v1.26.0 - github.com/redis/go-redis/v9 v9.4.0 + github.com/redis/go-redis/v9 v9.5.0 ) diff --git a/extra/redisotel/go.mod b/extra/redisotel/go.mod index 987953b5..def67706 100644 --- a/extra/redisotel/go.mod +++ b/extra/redisotel/go.mod @@ -7,8 +7,8 @@ replace github.com/redis/go-redis/v9 => ../.. replace github.com/redis/go-redis/extra/rediscmd/v9 => ../rediscmd require ( - github.com/redis/go-redis/extra/rediscmd/v9 v9.4.0 - github.com/redis/go-redis/v9 v9.4.0 + github.com/redis/go-redis/extra/rediscmd/v9 v9.5.0 + github.com/redis/go-redis/v9 v9.5.0 go.opentelemetry.io/otel v1.16.0 go.opentelemetry.io/otel/metric v1.16.0 go.opentelemetry.io/otel/sdk v1.16.0 diff --git a/extra/redisprometheus/go.mod b/extra/redisprometheus/go.mod index 141c94e1..1c837110 100644 --- a/extra/redisprometheus/go.mod +++ b/extra/redisprometheus/go.mod @@ -6,7 +6,7 @@ replace github.com/redis/go-redis/v9 => ../.. require ( github.com/prometheus/client_golang v1.14.0 - github.com/redis/go-redis/v9 v9.4.0 + github.com/redis/go-redis/v9 v9.5.0 ) require ( diff --git a/version.go b/version.go index 92f49820..c632b763 100644 --- a/version.go +++ b/version.go @@ -2,5 +2,5 @@ package redis // Version is the current release version. func Version() string { - return "9.4.0" + return "9.5.0" } From 99527f0ac1e50d37fd25692b9484cba84c52f611 Mon Sep 17 00:00:00 2001 From: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> Date: Tue, 20 Feb 2024 16:37:22 +0200 Subject: [PATCH 17/20] docs: README update to highlight how to disable sending client identification (#2913) --- .github/wordlist.txt | 3 +++ README.md | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/.github/wordlist.txt b/.github/wordlist.txt index 48d3fc48..52fdc1bc 100644 --- a/.github/wordlist.txt +++ b/.github/wordlist.txt @@ -2,6 +2,7 @@ ACLs autoload autoloader autoloading +analytics Autoloading backend backends @@ -13,6 +14,7 @@ customizable Customizable dataset de +DisableIdentity ElastiCache extensibility FPM @@ -43,6 +45,7 @@ RocksDB runtime SHA sharding +SETNAME SSL struct stunnel diff --git a/README.md b/README.md index 7ba24268..043d3f0e 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,30 @@ func ExampleClient() *redis.Client { ``` + +### Advanced Configuration + +go-redis supports extending the client identification phase to allow projects to send their own custom client identification. + +#### Default Client Identification + +By default, go-redis automatically sends the client library name and version during the connection process. This feature is available in redis-server as of version 7.2. As a result, the command is "fire and forget", meaning it should fail silently, in the case that the redis server does not support this feature. + +#### Disabling Identity Verification + +When connection identity verification is not required or needs to be explicitly disabled, a `DisableIndentity` configuration option exists. In V10 of this library, `DisableIndentity` will become `DisableIdentity` in order to fix the associated typo. + +To disable verification, set the `DisableIndentity` option to `true` in the Redis client options: + +```go +rdb := redis.NewClient(&redis.Options{ + Addr: "localhost:6379", + Password: "", + DB: 0, + DisableIndentity: true, // Disable set-info on connect +}) +``` + ## Contributing Please see [out contributing guidelines](CONTRIBUTING.md) to help us improve this library! From 5da49b1abaef3bc65acae10debdbc72d7f5f32a1 Mon Sep 17 00:00:00 2001 From: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> Date: Tue, 20 Feb 2024 17:34:35 +0200 Subject: [PATCH 18/20] bug: Fix SETINFO ensuring it is set-and-forget (#2915) * Exexcute set-info without validation * Fix tests * Remove spaces from runtime.Version * fix typo * Send setinfo after auth * Add pipline * fix golangci * revert fixing typo * support sentinel --- commands.go | 2 +- commands_test.go | 4 ++-- internal/util.go | 20 ++++++++++++++++++++ redis.go | 22 ++++++++++++---------- sentinel.go | 6 ++++++ 5 files changed, 41 insertions(+), 13 deletions(-) diff --git a/commands.go b/commands.go index 546ebafb..db595944 100644 --- a/commands.go +++ b/commands.go @@ -309,7 +309,7 @@ func (c statefulCmdable) ClientSetInfo(ctx context.Context, info LibraryInfo) *S var cmd *StatusCmd if info.LibName != nil { - libName := fmt.Sprintf("go-redis(%s,%s)", *info.LibName, runtime.Version()) + libName := fmt.Sprintf("go-redis(%s,%s)", *info.LibName, internal.ReplaceSpaces(runtime.Version())) cmd = NewStatusCmd(ctx, "client", "setinfo", "LIB-NAME", libName) } else { cmd = NewStatusCmd(ctx, "client", "setinfo", "LIB-VER", *info.LibVer) diff --git a/commands_test.go b/commands_test.go index 5af2797e..d30a9d8b 100644 --- a/commands_test.go +++ b/commands_test.go @@ -2105,7 +2105,7 @@ var _ = Describe("Commands", func() { logEntries, err := client.ACLLog(ctx, 10).Result() Expect(err).NotTo(HaveOccurred()) - Expect(len(logEntries)).To(Equal(1)) + Expect(len(logEntries)).To(Equal(4)) for _, entry := range logEntries { Expect(entry.Reason).To(Equal("command")) @@ -2121,7 +2121,7 @@ var _ = Describe("Commands", func() { limitedLogEntries, err := client.ACLLog(ctx, 2).Result() Expect(err).NotTo(HaveOccurred()) - Expect(len(limitedLogEntries)).To(Equal(1)) + Expect(len(limitedLogEntries)).To(Equal(2)) }) It("should ACL LOG RESET", Label("NonRedisEnterprise"), func() { diff --git a/internal/util.go b/internal/util.go index 77ca4ee1..ed81ad7a 100644 --- a/internal/util.go +++ b/internal/util.go @@ -2,6 +2,7 @@ package internal import ( "context" + "strings" "time" "github.com/redis/go-redis/v9/internal/util" @@ -44,3 +45,22 @@ func isLower(s string) bool { } return true } + +func ReplaceSpaces(s string) string { + // Pre-allocate a builder with the same length as s to minimize allocations. + // This is a basic optimization; adjust the initial size based on your use case. + var builder strings.Builder + builder.Grow(len(s)) + + for _, char := range s { + if char == ' ' { + // Replace space with a hyphen. + builder.WriteRune('-') + } else { + // Copy the character as-is. + builder.WriteRune(char) + } + } + + return builder.String() +} diff --git a/redis.go b/redis.go index 33477b53..d25a0d31 100644 --- a/redis.go +++ b/redis.go @@ -334,22 +334,24 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error { pipe.ClientSetName(ctx, c.opt.ClientName) } - if !c.opt.DisableIndentity { - libName := "" - libVer := Version() - if c.opt.IdentitySuffix != "" { - libName = c.opt.IdentitySuffix - } - pipe.ClientSetInfo(ctx, WithLibraryName(libName)) - pipe.ClientSetInfo(ctx, WithLibraryVersion(libVer)) - } - return nil }) if err != nil { return err } + if !c.opt.DisableIndentity { + libName := "" + libVer := Version() + if c.opt.IdentitySuffix != "" { + libName = c.opt.IdentitySuffix + } + p := conn.Pipeline() + p.ClientSetInfo(ctx, WithLibraryName(libName)) + p.ClientSetInfo(ctx, WithLibraryVersion(libVer)) + _, _ = p.Exec(ctx) + } + if c.opt.OnConnect != nil { return c.opt.OnConnect(ctx, conn) } diff --git a/sentinel.go b/sentinel.go index 9ace0886..188f8849 100644 --- a/sentinel.go +++ b/sentinel.go @@ -153,6 +153,9 @@ func (opt *FailoverOptions) sentinelOptions(addr string) *Options { ConnMaxLifetime: opt.ConnMaxLifetime, TLSConfig: opt.TLSConfig, + + DisableIndentity: opt.DisableIndentity, + IdentitySuffix: opt.IdentitySuffix, } } @@ -190,6 +193,9 @@ func (opt *FailoverOptions) clusterOptions() *ClusterOptions { ConnMaxLifetime: opt.ConnMaxLifetime, TLSConfig: opt.TLSConfig, + + DisableIndentity: opt.DisableIndentity, + IdentitySuffix: opt.IdentitySuffix, } } From d43a9fa887d9284ba42fcd46d46e97c56b34e132 Mon Sep 17 00:00:00 2001 From: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> Date: Tue, 20 Feb 2024 17:44:29 +0200 Subject: [PATCH 19/20] Bump go-redis version to 9.5.1 (#2917) --- example/del-keys-without-ttl/go.mod | 2 +- example/hll/go.mod | 2 +- example/lua-scripting/go.mod | 2 +- example/otel/go.mod | 6 +++--- example/redis-bloom/go.mod | 2 +- example/scan-struct/go.mod | 2 +- extra/rediscensus/go.mod | 4 ++-- extra/rediscmd/go.mod | 2 +- extra/redisotel/go.mod | 4 ++-- extra/redisprometheus/go.mod | 2 +- version.go | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/example/del-keys-without-ttl/go.mod b/example/del-keys-without-ttl/go.mod index 5ba3c335..02955cd6 100644 --- a/example/del-keys-without-ttl/go.mod +++ b/example/del-keys-without-ttl/go.mod @@ -5,7 +5,7 @@ go 1.18 replace github.com/redis/go-redis/v9 => ../.. require ( - github.com/redis/go-redis/v9 v9.5.0 + github.com/redis/go-redis/v9 v9.5.1 go.uber.org/zap v1.24.0 ) diff --git a/example/hll/go.mod b/example/hll/go.mod index 126ba355..27c66c27 100644 --- a/example/hll/go.mod +++ b/example/hll/go.mod @@ -4,7 +4,7 @@ go 1.18 replace github.com/redis/go-redis/v9 => ../.. -require github.com/redis/go-redis/v9 v9.5.0 +require github.com/redis/go-redis/v9 v9.5.1 require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect diff --git a/example/lua-scripting/go.mod b/example/lua-scripting/go.mod index 14f1bde4..03402b00 100644 --- a/example/lua-scripting/go.mod +++ b/example/lua-scripting/go.mod @@ -4,7 +4,7 @@ go 1.18 replace github.com/redis/go-redis/v9 => ../.. -require github.com/redis/go-redis/v9 v9.5.0 +require github.com/redis/go-redis/v9 v9.5.1 require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect diff --git a/example/otel/go.mod b/example/otel/go.mod index b821ecc5..f36a69e3 100644 --- a/example/otel/go.mod +++ b/example/otel/go.mod @@ -9,8 +9,8 @@ replace github.com/redis/go-redis/extra/redisotel/v9 => ../../extra/redisotel replace github.com/redis/go-redis/extra/rediscmd/v9 => ../../extra/rediscmd require ( - github.com/redis/go-redis/extra/redisotel/v9 v9.5.0 - github.com/redis/go-redis/v9 v9.5.0 + github.com/redis/go-redis/extra/redisotel/v9 v9.5.1 + github.com/redis/go-redis/v9 v9.5.1 github.com/uptrace/uptrace-go v1.21.0 go.opentelemetry.io/otel v1.21.0 ) @@ -23,7 +23,7 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect - github.com/redis/go-redis/extra/rediscmd/v9 v9.5.0 // indirect + github.com/redis/go-redis/extra/rediscmd/v9 v9.5.1 // indirect go.opentelemetry.io/contrib/instrumentation/runtime v0.46.1 // indirect go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.17.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.43.0 // indirect diff --git a/example/redis-bloom/go.mod b/example/redis-bloom/go.mod index b9c26864..f152ff26 100644 --- a/example/redis-bloom/go.mod +++ b/example/redis-bloom/go.mod @@ -4,7 +4,7 @@ go 1.18 replace github.com/redis/go-redis/v9 => ../.. -require github.com/redis/go-redis/v9 v9.5.0 +require github.com/redis/go-redis/v9 v9.5.1 require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect diff --git a/example/scan-struct/go.mod b/example/scan-struct/go.mod index 7ec7ab21..6bc8a69c 100644 --- a/example/scan-struct/go.mod +++ b/example/scan-struct/go.mod @@ -6,7 +6,7 @@ replace github.com/redis/go-redis/v9 => ../.. require ( github.com/davecgh/go-spew v1.1.1 - github.com/redis/go-redis/v9 v9.5.0 + github.com/redis/go-redis/v9 v9.5.1 ) require ( diff --git a/extra/rediscensus/go.mod b/extra/rediscensus/go.mod index f37a3d4e..96dc44af 100644 --- a/extra/rediscensus/go.mod +++ b/extra/rediscensus/go.mod @@ -8,7 +8,7 @@ replace github.com/redis/go-redis/extra/rediscmd/v9 => ../rediscmd require ( github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/redis/go-redis/extra/rediscmd/v9 v9.5.0 - github.com/redis/go-redis/v9 v9.5.0 + github.com/redis/go-redis/extra/rediscmd/v9 v9.5.1 + github.com/redis/go-redis/v9 v9.5.1 go.opencensus.io v0.24.0 ) diff --git a/extra/rediscmd/go.mod b/extra/rediscmd/go.mod index 5f1c7cdc..eb38857d 100644 --- a/extra/rediscmd/go.mod +++ b/extra/rediscmd/go.mod @@ -7,5 +7,5 @@ replace github.com/redis/go-redis/v9 => ../.. require ( github.com/bsm/ginkgo/v2 v2.7.0 github.com/bsm/gomega v1.26.0 - github.com/redis/go-redis/v9 v9.5.0 + github.com/redis/go-redis/v9 v9.5.1 ) diff --git a/extra/redisotel/go.mod b/extra/redisotel/go.mod index def67706..a6f00357 100644 --- a/extra/redisotel/go.mod +++ b/extra/redisotel/go.mod @@ -7,8 +7,8 @@ replace github.com/redis/go-redis/v9 => ../.. replace github.com/redis/go-redis/extra/rediscmd/v9 => ../rediscmd require ( - github.com/redis/go-redis/extra/rediscmd/v9 v9.5.0 - github.com/redis/go-redis/v9 v9.5.0 + github.com/redis/go-redis/extra/rediscmd/v9 v9.5.1 + github.com/redis/go-redis/v9 v9.5.1 go.opentelemetry.io/otel v1.16.0 go.opentelemetry.io/otel/metric v1.16.0 go.opentelemetry.io/otel/sdk v1.16.0 diff --git a/extra/redisprometheus/go.mod b/extra/redisprometheus/go.mod index 1c837110..8f8f1da7 100644 --- a/extra/redisprometheus/go.mod +++ b/extra/redisprometheus/go.mod @@ -6,7 +6,7 @@ replace github.com/redis/go-redis/v9 => ../.. require ( github.com/prometheus/client_golang v1.14.0 - github.com/redis/go-redis/v9 v9.5.0 + github.com/redis/go-redis/v9 v9.5.1 ) require ( diff --git a/version.go b/version.go index c632b763..e2c7f3e7 100644 --- a/version.go +++ b/version.go @@ -2,5 +2,5 @@ package redis // Version is the current release version. func Version() string { - return "9.5.0" + return "9.5.1" } From 65c527c39c63cf88de514cb2759d704040795909 Mon Sep 17 00:00:00 2001 From: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:55:33 +0200 Subject: [PATCH 20/20] Change RE image to public RE image (#2935) --- .github/workflows/test-redis-enterprise.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-redis-enterprise.yml b/.github/workflows/test-redis-enterprise.yml index 82946dd3..af66fd1f 100644 --- a/.github/workflows/test-redis-enterprise.yml +++ b/.github/workflows/test-redis-enterprise.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: go-version: [1.21.x] - re-build: ["7.2.4-108"] + re-build: ["7.4.2-54"] steps: - name: Checkout code @@ -36,7 +36,7 @@ jobs: - name: Build cluster working-directory: redis-ee env: - IMAGE: "redislabs/redis-internal:${{ matrix.re-build }}" + IMAGE: "redislabs/redis:${{ matrix.re-build }}" RE_USERNAME: ${{ secrets.RE_USERNAME }} RE_PASS: ${{ secrets.RE_PASS }} RE_CLUSTER_NAME: ${{ secrets.RE_CLUSTER_NAME }}