mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
learner support snapshot RPC (#12890)
* learner support snapshot RPC * CHANGELOG: update for 12890
This commit is contained in:
parent
a3fc535a5a
commit
b32bc914ff
@ -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 `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`
|
||||
|
||||
|
@ -35,6 +35,7 @@ import (
|
||||
const (
|
||||
maxNoLeaderCnt = 3
|
||||
warnUnaryRequestLatency = 300 * time.Millisecond
|
||||
snapshotMethod = "/etcdserverpb.Maintenance/Snapshot"
|
||||
)
|
||||
|
||||
type streamsMap struct {
|
||||
@ -214,7 +215,7 @@ func newStreamInterceptor(s *etcdserver.EtcdServer) grpc.StreamServerInterceptor
|
||||
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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user