Returning errors during mutations in RAFT

Hey @xiang90,

I’m implementing mutations via RAFT in Dgraph. Previously, in our distributed system, if any of the nodes weren’t able to apply the mutations, they would return error, which we’d in turn return to the client. However, with RAFT, all we can do is to propose the change, and let RAFT do the consensus, before trying to apply the mutation. Is there a way for us to block the reply to client and return back with whether the mutations were applied successfully or not?

The only way I can see right now is to reply back immediately, and then let RAFT do a best effort in terms of applying the mutation – which isn’t ideal.

Thanks!

Cheers,
Manish

Yes. In etcd, we do not reply to clients until the proposal get committed and applied. We might return timeout or apply error to clients. The way to do it is to assign each proposal a uuid. The client request waits on that UUID’s finish. Once the proposal get applied, it will send a notification to the client request that waiting on the UUID if any.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.