kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

XREAD got unexpected empty response

Open mnizhq007 opened this issue 1 year ago • 5 comments

Search before asking

  • [X] I had searched in the issues and found no similar issues.

Version

OS:centos6.9 KVRocks:2.3.0 redis-cli:6.2.6/4.0.10

Minimal reproduce step

I have a kvrocks cluster with 3 masters and 3 slaves.

Connect and blocking read the queue on master-A

redis-cli -c -h {Master A's IP} -p {Master A's Port} -a password
XREAD BLOCK 10000 STREAMS test-mq $

then publish a new message on master-B

redis-cli -c -h {Master B's IP} -p {Master B's Port} -a password
XADD test-mq * key1 value1

What did you expect to see?

I would like to see normal consumption data, for example.

    1. "test-mq"
        1. "1681209941456-0"
          1. "key1"
          2. "value1" (3.51s)

What did you see instead?

I can see that the consume command in step 1 is unable to see the data and only sees an empty message. (nil) (10.00s)

Anything Else?

No response

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

mnizhq007 avatar Apr 11 '23 11:04 mnizhq007

Please make sure that there is redirection happening when executing the XADD command.

Do you mean need to trigger the slot migration between step 1 and step 2?

git-hulk avatar Apr 11 '23 11:04 git-hulk

Because the application randomly connects to a node when it connects. Only randomly connecting to different nodes for producing and consuming data during the connection does not require slot migration

mnizhq007 avatar Apr 11 '23 11:04 mnizhq007

OK, thanks. I got your point now.

git-hulk avatar Apr 11 '23 11:04 git-hulk

@git-hulk Do we need something to do in order to resolve this issue?

torwig avatar Jun 09 '23 07:06 torwig

Hi @torwig, thanks for your reminder. I forgot to reproduce and investigate this issue, I'm not sure if the redis-cli failed to redirect the STREAM key.

git-hulk avatar Jun 09 '23 07:06 git-hulk