mirror of
https://github.com/redis/go-redis.git
synced 2025-07-18 00:20:57 +03:00
fix(txpipeline): keyless commands should take the slot of the keyed (#3411)
* fix(txpipeline): keyless commands should take the slot of the keyed commands * fix(txpipeline): extract only keyed cmds from all cmds * chore(test): Add tests for keyless cmds and txpipeline * fix(cmdSlot): Add preferred random slot * fix(cmdSlot): Add shortlist of keyless cmds * chore(test): Fix ring test * fix(keylessCommands): Add list of keyless commands Add list of keyless Commands based on the Commands output for redis 8 * chore(txPipeline): refactor slottedCommands impl * fix(osscluster): typo
This commit is contained in:
@ -603,6 +603,15 @@ var _ = Describe("ClusterClient", func() {
|
||||
Expect(err).To(MatchError(redis.ErrCrossSlot))
|
||||
})
|
||||
|
||||
It("works normally with keyless commands and no CrossSlot error", func() {
|
||||
pipe.Set(ctx, "A{s}", "A_value", 0)
|
||||
pipe.Ping(ctx)
|
||||
pipe.Set(ctx, "B{s}", "B_value", 0)
|
||||
pipe.Ping(ctx)
|
||||
_, err := pipe.Exec(ctx)
|
||||
Expect(err).To(Not(HaveOccurred()))
|
||||
})
|
||||
|
||||
// doesn't fail when no commands are queued
|
||||
It("returns no error when there are no commands", func() {
|
||||
_, err := pipe.Exec(ctx)
|
||||
|
Reference in New Issue
Block a user