Reputation: 1081
When working with a single redis instance I can be sure that commands inside MULTI will be processed as a single atomic operation.
What happens when redis operates in cluster mode?
Can I be sure slaves won't get intermediate result of MULTI but only the whole/none of commands that were send as a MULTI(transaction)?
added: all commands inside MULTI operating on the same slot and keys are tagged with {tagName}
Thanks!
Upvotes: 2
Views: 1207
Reputation: 50112
Redis' replication between master and slave(s) is designed to honor MULTI
's assurances, so yeah, you can be sure. Put differently, the replication stream that the slave gets is a built out of the write operations that the master performs. These are sent in order, and since MULTI
guarantees atomicity on the master, it follows that the same applies to the slaves.
Upvotes: 1