RedisLabs / redis-cluster-proxy

A proxy for Redis clusters.
GNU Affero General Public License v3.0
990 stars 129 forks source link

EVAL command can't work #85

Open chenjie199234 opened 3 years ago

chenjie199234 commented 3 years ago

proxy start without cross slot support

./redis-cluster-proxy 127.0.0.1:10001
[2020-10-31 22:43:17.247/M] Redis Cluster Proxy v0.9.102
[2020-10-31 22:43:17.247/M] Commit: (00000000/0)
[2020-10-31 22:43:17.247/M] PID: 15979
[2020-10-31 22:43:17.247/M] OS: Darwin 19.6.0 x86_64
[2020-10-31 22:43:17.247/M] Bits: 64
[2020-10-31 22:43:17.247/M] Log level: info
[2020-10-31 22:43:17.247/M] Connections pool size: 10 (respawn 2 every 50ms if below 10)
[2020-10-31 22:43:17.248/M] Listening on *:7777
[2020-10-31 22:43:17.248/M] Starting 8 threads...
[2020-10-31 22:43:17.248/M] Fetching cluster configuration...
[2020-10-31 22:43:17.249/M] Cluster Address: 127.0.0.1:10001
[2020-10-31 22:43:17.249/M] Cluster has 3 masters and 0 replica(s)
[2020-10-31 22:43:17.249/M] Increased maximum number of open files to 10278 (it was originally set to 2560).
[2020-10-31 22:43:17.264/M] All thread(s) started!

redis command exec result (there is only one key "test")

redis-cli -p 7777
127.0.0.1:7777> eval "return {KEYS[1],ARGV[1]}" 1 "test" 123
(error) ERR Cross-slot queries are disabled. They can be enabled by using the --enable-cross-slot option, or by calling `PROXY CONFIG SET enable-cross-slot 1`. WARN: cross-slot queries can break the atomicity of the query itself.

proxy start with cross slot support

./redis-cluster-proxy --enable-cross-slot 127.0.0.1:10001
[2020-10-31 22:46:57.756/M] Redis Cluster Proxy v0.9.102
[2020-10-31 22:46:57.756/M] Commit: (00000000/0)
[2020-10-31 22:46:57.756/M] PID: 16002
[2020-10-31 22:46:57.756/M] OS: Darwin 19.6.0 x86_64
[2020-10-31 22:46:57.756/M] Bits: 64
[2020-10-31 22:46:57.756/M] Log level: info
[2020-10-31 22:46:57.756/M] Connections pool size: 10 (respawn 2 every 50ms if below 10)
[2020-10-31 22:46:57.757/M] Listening on *:7777
[2020-10-31 22:46:57.757/M] Starting 8 threads...
[2020-10-31 22:46:57.757/M] Fetching cluster configuration...
[2020-10-31 22:46:57.758/M] Cluster Address: 127.0.0.1:10001
[2020-10-31 22:46:57.758/M] Cluster has 3 masters and 0 replica(s)
[2020-10-31 22:46:57.758/M] Increased maximum number of open files to 10278 (it was originally set to 2560).
[2020-10-31 22:46:57.774/M] All thread(s) started!

redis command exec result (there is only one key "test")

redis-cli -p 7777
127.0.0.1:7777> EVAL "return {KEYS[1],ARGV[1]}" 1 "test" 123
(error) ERR Cross-slot queries are not supported for this command
loGit123 commented 1 year ago

Hi @chenjie199234 , were you able resolve this query ?