policy: Introduce ListTargets method for Policy contract #79
No reviewers
TrueCloudLab/storage-core-developers
TrueCloudLab/storage-services-developers
Labels
No labels
P0
P1
P2
P3
good first issue
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
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-contract#79
Loading…
Reference in a new issue
No description provided.
Delete branch "aarifullin/frostfs-contract:feat/78-list_targets"
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 #78
@ -216,2 +220,4 @@
return storage.Find(ctx, keyPrefix, storage.ValuesOnly)
}
// ListTargets lists targets for which rules are defined by kind.
@fyrchik Since we have decided a container/namespace will get default policy with
deny
, we should consider a migration for already created containers.len(targets) == len(containers) + len(namespaces)
. That means listing containers may be a problem if the container number is huge. But we can't use iterators - we need iterators with filters, because we should check if at least one chain is defined for a nameWhy do we need any filters? If a key exist, there must be some chain.
This cannot be always true. If a chain existed for a while and then removed, then the mapping is left anyway (if want to remove the mapping we need to impose remove methods to check if no chains are defined for a target. Also, this is helpful because a new chain can be added to a target again).
So, briefly, even the mapping is found it does not mean a chain is defined for a target
Is it possible to add
batchSize
andlast
as arguments? Then you can use something like this:for k, _ := c.Seek(prm.NextPageToken); k != nil; k, _ = c.Next() {
I suppose such result "paging" is possible only if some isolation can be supported to not get range invalidated. @fyrchik WDYT, is it possible in contracts?
Sessions are the only way to do paging correctly.
TBH I do not see a problem here, besides counter issues.
To make possible number reuse we can even store rule count=0 instead of removal
I hope I properly got your idea. I introduced active rules count for a target. That helps to just check counter instead listing chains
policy: Introduce ListTargets method for Policy contractto WIP: policy: Introduce ListTargets method for Policy contractdfddd11f71
to31ec39fbcc
31ec39fbcc
to1d4deffb7d
WIP: policy: Introduce ListTargets method for Policy contractto policy: Introduce ListTargets method for Policy contractCannot be updated due to some gitea bug :( will be reopened
Pull request closed