This commit implements replication for the router's RpcWrite handler. The desired number of replica copies is specified at startup time, and each user write will be fanned-out with the specified replication factor (replicas + 1). A failure to write to any upstreams returns the write error, but a failure to obtain enough ACKs (enough successful writes) after at least 1 ACK will return a "partial write" error - this differentiation is important, as the user's write will be readable after a partial write error has occurred. This currently writes to upstreams serially; this is clearly an opportunity for improvement! A follow-on PR will parallelise writes across the desired number of replicas while maintaining the "at most one ack'd write to one host" invariant. Note that replication is currently hard-coded as disabled. |
||
---|---|---|
.. | ||
common | ||
grpc.rs | ||
http.rs |