etcdserver: learner return Unavailable for unsupported RPC

Make learner return code.Unavailable when the request is not supported
by learner. Client balancer will retry a different endpoint.
This commit is contained in:
Jingyi Hu
2019-04-22 19:08:03 -07:00
parent 76a63f9f7d
commit d0c1b3fa38
4 changed files with 52 additions and 2 deletions

View File

@ -48,7 +48,6 @@ func newUnaryInterceptor(s *etcdserver.EtcdServer) grpc.UnaryServerInterceptor {
return nil, rpctypes.ErrGRPCNotCapable
}
// TODO: add test in clientv3/integration to verify behavior
if s.IsLearner() && !isRPCSupportedForLearner(req) {
return nil, rpctypes.ErrGPRCNotSupportedForLearner
}