leader election again
Apr. 15th, 2013 06:13 pmвот, наткнулся на изделие мартина фаулера: lmax.
интересная и нетривиальная часть, как обычно, упомянута одним предложением: Should the master node go down, it's lack of heartbeat will be noticed, another node becomes master, starts processing input events, and starts its replicator.
вопросы, как обычно - кем will be noticed? что гарантирует единственность нового мастера? чем гарантируется, что старый мастер не очухается - или, если очухается, поймёт, что он уже не мастер?
в любом случае, интересное чтиво, например:
10: While the LMAX team shares much of the current interest in functional programming, they believe that the OO approach provides a better approach for this kind of problem. They've noticed that as they work to write faster code, they move away from a functional style towards OO style. Partly this because of the copying of data that functional styles require to maintain immutability. But it's also because objects provide a better model of a complex domain with a richer choice of data structures.
а, и ещё одного я не понял. почему фаулер считает, что lock приводит к context switching и cache invalidation? To deal with the write contention a queue often uses locks. But if a lock is used, that can cause a context switch to the kernel. When this happens the processor involved is likely to lose the data in its caches.
интересная и нетривиальная часть, как обычно, упомянута одним предложением: Should the master node go down, it's lack of heartbeat will be noticed, another node becomes master, starts processing input events, and starts its replicator.
вопросы, как обычно - кем will be noticed? что гарантирует единственность нового мастера? чем гарантируется, что старый мастер не очухается - или, если очухается, поймёт, что он уже не мастер?
в любом случае, интересное чтиво, например:
10: While the LMAX team shares much of the current interest in functional programming, they believe that the OO approach provides a better approach for this kind of problem. They've noticed that as they work to write faster code, they move away from a functional style towards OO style. Partly this because of the copying of data that functional styles require to maintain immutability. But it's also because objects provide a better model of a complex domain with a richer choice of data structures.
а, и ещё одного я не понял. почему фаулер считает, что lock приводит к context switching и cache invalidation? To deal with the write contention a queue often uses locks. But if a lock is used, that can cause a context switch to the kernel. When this happens the processor involved is likely to lose the data in its caches.
(no subject)
Date: 2013-04-16 04:45 am (UTC)(no subject)
Date: 2013-04-16 05:40 am (UTC)Вы меня извините за сравнение, но чем-то мне это отечественные конференции "Хайло" напоминает, пусть и несправедливо. Такой же чемпионат по скорости записи в оперативную память.
(no subject)
Date: 2013-04-16 09:07 am (UTC)(no subject)
Date: 2013-05-24 06:40 am (UTC)Ну, это как раз просто. Тут noticed в смысле - остальными узлами кластера. Мастер очевидно регулярно посылает сообщения и том, что живой. Как только одно из них не доходит, инициируются выборы нового мастера.
Не могу ничего сказать про конкретно этот продукт, но напрашивается идея посмотреть на аналогичный Hadoop (а точнее на его часть ZooKeeper), где аналогичные первому вопросы возникают тоже. И насколько я помню, там именно что-то вроде выборов мастера происходит.
(no subject)
Date: 2013-05-24 07:39 pm (UTC)