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:
@ -364,15 +364,22 @@ var _ = Describe("ClusterClient", func() {
|
||||
It("select slot from args for GETKEYSINSLOT command", func() {
|
||||
cmd := NewStringSliceCmd(ctx, "cluster", "getkeysinslot", 100, 200)
|
||||
|
||||
slot := client.cmdSlot(cmd)
|
||||
slot := client.cmdSlot(cmd, -1)
|
||||
Expect(slot).To(Equal(100))
|
||||
})
|
||||
|
||||
It("select slot from args for COUNTKEYSINSLOT command", func() {
|
||||
cmd := NewStringSliceCmd(ctx, "cluster", "countkeysinslot", 100)
|
||||
|
||||
slot := client.cmdSlot(cmd)
|
||||
slot := client.cmdSlot(cmd, -1)
|
||||
Expect(slot).To(Equal(100))
|
||||
})
|
||||
|
||||
It("follows preferred random slot", func() {
|
||||
cmd := NewStatusCmd(ctx, "ping")
|
||||
|
||||
slot := client.cmdSlot(cmd, 101)
|
||||
Expect(slot).To(Equal(101))
|
||||
})
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user