mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #14254 from ramses/backport-13435
[3.4] Backport: non mutating requests pass through quotaKVServer when NOSPACE
This commit is contained in:
@@ -135,8 +135,14 @@ func NewBackendQuota(s *EtcdServer, name string) Quota {
|
||||
}
|
||||
|
||||
func (b *backendQuota) Available(v interface{}) bool {
|
||||
cost := b.Cost(v)
|
||||
// if there are no mutating requests, it's safe to pass through
|
||||
if cost == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
// TODO: maybe optimize backend.Size()
|
||||
return b.s.Backend().Size()+int64(b.Cost(v)) < b.maxBackendBytes
|
||||
return b.s.Backend().Size()+int64(cost) < b.maxBackendBytes
|
||||
}
|
||||
|
||||
func (b *backendQuota) Cost(v interface{}) int {
|
||||
|
||||
Reference in New Issue
Block a user