Redis BITFIELD atomicity guarantee

Viewed 33

Is following operation atomic? Cause redis calls it subcommands

BITFIELD key1 GET u8 0 INCRBY u8 0 10 OVERFLOW WRAP
1 Answers

Yes, it is atomic. Every data-path command in Redis is atomic.

A sub-command in Redis simply means a command with an additional 'operation' parameter (e.g., BITFIELD key - where the subcommand can be GET, SET, or INCRBY or CONFIG with GET, HELP, RESETSTAT,REWRITE and SET).

Specifically for BITFIELD, a single command can process multiple operations (each specified by a sub-command). All these operations are processed sequentially, and the whole command is atomic.

Related