[#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

@ -76,3 +76,9 @@ func (c *cache) setMode(ctx context.Context, m mode.Mode, ignoreErrors bool) err
func (c *cache) readOnly() bool {
return c.mode.ReadOnly()
}
// noMetabase returns true if c is operating without the metabase.
// `c.modeMtx` must be taken.
func (c *cache) noMetabase() bool {
return c.mode.NoMetabase()
}