learner support snapshot RPC (#12890)
* learner support snapshot RPC * CHANGELOG: update for 12890
This commit is contained in:
@ -239,6 +239,7 @@ Note that any `etcd_debugging_*` metrics are experimental and subject to change.
|
|||||||
|
|
||||||
- Add [`/v3/auth/status`](https://github.com/etcd-io/etcd/pull/11536) endpoint to check if authentication is enabled
|
- Add [`/v3/auth/status`](https://github.com/etcd-io/etcd/pull/11536) endpoint to check if authentication is enabled
|
||||||
- [Add `Linearizable` field to `etcdserverpb.MemberListRequest`](https://github.com/etcd-io/etcd/pull/11639).
|
- [Add `Linearizable` field to `etcdserverpb.MemberListRequest`](https://github.com/etcd-io/etcd/pull/11639).
|
||||||
|
- [Learner support Snapshot RPC](https://github.com/etcd-io/etcd/pull/12890/).
|
||||||
|
|
||||||
### Package `netutil`
|
### Package `netutil`
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
maxNoLeaderCnt = 3
|
maxNoLeaderCnt = 3
|
||||||
warnUnaryRequestLatency = 300 * time.Millisecond
|
warnUnaryRequestLatency = 300 * time.Millisecond
|
||||||
|
snapshotMethod = "/etcdserverpb.Maintenance/Snapshot"
|
||||||
)
|
)
|
||||||
|
|
||||||
type streamsMap struct {
|
type streamsMap struct {
|
||||||
@ -214,7 +215,7 @@ func newStreamInterceptor(s *etcdserver.EtcdServer) grpc.StreamServerInterceptor
|
|||||||
return rpctypes.ErrGRPCNotCapable
|
return rpctypes.ErrGRPCNotCapable
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.IsMemberExist(s.ID()) && s.IsLearner() { // learner does not support stream RPC
|
if s.IsMemberExist(s.ID()) && s.IsLearner() && info.FullMethod != snapshotMethod { // learner does not support stream RPC except Snapshot
|
||||||
return rpctypes.ErrGPRCNotSupportedForLearner
|
return rpctypes.ErrGPRCNotSupportedForLearner
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user