go-redis icon indicating copy to clipboard operation
go-redis copied to clipboard

feat(pubsub): support sharded pub/sub

Open j178 opened this issue 1 year ago • 1 comments

Closes #2115

Sharded pub/sub ref: https://redis.io/docs/reference/cluster-spec/#publishsubscribe

j178 avatar Aug 03 '22 16:08 j178

Seems like the two failing tests is not related.

j178 avatar Aug 03 '22 16:08 j178

Thanks

vmihailenco avatar Oct 05 '22 07:10 vmihailenco

Tested with "GO111MODULE=off", the changes to commands,go, universal.go and commands.go break the build with the following errors: commands.go:355:62: undefined: StringIntMapCmd commands.go:3125:78: undefined: StringIntMapCmd commands.go:3132:9: undefined: NewStringIntMapCmd ring.go:568:18: c.shards undefined (type *Ring has no field or method shards)

I won't create a Pull Request as I don't know the full story behind this overnight merge. But here are the manual patch to temporarily Revert the damage.

ring.go Line 568, disable Ring::SSubscribe universal.go Line 193, remove interface SSubscribe commands.go remove all instances of SPublish, PubSubShardChannels, PubSubShardNumSub

The true fix is to add in the missing line in ring.go, which is likely missed in the merge.

schien-dong avatar Oct 05 '22 19:10 schien-dong

@schien-dong Thanks for your report. I think some refactor changes(renaming StringIntMapCmd to MapStringIntCmd etc) to master after this PR was opened caused the break. I'll send a PR to fix this.

@vmihailenco The current merge strategy is not safe IMHO, if it is forced to merge the master back, and trigger a new CI run, this break can be avoided.

j178 avatar Oct 05 '22 20:10 j178