Lettuce, MSETNX, and Clustered Redis
The source code for what follows can be found on Github.
MSETNX when you’re working with a single redis primary node is simple enough to understand: it sets all of the key/value pairs, or none at all. If one of the keys already exists in the cluster, then all of them are rejected.