Skip to content

Commit 050889b

Browse files
ndyakovofekshenawa
authored andcommitted
fix(txpipeline): keyless commands should take the slot of the keyed (redis#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
1 parent 0cf9947 commit 050889b

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

command.go

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,55 @@ const (
141141
CmdTypeTSTimestampValueSlice = routing.CmdTypeTSTimestampValueSlice
142142
)
143143

144+
// keylessCommands contains Redis commands that have empty key specifications (9th slot empty)
145+
// Only includes core Redis commands, excludes FT.*, ts.*, timeseries.*, search.* and subcommands
146+
var keylessCommands = map[string]struct{}{
147+
"acl": {},
148+
"asking": {},
149+
"auth": {},
150+
"bgrewriteaof": {},
151+
"bgsave": {},
152+
"client": {},
153+
"cluster": {},
154+
"config": {},
155+
"debug": {},
156+
"discard": {},
157+
"echo": {},
158+
"exec": {},
159+
"failover": {},
160+
"function": {},
161+
"hello": {},
162+
"latency": {},
163+
"lolwut": {},
164+
"module": {},
165+
"monitor": {},
166+
"multi": {},
167+
"pfselftest": {},
168+
"ping": {},
169+
"psubscribe": {},
170+
"psync": {},
171+
"publish": {},
172+
"pubsub": {},
173+
"punsubscribe": {},
174+
"quit": {},
175+
"readonly": {},
176+
"readwrite": {},
177+
"replconf": {},
178+
"replicaof": {},
179+
"role": {},
180+
"save": {},
181+
"script": {},
182+
"select": {},
183+
"shutdown": {},
184+
"slaveof": {},
185+
"slowlog": {},
186+
"subscribe": {},
187+
"swapdb": {},
188+
"sync": {},
189+
"unsubscribe": {},
190+
"unwatch": {},
191+
}
192+
144193
type Cmder interface {
145194
// command name.
146195
// e.g. "set k v ex 10" -> "set", "cluster info" -> "cluster".

0 commit comments

Comments
 (0)