Reputation: 697
I am running Redis in sentinels mode, It has happened many times that I write data in Redis but while reading same key I don't get expected value.
I am wondering if it is possible when I write data it is written on Master and while reading it goes to slave but since Replication in Redis is asynchronous in nature all slaves are not updated and hence I don't get updated value/ valid value.
I am using redisson client and three servers for sentinel configuration.
Upvotes: 0
Views: 422
Reputation: 10783
It's not possible. To overcome this you may choose from follow options:
readMode
config parameter to MASTER
RBatch
object with defined syncSlaves setting BatchOptions.syncSlaves(2, 10, TimeUnit.SECONDS)
Upvotes: 1