You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there are a couple of ways for a dqlite client (C) to ask the server it's connected (S) to whether it's the leader:
Send the LEADER request and compare the returned ID and address to the known ID and address of S. This requires C to keep that information around after establishing the connection, which is fine but not ideal.
Try to perform some operation that requires leadership, for example opening a database or assigning a role to a node. This has the problem that if the operation succeeds, you might affect the state of the cluster or of the connection itself, which is undesirable.
It seems like there is room here for a new wire protocol request/response pair where C simply asks S whether it's the leader, and S returns an empty response if it is the leader and an error if it is not. Alternatively, this could be structured as a backward-compatible extension of the existing LEADER request, where if C sets a field in its request and S is the leader then it will send a response that confirms its leadership instead of/in addition to containing its own address.
The text was updated successfully, but these errors were encountered:
Currently, there are a couple of ways for a dqlite client (C) to ask the server it's connected (S) to whether it's the leader:
It seems like there is room here for a new wire protocol request/response pair where C simply asks S whether it's the leader, and S returns an empty response if it is the leader and an error if it is not. Alternatively, this could be structured as a backward-compatible extension of the existing LEADER request, where if C sets a field in its request and S is the leader then it will send a response that confirms its leadership instead of/in addition to containing its own address.
The text was updated successfully, but these errors were encountered: