Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

RENAME on cluster connections drops the source key's TTL when keys are in different slots

Open Beginner friendly
#3,476 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 8 days

@mp911de is already working on this.

Since Oct 22, 2026.

  • #3481 by @anso33 — open
  • #3483 by @anso33 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java, redis, spring
Domain
backend, databases

Research direction

Start with src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterKeyCommands.java, especially the rename(...) implementation linked in the issue. Trace the cross-slot DUMP → RESTORE → DEL path and check how the source key’s expiry can be preserved. Confirm done by adding or updating a test for renaming across slots with an expiring source key.

Written by the indexing model from the issue text.

Description

type: bug
Summary

When the source and target keys hash to different slots, LettuceClusterKeyCommands.rename(...) doesn't send RENAME. Instead it emulates it with DUMP -> RESTORE -> DEL. The RESTORE call passes a hard-coded TTL of 0, so the target key ends up without an expiry, even when the source key had one:

https://github.com/spring-projects/spring-data-redis/blob/d547023e75ecabc18bc6984913b9fc928a99f8dc/src/main/java/org/springframework/data/redis/connection/lettuce/LettuceClusterKeyCommands.java#L68

As a result, when we rename a key to a diffferent slot, the key loses its TTL.

Question

Is the hard-coded 0 TTL intentional? Or should the emulation keep the source key's TTL?

If dropping the TTL isn't intended, I'd like to propose a fix and open a PR.

Dominant language
Java
Stars
1.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from spring-projects/spring-data-redis

All issues in spring-projects/spring-data-redis

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.