forked from TrueCloudLab/frostfs-node
[#1085] writecache: add read-only mode
In read-only mode modifying operations are immediately returned with error and all background operations are suspended. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
9f963e001b
commit
ad01aaf8bf
7 changed files with 139 additions and 28 deletions
|
@ -12,6 +12,12 @@ import (
|
|||
|
||||
// Delete removes object from write-cache.
|
||||
func (c *cache) Delete(addr *objectSDK.Address) error {
|
||||
c.modeMtx.RLock()
|
||||
defer c.modeMtx.RUnlock()
|
||||
if c.mode == ModeReadOnly {
|
||||
return ErrReadOnly
|
||||
}
|
||||
|
||||
saddr := addr.String()
|
||||
|
||||
// Check memory cache.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue