v3rpc/rpctypes: use codes.FailedPrecondition for ErrGRPCNotLeader
Changes ErrGRPCNotLeader error code to FailedPrecondition,
to disable retry with unavailable.
@@ -59,7 +59,7 @@ var (
ErrGRPCInvalidAuthMgmt = status.New(codes.InvalidArgument, "etcdserver: invalid auth management").Err()
ErrGRPCNoLeader = status.New(codes.Unavailable, "etcdserver: no leader").Err()
- ErrGRPCNotLeader = status.New(codes.Unavailable, "etcdserver: not leader").Err()
+ ErrGRPCNotLeader = status.New(codes.FailedPrecondition, "etcdserver: not leader").Err()
ErrGRPCNotCapable = status.New(codes.Unavailable, "etcdserver: not capable").Err()
ErrGRPCStopped = status.New(codes.Unavailable, "etcdserver: server stopped").Err()
ErrGRPCTimeout = status.New(codes.Unavailable, "etcdserver: request timed out").Err()
