pranadb
pranadb copied to clipboard
Executing actions on local leaders
Some operations - such as filling an MV or an index are executed on nodes which are leaders for the shards. This ensures a) The process is only executed on one node in the cluster for each shard b) There is a local shard so the process can be more efficient. Right now we maintain set of local leader shards in push engine, however if leadership changes it could be possible process ends up being carried out on more than one node.
We should improve the process of executing a process on only one shard by executing a command through the shard state machine and have it trigger the process on the node - that way we can ensure it only gets started on one node.