--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at http://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
Hi Josiah,Thanks for Your reply.And I think You are right and wrong at the same time. :)
Yes, I am agreed with You regarding sequence of data replication. Especially if we have data splitted between different databases (db0, db1, db2 etc). but commited in a single transaction on some Master.In this case if to imagine suggested feature is used and during replication from Master to Slave of db0 (high priority data as suggested) and db1 (more low priority) some other data of some other, more late transaction of db0 may easily come to Slave before data of first transaction for db1.
But... this is a question of correct data organization. Of course if I switch on this possible feature I must understand all consequences that may happen if I start to push data with the same importance into different databases with different priority. :)
I think nobody will do like this :)
I do my request because I want to put into some db only data of same priority. And of course replication sequence for same db will have the same order as it was commited on a Master side. Sorting should affect only sequences of different databases.
Again I remind You that by default such feature should be switched off. And I think if somebody decided to use SETDBPRIORITY and creates above mentioned incorrect scenario then appropriate error should be fired.
So could You please clear if such thing may be implemented by suggested way (my first mail)?
I am not so familar with Redis source and it will take much more time for me to answer this question.Thanks in advance,
Dmitriy
пятница, 14 ноября 2014 г., 9:39:10 UTC+2 пользователь Dmitriy Kaloshin написал:Hi all,it looks like nobody yet asked for a subject except one post Is replication strictly sequential? where Josiah Carlson answered YES.To understand my point I have to present a small and simple example:1. We have Master and Slave.2. On Master we have large transaction of some data.3. Then again we have small transaction of another data but very important one.4. We expect to get it on the Slave but unfortunately due to #1 we have to wait until time when first data processes its synchronization.5. If we have bad internet connection then sync time of second transaction becomes critical for us.I made a small research using Windows port of Redis Source 2.8.17 (MSVS 2013) where I built a local environment with master and slave and played over in debugger to see how everything goes on.At first side (May be I am wrong) I discovered that each change on master side fires creation of aeFileEvent and then it processes through method aeProcessEvents.It looks like it is not so difficult to add another field with name Priority to struct aeFileEbent and at the same time to make some sorting inside of aeProcessEvents.It would be very nice to have such feature as an option likeA. Probably priority will be switched off in config by default.B. When it is switched on then set priority depending on DB. Like db0 has highest priority, db1 lower priority and so on.C. Probably to create another command with name SETDBPRIORITY where user will configure DBs at rin time.Does it make sense?brgdsDmitriy
--
Well, yes - we thought of such "plan-B", but downside of solution is much heavier clients, need for more resources (especially connections) and need to manage it all on both sides.
Managing priority on network level is not easy either because the volume of such connections (packs of connections of different priorities) and the fact that internet routers would just ignore the external QoS suggestions. Using internal Redis QoS provides much cleaner solution at least at first glance.
Are there any commands beside MOVE and EVAL(SHA) we should be potentially afraid of? Using SELECT inside MULTI block? Regarding transactional integrity between DBs I would not afraid too much at least if it is not leading to unrecoverable data corruption. And to prevent data corruption we just need to either avoid commands that act between databases or force syncing those two/all DBs if such commands popped up (pause higher priority to restore original sequence).
BTW is it possible to replicate changes of such commands (say the EVAL command) instead of the command itself (Sorry if I am mistaken in concepts as I am quite new to Redis internals).
Effectively translating them to sequence of DEL/(M/L)SETs ? Purpose - creation really slim read only clients that supports only subset of RESP protocol commands e.g. have no lua engine.