Skip to content

[FEATURE] Upgrade github.com/go-redis/redis from v8 to v9 #4890

Description

@shuqingzai

Is your feature request related to a problem?

Yes. go.mod still pins the Redis client to github.com/go-redis/redis/v8 v8.11.5:

github.com/go-redis/redis/v8 v8.11.5

The v8 line is no longer maintained upstream. The github.com/go-redis/redis project moved to v9 long ago (v9.x is the current release series), and v8 is missing security and stability fixes that only land in v9. Projects using go-micro for Redis-backed stores/brokers are also forced to keep the unmaintained v8 dependency in their dependency graph (or hold two versions if they already use v9).

Describe the solution you'd like

Upgrade the Redis client from v8 to v9:

  • Update go.mod (and go.sum) to github.com/go-redis/redis/v9 (latest v9.x).
  • Replace all github.com/go-redis/redis/v8 import paths with github.com/go-redis/redis/v9 across the repository.
  • Adapt to the v9 API changes (context-first: every command takes context.Context as the first argument, and updated NewClient/NewFailoverClient option signatures).
  • Run go mod tidy and make sure go build ./... and go vet ./... pass.

Describe alternatives you've considered

  • Keeping v8: not viable long term since v8 is unmaintained upstream.
  • Migrating to another Redis client (e.g. redis/go-redis/v9 is the same project; alternatives like rueidis would be a much bigger change): unnecessary scope for this issue.

Use case

Anyone using the redis-backed store (store/redis) or redis broker in go-micro. After the upgrade they get the maintained v9 client and a single unified go-redis/redis/v9 version in their dependency graph instead of an unmaintained v8.

Implementation ideas (optional)

  1. Bump the module in go.mod and run go mod tidy.
  2. Mechanical import path replacement (sed -i 's|github.com/go-redis/redis/v8|github.com/go-redis/redis/v9|g') across the repo.
  3. Fix compile errors introduced by the v9 API changes (pass context.Context to commands; update constructor calls).
  4. Run the existing store/broker tests to verify.

Additional context

Current dependency in master go.mod: github.com/go-redis/redis/v8 v8.11.5.

Checklist

  • I've searched existing issues and this is not a duplicate
  • I've checked the roadmap and this isn't already planned
  • I've provided a clear use case
  • I'd be willing to submit a PR for this feature (optional)

Helpful Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions