Skip to content

Add missing command deprecations#4397

Merged
ggivo merged 5 commits into
masterfrom
im/add-missing-command-deprecations
Jan 23, 2026
Merged

Add missing command deprecations#4397
ggivo merged 5 commits into
masterfrom
im/add-missing-command-deprecations

Conversation

@uglide

@uglide uglide commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

Redis Deprecated Commands and Arguments

Source: Redis Commands JSON
Generated: January 2026


Deprecated Commands

The following 21 commands have been deprecated across all Redis versions:

Command Deprecated Since Replacement Description
SUBSTR 2.0.0 GETRANGE Returns a substring from a string value.
PSETEX 2.6.12 SET with the PX argument Sets both string value and expiration time in milliseconds of a key. The key is created if it doesn't exist.
SETEX 2.6.12 SET with the EX argument Sets the string value and expiration time of a key. Creates the key if it doesn't exist.
SETNX 2.6.12 SET with the NX argument Set the string value of a key only when the key doesn't exist.
HMSET 4.0.0 HSET with multiple field-value pairs Sets the values of multiple fields.
CLUSTER SLAVES 5.0.0 CLUSTER REPLICAS Lists the replica nodes of a master node.
SLAVEOF 5.0.0 REPLICAOF Sets a Redis server as a replica of another, or promotes it to being a master.
BRPOPLPUSH 6.2.0 BLMOVE with the RIGHT and LEFT arguments Pops an element from a list, pushes it to another list and returns it. Block until an element is available otherwise. Deletes the list if the last element was popped.
GEORADIUS 6.2.0 GEOSEARCH and GEOSEARCHSTORE with the BYRADIUS argument Queries a geospatial index for members within a distance from a coordinate, optionally stores the result.
GEORADIUSBYMEMBER 6.2.0 GEOSEARCH and GEOSEARCHSTORE with the BYRADIUS and FROMMEMBER arguments Queries a geospatial index for members within a distance from a member, optionally stores the result.
GEORADIUSBYMEMBER_RO 6.2.0 GEOSEARCH with the BYRADIUS and FROMMEMBER arguments Returns members from a geospatial index that are within a distance from a member.
GEORADIUS_RO 6.2.0 GEOSEARCH with the BYRADIUS argument Returns members from a geospatial index that are within a distance from a coordinate.
GETSET 6.2.0 SET with the GET argument Returns the previous string value of a key after setting it to a new value.
RPOPLPUSH 6.2.0 LMOVE with the RIGHT and LEFT arguments Returns the last element of a list after removing and pushing it to another list. Deletes the list if the last element was popped.
ZRANGEBYLEX 6.2.0 ZRANGE with the BYLEX argument Returns members in a sorted set within a lexicographical range.
ZRANGEBYSCORE 6.2.0 ZRANGE with the BYSCORE argument Returns members in a sorted set within a range of scores.
ZREVRANGE 6.2.0 ZRANGE with the REV argument Returns members in a sorted set within a range of indexes in reverse order.
ZREVRANGEBYLEX 6.2.0 ZRANGE with the REV and BYLEX arguments Returns members in a sorted set within a lexicographical range in reverse order.
ZREVRANGEBYSCORE 6.2.0 ZRANGE with the REV and BYSCORE arguments Returns members in a sorted set within a range of scores in reverse order.
CLUSTER SLOTS 7.0.0 CLUSTER SHARDS Returns the mapping of cluster slots to nodes.
QUIT 7.2.0 Just closing the connection Closes the connection.

Summary by Version

Version Number of Deprecated Commands
2.0.0 1
2.6.12 3
4.0.0 1
5.0.0 2
6.2.0 12
7.0.0 1
7.2.0 1
Total 21

Deprecated Command Arguments

The following 1 command argument has been deprecated:

Parent Command Argument Name Deprecated Since Replacement
CLIENT KILL old-format 2.8.12 N/A

Details

CLIENT KILL - old-format argument

  • Deprecated Since: Redis 2.8.12
  • Replacement: Not specified
  • Notes: The old format for CLIENT KILL used a simple ip:port syntax. The newer format uses keyword-based arguments like ID, TYPE, ADDR, LADDR, SKIPME, etc.

Migration Recommendations

When upgrading Redis versions, consider the following migration strategies:

String Commands

  • Replace SUBSTRGETRANGE
  • Replace SETEX key seconds valueSET key value EX seconds
  • Replace PSETEX key milliseconds valueSET key value PX milliseconds
  • Replace SETNX key valueSET key value NX
  • Replace GETSET key valueSET key value GET

Hash Commands

  • Replace HMSET key field value [field value ...]HSET key field value [field value ...]

List Commands

  • Replace RPOPLPUSH source destinationLMOVE source destination RIGHT LEFT
  • Replace BRPOPLPUSH source destination timeoutBLMOVE source destination RIGHT LEFT timeout

Sorted Set Commands

  • Replace ZRANGEBYLEX key min maxZRANGE key min max BYLEX
  • Replace ZRANGEBYSCORE key min maxZRANGE key min max BYSCORE
  • Replace ZREVRANGE key start stopZRANGE key start stop REV
  • Replace ZREVRANGEBYLEX key max minZRANGE key max min REV BYLEX
  • Replace ZREVRANGEBYSCORE key max minZRANGE key max min REV BYSCORE

Geospatial Commands

  • Replace GEORADIUSGEOSEARCH with BYRADIUS
  • Replace GEORADIUS_ROGEOSEARCH with BYRADIUS
  • Replace GEORADIUSBYMEMBERGEOSEARCH with BYRADIUS and FROMMEMBER
  • Replace GEORADIUSBYMEMBER_ROGEOSEARCH with BYRADIUS and FROMMEMBER

Replication Commands

  • Replace SLAVEOF host portREPLICAOF host port
  • Replace CLUSTER SLAVES node-idCLUSTER REPLICAS node-id

Cluster Commands (Redis 7.0+)

  • Replace CLUSTER SLOTSCLUSTER SHARDS

Connection Commands (Redis 7.2+)

  • Replace QUIT → Simply close the connection directly

Notes

  1. Deprecated ≠ Removed: Deprecated commands are still functional but may be removed in future Redis versions.
  2. Backward Compatibility: Most deprecated commands continue to work for backward compatibility, but new code should use the recommended replacements.
  3. Performance: In most cases, the replacement commands offer the same or better performance.
  4. Version Awareness: When writing Redis client libraries or applications, consider checking the Redis server version to use appropriate commands.

@github-actions

github-actions Bot commented Jan 13, 2026

Copy link
Copy Markdown

Test Results

   285 files  ±0    285 suites  ±0   11m 56s ⏱️ -24s
10 469 tests ±0  9 199 ✅  - 1 011  1 270 💤 +1 011  0 ❌ ±0 
 2 774 runs  ±0  2 770 ✅ ±    0      4 💤 ±    0  0 ❌ ±0 

Results for commit 0d595e6. ± Comparison against base commit af6454d.

This pull request skips 1011 tests.
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[1] ‑ testHgetdel
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[1] ‑ testHgetdelBinary
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[1] ‑ testHgetex
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[1] ‑ testHgetexBinary
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[1] ‑ testHsetex
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[1] ‑ testHsetexBinary
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[2] ‑ testHgetdel
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[2] ‑ testHgetdelBinary
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[2] ‑ testHgetex
redis.clients.jedis.commands.commandobjects.CommandObjectsHashCommandsTest[2] ‑ testHgetexBinary
…

♻️ This comment has been updated with latest results.

@ggivo ggivo added this to the 8.0.0 milestone Jan 13, 2026

@ggivo ggivo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity, the Javadoc should also indicate the Jedis version in which this deprecation is introduced. For example:

/**
 * @deprecated Use {@link HashBinaryCommands#hset(byte[], Map)}.
 * Deprecated in Jedis 8.0.0. Mirrors Redis deprecation since 4.0.0.
 */
@Deprecated

@uglide

uglide commented Jan 23, 2026

Copy link
Copy Markdown
Contributor Author

For clarity, the Javadoc should also indicate the Jedis version in which this deprecation is introduced. For example:

/**
 * @deprecated Use {@link HashBinaryCommands#hset(byte[], Map)}.
 * Deprecated in Jedis 8.0.0. Mirrors Redis deprecation since 4.0.0.
 */
@Deprecated

Done

@ggivo ggivo merged commit c19a1f6 into master Jan 23, 2026
12 checks passed
@uglide uglide deleted the im/add-missing-command-deprecations branch January 23, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants