kvrocks icon indicating copy to clipboard operation
kvrocks copied to clipboard

PubSub publish behaves differently with Redis in cluster mode

Open jcy1001 opened this issue 1 year ago • 5 comments

Search before asking

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

Version

kvrocks2.7 pubsub测试了发现了个问题,在集群部署模式下 subscribe 后,publish 这个channel一个消息,无法消费到;这个在redis上面没有问题。我用monitor看到的现象是redis和kvrocks,sub和pub的server收到消息的node都是不一样,但kvrocks无法消费到,redis是ok的,

Minimal reproduce step

kvrocks2.7 pubsub测试了发现了个问题,在集群部署模式下 subscribe 后,publish 这个channel一个消息,无法消费到;这个在redis上面没有问题。我用monitor看到的现象是redis和kvrocks,sub和pub的server收到消息的node都是不一样,但kvrocks无法消费到,redis是ok的,

What did you expect to see?

the same with redis ,will consume this msg

What did you see instead?

can consume this msg

Anything Else?

No response

Are you willing to submit a PR?

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

jcy1001 avatar Mar 12 '24 08:03 jcy1001

@jcy1001 Which client you're using?

git-hulk avatar Mar 12 '24 08:03 git-hulk

@git-hulk I found redis7 has this code ,but kvrocks doesnot propagatetocluster

/* PUBLISH */ void publishCommand(client *c) { if (server.sentinel_mode) { sentinelPublishCommand(c); return; }

int receivers = pubsubPublishMessageAndPropagateToCluster(c->argv[1],c->argv[2],0);
if (!server.cluster_enabled)
    forceCommandPropagation(c,PROPAGATE_REPL);
addReplyLongLong(c,receivers);

}

jcy1001 avatar Mar 13 '24 01:03 jcy1001

@jcy1001 Thanks for your investigation. So what you mean is PubSub behaves differently with Redis in cluster mode?

git-hulk avatar Mar 13 '24 06:03 git-hulk

@jcy1001 Thanks for your investigation. So what you mean is PubSub behaves differently with Redis in cluster mode?

是,在redis集群下面客户端可以收到通知, kvrocks下收不到通知,分析看了是redis集群模式下,有做cluster的扩散,kvrocks只能通知本shard下的客户端

jcy1001 avatar Mar 13 '24 07:03 jcy1001

@jcy1001 Got your point, thank you!

git-hulk avatar Mar 13 '24 12:03 git-hulk