`migrate(…)` ignores `MigrateOption` when using Lettuce
Maintainers usually reply within 5 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 22/100
Research direction
Start in the Lettuce implementation of migrate(…) in LettuceServerCommands, which calls RedisKeyAsyncCommands::migrate without a MigrateOption. Compare it with JedisServerCommands, which applies options through MigrateParams, and check the DefaultClusterOperations.reshard(…) caller. Done means COPY and REPLACE reach Redis through Lettuce's MigrateArgs overload. Note that PR #3468 is already open against this issue, so review or extend that work rather than starting a parallel fix.
Written by the indexing model from the issue text.
Description
LettuceServerCommands.migrate(…) does not pass the given MigrateOption to Lettuce:
connection.invoke().just(RedisKeyAsyncCommands::migrate, target.getRequiredHost(), target.getRequiredPort(), key,
dbIndex, timeout);
Redis therefore receives a plain MIGRATE without COPY or REPLACE:
// key exists on the source instance only
connection.serverCommands().migrate(key, target, 0, MigrateOption.COPY, 1000);
// the key is removed from the source instance, expected it to be kept
// key exists on both instances
connection.serverCommands().migrate(key, target, 0, MigrateOption.REPLACE, 1000);
// fails with RedisSystemException: Error in execution, expected the key on the target instance to be replaced
For the REPLACE case, Redis replies with ERR Target instance replied with error: BUSYKEY Target key name already exists.
JedisServerCommands applies both options through MigrateParams since 4.1. Lettuce offers migrate(host, port, db, timeout, MigrateArgs), which sends the same command with COPY or REPLACE appended.
Reproduced on main against two Redis 8.6.2 instances. 3.5.x, 4.0.x and 4.1.x contain the same code; on 3.5.x and 4.0.x, JedisServerCommands does not apply the option either. Within the project, DefaultClusterOperations.reshard(…) is the only caller and passes MigrateOption.COPY, so it would send COPY with Lettuce as well after a fix. I will submit a PR with a fix and tests.
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from spring-projects/spring-data-redis
-
DefaultRedisList.get(int) does not reject an index equal to the list sizePossibly taken @ryujungkyun claimed this today. Openstatus: waiting-for-triage
Difficulty 1/5 Under an hour Newbie friendliness 68/100
spring-projects/spring-data-redis#3471 ·
Maintainers usually reply within 5 days
-
`RedisList.reversed()` view returns an empty `range` and `trim` removes all elementsPossibly taken @CCCLL claimed this 2 days ago. Openstatus: waiting-for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
spring-projects/spring-data-redis#3461 ·
Maintainers usually reply within 5 days
-
PathIndexResolver iterates byte[] element-by-element, causing O(n) overheadPossibly taken @zemiles claimed this 2 days ago. Openstatus: waiting-for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
spring-projects/spring-data-redis#3460 ·
Maintainers usually reply within 5 days
-
`RedisList.putFirst(…)` adds the element at the tail of the listPossibly taken @CCCLL claimed this 1 day ago. Openstatus: waiting-for-triage
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
spring-projects/spring-data-redis#3464 ·
Maintainers usually reply within 5 days
-
Asynchronous Redis cache writes ignore failed lock acquisition and delete an existing lockPossibly taken @mp911de claimed this 10 days ago. Opentype: bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
spring-projects/spring-data-redis#3450 · 1 assignee ·
Maintainers usually reply within 5 days
All issues in spring-projects/spring-data-redis
Similar issues
-
agent-java community triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
elastic/apm-agent-java#4594 ·
Maintainers usually reply within 1 day
-
area/plugin good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
kestra-io/plugin-soda#137 ·
-
area/plugin good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
kestra-io/plugin-aws#816 ·
Maintainers usually reply within 2 days
-
area/plugin good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kestra-io/plugin-kestra#200 ·
Maintainers usually reply within 1 day
-
bug untriaged
Difficulty 1/5 Under an hour Newbie friendliness 92/100
opensearch-project/search-relevance#618 ·
Maintainers usually reply within 3 days