[#959] writecache: Avoid manipulation with cache in DEGRADED mode

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2024-02-20 17:24:57 +03:00 committed by Evgenii Stratonikov
parent d433b49265
commit 3195142d67
6 changed files with 35 additions and 1 deletions

View file

@ -41,6 +41,9 @@ func (c *cache) Put(ctx context.Context, prm common.PutPrm) (common.PutRes, erro
if c.readOnly() {
return common.PutRes{}, ErrReadOnly
}
if c.noMetabase() {
return common.PutRes{}, ErrDegraded
}
sz := uint64(len(prm.RawData))
if sz > c.maxObjectSize {