Do not fail RemoveChainLocalOverride on engine.ErrResourceNotFound error #1156

Closed
opened 2024-06-03 12:49:42 +00:00 by alexvanin · 0 comments

Expected Behavior

When policy engine returns engine.ErrResourceNotFound error, it does not affect RemoveChainLocalOverride execution.

Current Behavior

Server returns code = Internal desc = resource not found

Possible Solution

Update getCodeByLocalStorageErr function and check ErrResoueceNotFound error as well.

Steps to Reproduce (for bugs)

  1. Run environment with inmemory override storage
  2. Try to remove policy with unknown resource

For more details ping @dkirillov

Context

This works fine with storages besides inmemory storage, so should not be quite an issue.

Regression

No

Your Environment

frostfs-node v0.40.0

## Expected Behavior When policy engine returns [engine.ErrResourceNotFound](https://git.frostfs.info/TrueCloudLab/policy-engine/src/commit/303a81cdc6dbbbcd3aa7c54c656ffc0f5e7960e0/pkg/engine/inmemory/local_storage.go#L111) error, it does not affect [RemoveChainLocalOverride](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/commit/f2d2908745a5fc55593e853faabca989b9896495/pkg/services/control/server/policy_engine.go#L178-L180) execution. ## Current Behavior Server returns `code = Internal desc = resource not found` ## Possible Solution Update [getCodeByLocalStorageErr](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/commit/f2d2908745a5fc55593e853faabca989b9896495/pkg/services/control/server/policy_engine.go#L248) function and check ErrResoueceNotFound error as well. ## Steps to Reproduce (for bugs) 1. Run environment with inmemory override storage 2. Try to remove policy with unknown resource For more details ping @dkirillov ## Context This works fine with storages besides inmemory storage, so should not be quite an issue. ## Regression No ## Your Environment frostfs-node v0.40.0
alexvanin added the
bug
triage
labels 2024-06-03 12:49:42 +00:00
fyrchik added this to the v0.41.0 milestone 2024-06-04 11:34:21 +00:00
acid-ant was assigned by fyrchik 2024-06-04 11:34:28 +00:00
fyrchik added
frostfs-node
and removed
triage
labels 2024-06-04 11:34:35 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 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#1156
There is no content yet.