valkey-io / valkey

A flexible distributed key-value datastore that is optimized for caching and other realtime workloads.
https://valkey.io
Other
17.36k stars 656 forks source link

[NEW] Supports invoke RM_Call() on the replica node for read-only cmd #1323

Open jjz921024 opened 3 days ago

jjz921024 commented 3 days ago

The problem/use-case that the feature addresses

I want to implement a module that exec read-only commands on the replica node. such as:

RedisModuleCallReply *reply = RedisModule_Call(ctx, "TYPE", "s", key);

But, the return value reply is always NULL.

hwware commented 3 days ago

Can you try the RedisModule_Call(ctx, "TYPE", "c", key); ? I try this way works (BTW, i just set key as 1000, I am not sure how your key type)