DATAREDIS-1190 - Cluster rename now correctly overwrites existing keys.

rename(…) behavior in cluster-mode is now aligned with standalone Redis behavior that overwrites the target key if it already exists and the renamed key uses a different slot. Previously, the underlying restore command was called without the replace option which caused BUSYKEY failures.

Original Pull Request: #555
This commit is contained in:
Mark Paluch
2020-08-10 11:43:57 +02:00
committed by Christoph Strobl
parent 0929ddbdcd
commit e37f2f08ee
5 changed files with 29 additions and 2 deletions

View File

@@ -270,7 +270,7 @@ class JedisClusterKeyCommands implements RedisKeyCommands {
if (value != null && value.length > 0) {
restore(targetKey, 0, value);
restore(targetKey, 0, value, true);
del(sourceKey);
}
}

View File

@@ -118,7 +118,7 @@ class LettuceClusterKeyCommands extends LettuceKeyCommands {
if (value != null && value.length > 0) {
restore(targetKey, 0, value);
restore(targetKey, 0, value, true);
del(sourceKey);
}
}