Skip to content

Conversation

@zhanghudong
Copy link

Description

Add DisableIdentity configuration option to Redis client for disabling the CLIENT SETINFO command during connection initialization.

Motivation

Some Redis servers (especially versions < 7.2) don't support the CLIENT SETINFO command. This option provides users with flexibility to disable it when needed.

Changes

  • Add DisableIdentity field to RedisConf struct
  • Add DisableIdentity field to Redis struct
  • Add WithDisableIdentity option function
  • Pass DisableIdentity to underlying go-redis client and cluster configurations
  • Update both NewRedis and deprecated NewRedis() methods

Usage

Configuration:

Redis:
  Host: localhost:6379
  Type: node
  DisableIdentity: true  # Optional, default: false

Code:
rds := redis.MustNewRedis(redis.RedisConf{
    Host:            "localhost:6379",
    Type:            "node",
    DisableIdentity: true,
})

Checklist

- Code follows the project's style guidelines
- Changes have been tested
- Documentation comments added
- Backward compatible (optional field with default value)

zhanghudong and others added 3 commits November 24, 2025 11:58
…INFO command

  This option allows users to disable the CLIENT SETINFO command on Redis connect,
  which is useful for Redis servers that don't support this command (Redis < 7.2).
…INFO command

  This option allows users to disable the CLIENT SETINFO command on Redis connect,
  which is useful for Redis servers that don't support this command (Redis < 7.2).
@jeff2go
Copy link

jeff2go commented Nov 28, 2025

Thx, We use Redis 5.0 on tencent cloud, need this for disabling the CLIENT SETINFO command too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants