Morph cache for ape chains is not updated #1061

Closed
opened 2024-03-28 14:30:45 +00:00 by aarifullin · 1 comment
Member

If node config does not set cacheTTL value, and therefore it is zero by default: morphRuleStorage, then chains are not updated for the target.

To reproduce this in dev-env:

  1. Create container with zero basic-acl
frostfs-cli container create -r s01.frostfs.devenv:8080 --wallet /tmp/xk6-frostfs/scenarios/files/wallet.json --await --policy 'REP 2 CBF 1' --basic-acl 0

# CID: FyQVCJb8E9wd8NeuWP49j7MgLPnQdCSYFNnBQHG2DUuq
  1. Try to add allowing policy:
frostfs-adm morph ape add-rule-chain -c frostfs-adm.yml --target-type container --target-name "FyQVCJb8E9wd8NeuWP49j7MgLPnQdCSYFNnBQHG2DUuq" --rule "allow Object.* *" --chain-id test
  1. Try to put an object to FyQVCJb8E9wd8NeuWP49j7MgLPnQdCSYFNnBQHG2DUuq - you'll get NoRuleFound

So, if CacheTTL is zero, then we can set it with block time by default.

If node config does not set `cacheTTL` value, and therefore it is zero by default: [morphRuleStorage](https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/cmd/frostfs-node/config.go#L1086), then chains are not updated for the target. To reproduce this in dev-env: 1. Create container with zero basic-acl ```bash frostfs-cli container create -r s01.frostfs.devenv:8080 --wallet /tmp/xk6-frostfs/scenarios/files/wallet.json --await --policy 'REP 2 CBF 1' --basic-acl 0 # CID: FyQVCJb8E9wd8NeuWP49j7MgLPnQdCSYFNnBQHG2DUuq ``` 2. Try to add allowing policy: ```bash frostfs-adm morph ape add-rule-chain -c frostfs-adm.yml --target-type container --target-name "FyQVCJb8E9wd8NeuWP49j7MgLPnQdCSYFNnBQHG2DUuq" --rule "allow Object.* *" --chain-id test ``` 3. Try to put an object to `FyQVCJb8E9wd8NeuWP49j7MgLPnQdCSYFNnBQHG2DUuq` - you'll get `NoRuleFound` So, if CacheTTL is zero, then we can set it with block time by default.
aarifullin added the
bug
good first issue
labels 2024-03-28 14:30:58 +00:00
Owner

Missed this on final review #1044 (comment) -- we should take it from cfgMorph field, where the default value is set.

Missed this on final review https://git.frostfs.info/TrueCloudLab/frostfs-node/pulls/1044#issuecomment-35340 -- we should take it from `cfgMorph` field, where the default value is set.
Sign in to join this conversation.
No milestone
No project
No assignees
2 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#1061
No description provided.