writecache: Avoid manipulation with cache in DEGRADED mode #998

Merged
fyrchik merged 1 commit from acid-ant/frostfs-node:bugfix/959-init-fstree-degraded into master 2024-03-11 18:35:43 +00:00
Member

Close #959

Avoid manipulation with cache in DEGRADED mode.

Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com

Close #959 Avoid manipulation with cache in `DEGRADED` mode. Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
dstepanov-yadro approved these changes 2024-02-20 15:02:51 +00:00
fyrchik reviewed 2024-02-20 15:09:15 +00:00
@ -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 {
Owner

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 )

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 )
Author
Member

Added check for mode to writecache. Tested in dev-env with k6.

Added check for `mode` to `writecache`. Tested in dev-env with k6.
aarifullin approved these changes 2024-02-21 08:42:05 +00:00
acid-ant force-pushed bugfix/959-init-fstree-degraded from 632930c7b1 to e69a3128dc 2024-02-22 15:30:29 +00:00 Compare
acid-ant force-pushed bugfix/959-init-fstree-degraded from e69a3128dc to d86842e80a 2024-02-26 06:33:34 +00:00 Compare
aarifullin approved these changes 2024-02-26 09:03:30 +00:00
fyrchik reviewed 2024-02-28 19:03:49 +00:00
@ -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 {
Owner

Again, why do we need to create and open fstree?
It should be nil in degraded.

Again, why do we need to create and open fstree? It should be nil in degraded.
Author
Member

Fixed. Tested in dev-env.

Fixed. Tested in dev-env.
acid-ant force-pushed bugfix/959-init-fstree-degraded from d86842e80a to c97c0a7105 2024-03-01 10:50:53 +00:00 Compare
acid-ant force-pushed bugfix/959-init-fstree-degraded from c97c0a7105 to 9021b5af72 2024-03-04 19:27:12 +00:00 Compare
acid-ant changed title from writecache: Initialize fstree in DEGRADED mode to writecache: Avoid manipulation with cache in DEGRADED mode 2024-03-04 19:27:56 +00:00
acid-ant changed title from writecache: Avoid manipulation with cache in DEGRADED mode to WIP: writecache: Avoid manipulation with cache in DEGRADED mode 2024-03-04 19:29:05 +00:00
acid-ant force-pushed bugfix/959-init-fstree-degraded from 9021b5af72 to 56b358cb34 2024-03-05 08:26:15 +00:00 Compare
acid-ant changed title from WIP: writecache: Avoid manipulation with cache in DEGRADED mode to writecache: Avoid manipulation with cache in DEGRADED mode 2024-03-05 08:29:15 +00:00
acid-ant requested review from dstepanov-yadro 2024-03-05 08:29:19 +00:00
acid-ant requested review from aarifullin 2024-03-05 08:29:21 +00:00
acid-ant requested review from fyrchik 2024-03-05 08:29:38 +00:00
acid-ant requested review from storage-core-developers 2024-03-05 08:29:39 +00:00
acid-ant force-pushed bugfix/959-init-fstree-degraded from 56b358cb34 to 3960570b77 2024-03-05 08:30:17 +00:00 Compare
fyrchik reviewed 2024-03-05 08:54:57 +00:00
@ -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)
Owner

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.

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.
Author
Member

Agree, looks ugly, reverted.

Agree, looks ugly, reverted.
acid-ant force-pushed bugfix/959-init-fstree-degraded from 3960570b77 to 9033e6c782 2024-03-05 11:26:01 +00:00 Compare
acid-ant force-pushed bugfix/959-init-fstree-degraded from 9033e6c782 to eecaed5b4b 2024-03-05 11:29:13 +00:00 Compare
acid-ant force-pushed bugfix/959-init-fstree-degraded from eecaed5b4b to f6f327b5dc 2024-03-05 12:00:23 +00:00 Compare
dstepanov-yadro approved these changes 2024-03-06 08:27:50 +00:00
fyrchik approved these changes 2024-03-11 18:35:35 +00:00
fyrchik merged commit 3195142d67 into master 2024-03-11 18:35:43 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#998
No description provided.