Re:InfluxDB Clustering Design – Neither CP or AP
by pauldix on Wednesday June 03, 2015 @10:13PM
(#9657059)
They could have an out of date view of the cluster. Like which databases exist, or which servers exist.
However, those cases are fine. If a database was created and a server doesn't have a copy of it. When a write comes in it'll be a cache miss so it'll hit the Raft system to get the info.
In the case of a new server joining the cluster, it won't get new data assigned until a shard group gets created and a shard gets assigned to it. When a write comes in if a node doesn't have a shard group for that time range, it'll all out to the Raft system to get the information.
So yes, it's possible for some servers to have a stale view of this cluster metadata, but we work around it by having them request the information on demand and periodically refresh the entire thing.
Re:InfluxDB Clustering Design – Neither CP or AP
by schmichael on Wednesday June 03, 2015 @10:30PM
(#9657115)
Thanks for the more detailed explanation! Really looking forward to further posts -- not to mention 0.9!
Re:InfluxDB Clustering Design – Neither CP or AP
by lobster_johnson on Wednesday June 03, 2015 @08:51PM
(#9656827)
I believe Raft is supposed to handle this; every modification is a log entry, and every recipient has to ack the log entry, a bit like two-phased commit.
Re:InfluxDB Clustering Design – Neither CP or AP
by dcb18 on Wednesday June 03, 2015 @08:56PM
(#9656839)
This is incorrect, only reads from the current Raft master are guaranteed to not be stale. In the case of InfluxDB, I think caching is safe because the shard metadata is immutable.
Re:InfluxDB Clustering Design – Neither CP or AP
by schmichael on Wednesday June 03, 2015 @09:23PM
(#9656907)
Where are you seeing that cluster metadata is immutable? I don't even know how that would work. Surely nodes, databases, shards, users, permissions, etc. all can change?
Re:InfluxDB Clustering Design – Neither CP or AP
by dcb18 on Wednesday June 03, 2015 @09:37PM
(#9656946)
Yep, you're right.
Re:InfluxDB Clustering Design – Neither CP or AP
by schmichael on Wednesday June 03, 2015 @09:22PM
(#9656906)
But the section I quoted said that local metadata queries go to the cache which is only updated "periodically."
How does this avoid nodes doing stale reads from the inmemory copy resulting in each node having a slightly different out-of-date view of the cluster?