redis / riot

🧨 Get data in & out of Redis with RIOT

Home Page:http://redis.github.io/riot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

For replicate command, live mode - how do we handle data-consistency in riot?

raghu-nandan-bs opened this issue · comments

When we are replicating data from one redis database to another using live mode, two separate jobs run in parallel - snaptshot job and live only job. Each job has its own queue where items that are read are stored before it is drained by itemWriters in the job.

Lets say the queue size in snapshot job is reasonably large. An item with key 'x' is read and stored in the queue.
Meanwhile, the key was updated, causing the live job to read the key and write it to the destination, all the while the key's item is still waiting in the snapshot job's queue.

The item is then picked by writer in snapshot job and replace existing key in destination redis. Will this not cause inconsistency?

live-job