Skip to content

Latest commit

 

History

History
64 lines (46 loc) · 1.82 KB

README.md

File metadata and controls

64 lines (46 loc) · 1.82 KB

mget and mset for Redis cluster

中文版本

Redis Cluster support mget / mset and other multi command.

Redis version

Use redis@3.2.12 for test.

Jedis version

Use jedis@3.3.0 for test.

Get the code

git clone https://github.com/RedisOptimal/redis-cluster-support-mget.git
git submodule update --init

Redis Patch

00-REDIS-CLUSTER-MULTI-COMMAND

03-REIDS-APPLE-SILCON-CHIP

cd redis@3.2
# Redis cluster mget/mset required patch. Must be apply.
git apply ../00-REDIS-CLUSTER-MULTI-COMMAND.patch
# Fix redis lower version(3.2) can't build in Apple M1 Silicon Chip.
# https://github.com/redis/redis/issues/10420
git apply ../03-REIDS-APPLE-SILCON-CHIP.patch

Patch Jedis

01-JEDIS-JAVA-VERSION-UPGRADE-TO-8

02-JEDIS-SUPPORT-MGET-SERIES

04-JEDIS-SUPPORT-MSET-SERIES

05-JEDIS-MGET-MSET-TEST-CASES

cd jedis@3
# Required patch, upgrade JDK VERSION.
git apply ../01-JEDIS-JAVA-VERSION-UPGRADE-TO-8.patch
# Required patch, let jedis support mget command.
git apply ../02-JEDIS-SUPPORT-MGET-SERIES.patch
# Let jedis support mset command. Need patch 01 and 02 first.
git apply ../04-JEDIS-SUPPORT-MSET-SERIES.patch
# Test case, test and improve it if you like.
git apply ../05-JEDIS-MGET-MSET-TEST-CASES.patch

What I did

Using multi-keys command in redis cluster will meet error CLUSTER_REDIR_CROSS_SLOT

-                    if (slot != thisslot) {
+                    if (slot != thisslot && n != server.cluster->slots[thisslot]) {

Change the server and client to support slot from same node.