Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keys of command in MULTI calls must be in same slot #2050

Open
TracyRAN1 opened this issue Feb 25, 2024 · 3 comments
Open

keys of command in MULTI calls must be in same slot #2050

TracyRAN1 opened this issue Feb 25, 2024 · 3 comments

Comments

@TracyRAN1
Copy link

TracyRAN1 commented Feb 25, 2024

16:48:46 Starting worker pool d0b2361c95b04df99f453342b6b6817b with pid 75627...
16:48:46 Starting worker started with PID 75640
16:48:46 Starting worker started with PID 75641
16:48:46 Worker rq:worker:ea1d295198dc4668ba1aaca2138239a5 started with PID 75640, version 1.15.1
16:48:46 Subscribing to channel rq:pubsub:ea1d295198dc4668ba1aaca2138239a5
16:48:46 Worker rq:worker:51c8a43f600746f68f3adde8d784e79b started with PID 75641, version 1.15.1
16:48:46 Subscribing to channel rq:pubsub:51c8a43f600746f68f3adde8d784e79b
16:48:46 *** Listening on rq...
16:48:46 *** Listening on rq...
16:48:55 rq: apps.sms.tasks.send_work_message(UUID('2d3d5419-7f40-4ac7-a96e-659b893dfdc7'), OrderedDict([('ori_chn', 'LH'), ('ori_sys', 'lhtest'), ('ori_seq', 'test000..., {'ori_sys': 'lhtest', 'create_time': '2024-01-10T06:01:08.334900', 'update_...) (513a1850-bc5b-4ed4-9df5-e7991bb93c6d)
16:48:55 [Job 513a1850-bc5b-4ed4-9df5-e7991bb93c6d]: exception raised while executing (apps.sms.tasks.send_work_message)
Traceback (most recent call last):
File "/xinshi-app/venv/lib/python3.10/site-packages/rq/worker.py", line 1440, in perform_job
self.handle_job_success(job=job, queue=queue, started_job_registry=started_job_registry)
File "/xinshi-app/venv/lib/python3.10/site-packages/rq/worker.py", line 1399, in handle_job_success
pipeline.execute()
File "/xinshi-app/venv/lib/python3.10/site-packages/redis/client.py", line 1478, in execute
return conn.retry.call_with_retry(
File "/xinshi-app/venv/lib/python3.10/site-packages/redis/retry.py", line 46, in call_with_retry
return do()
File "/xinshi-app/venv/lib/python3.10/site-packages/redis/client.py", line 1479, in
lambda: execute(conn, stack, raise_on_error),
File "/xinshi-app/venv/lib/python3.10/site-packages/redis/client.py", line 1348, in execute_transaction
response = self.parse_response(connection, "
")
File "/xinshi-app/venv/lib/python3.10/site-packages/redis/client.py", line 1416, in parse_response
result = Redis.parse_response(self, connection, command_name, **options)
File "/xinshi-app/venv/lib/python3.10/site-packages/redis/client.py", line 553, in parse_response
response = connection.read_response()
File "/xinshi-app/venv/lib/python3.10/site-packages/redis/connection.py", line 524, in read_response
raise response
redis.exceptions.ResponseError: keys of command in MULTI calls must be in same slot

how can i fix this problem?

@selwin
Copy link
Collaborator

selwin commented Feb 26, 2024

I've never seen this error before. Are you by any chance using Redis cluster?

@TracyRAN1
Copy link
Author

Yes, in our production environment at the company, I am required to use Redis cluster.

@TracyRAN1
Copy link
Author

Within a Django environment, I'm utilizing RQ (Redis Queue) for message push tasks where the messages are being successfully delivered. Nonetheless, an issue surfaces during the process of updating the job status.
I think changing the cache key prefix from rq:xxxx to {rq}:xxxx might solve the problem, as it would guarantee that keys land in the same slot.
I attempted to modify the source code myself, but unfortunately, I was unsuccessful, which brings me here seeking assistance. @selwin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants