writecache: Avoid manipulation with cache in DEGRADED
mode #998
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#998
Loading…
Reference in a new issue
No description provided.
Delete branch "acid-ant/frostfs-node:bugfix/959-init-fstree-degraded"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Close #959
Avoid manipulation with cache in
DEGRADED
mode.Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
@ -58,3 +59,3 @@
fstree.WithFileCounter(&c.objCounters),
)
if err := c.fsTree.Open(readOnly); err != nil {
if err := c.fsTree.Open(mode.ReadOnly()); err != nil {
It should not be like this, degraded means we do not touch anything at all, like with the DB
The problem is that requests still get to fstree -- we should check mode for all operations like we do in other places (see e.g. pilorama https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/local_object_storage/pilorama/boltdb.go#L197 )
Added check for
mode
towritecache
. Tested in dev-env with k6.632930c7b1
toe69a3128dc
e69a3128dc
tod86842e80a
@ -58,3 +59,3 @@
fstree.WithFileCounter(&c.objCounters),
)
if err := c.fsTree.Open(readOnly); err != nil {
if err := c.fsTree.Open(mode.ReadOnly()); err != nil {
Again, why do we need to create and open fstree?
It should be nil in degraded.
Fixed. Tested in dev-env.
d86842e80a
toc97c0a7105
c97c0a7105
to9021b5af72
writecache: Initialize fstree into writecache: Avoid manipulation with cache inDEGRADED
modeDEGRADED
modewritecache: Avoid manipulation with cache into WIP: writecache: Avoid manipulation with cache inDEGRADED
modeDEGRADED
mode9021b5af72
to56b358cb34
WIP: writecache: Avoid manipulation with cache into writecache: Avoid manipulation with cache inDEGRADED
modeDEGRADED
mode56b358cb34
to3960570b77
@ -27,3 +28,3 @@
func (c *cache) openStore(readOnly bool) error {
func (c *cache) openStore(mode mode.Mode) error {
err := util.MkdirAllX(c.path, os.ModePerm)
Now we do this in degraded mode.
Can we move
mode.NoMetabase
check outside the function as it was? The whole function doesn't need to be executed.Agree, looks ugly, reverted.
3960570b77
to9033e6c782
9033e6c782
toeecaed5b4b
eecaed5b4b
tof6f327b5dc