Commit 8811f8b4 authored by Levin Zimmermann's avatar Levin Zimmermann

proto: Implement Error for NotPrimaryMaster

When a client receives 'NotPrimaryMaster' from a secondary master, the
situation is similar to the situation when we receive an error: the
other node tells us, don't connect with me, connect with someone else.
Finally the peer even closes the connection.

Due to this similarity in structure (& because it helps us later to
teach NEO/go to correctly handle 'NotPrimaryMaster' with minimal
changes), we implement 'Error' for 'proto.NotPrimaryMaster'. Now
'NotPrimaryMaster' can be treated like an error.
parent 2a75cdb0
......@@ -56,6 +56,11 @@ func (e *Error) Error() string {
}
func (n *NotPrimaryMaster) Error() string {
return "not primary master"
}
// Set sets cluster state value to v.
//
// Use Set instead of direct assignment for ClusterState tracing to work.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment