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

For Pub sub cluster using the io.lettuce.core.pubsub.PubSubCommandArgs, due which does not make use of hash and does not distribute the channels across shards #2555

Closed
ramnaresh2051 opened this issue Nov 18, 2023 · 3 comments
Labels
status: duplicate A duplicate of another issue

Comments

@ramnaresh2051
Copy link

Bug Report

For Pub sub cluster using the io.lettuce.core.pubsub.PubSubCommandArgs,
And in this below overridden method, which always return null key
@OverRide
public ByteBuffer getFirstEncodedKey() {
return null;
}

due which does not make use of hash key and does not distribute the data(channel subscription) across the shards.

Current Behavior

ClusterDistributionChannelWriter -->
ByteBuffer encodedKey = args.getFirstEncodedKey(); // this gets called to identify the encoded key, however due to PubSubCommandArgs above behaviour its always return null and complete data(channel subscription) goes to one shard only.

Expected behavior/code

Pubsub should make use of CommandArgs instead of PubSubCommandArgs Or should provide a option to override this.

Environment

  • Lettuce version(s): [6.2.6.RELEASE]

Possible solutions

RedisPubSubReactiveCommandsImpl -- a option can be provided to pass CommandArgs while creating cluster client as a client options.

@mp911de
Copy link
Collaborator

mp911de commented Nov 20, 2023

Care to elaborate on what you're trying to achieve? Cluster Pub/Sub messages get replicated to each cluster node so there's no point in applying key slot hashing.

On the other side, shared Pub/Sub, would benefit from such routing, see #1984

@mp911de mp911de added the status: waiting-for-feedback We need additional information before we can continue label Nov 20, 2023
@ramnaresh2051
Copy link
Author

ramnaresh2051 commented Nov 21, 2023

So do we have any plan to implement #1984 ?
Intentionally for pubsub we have dropped slot hashing, did we face any performance issue for that ?

@mp911de
Copy link
Collaborator

mp911de commented Nov 21, 2023

I don't know about you, but I have a plan to eventually implement the feature. Getting support from users and the community would help to speed up the process.

Intentionally for pubsub we have dropped slot hashing, did we face any performance issue for that ?

Yes, that is by intent. Routing Pub/Sub commands to the default connection avoids creating additional connections to cluster nodes.

@mp911de mp911de closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2023
@mp911de mp911de added status: duplicate A duplicate of another issue and removed status: waiting-for-feedback We need additional information before we can continue labels Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants