Support container zones during resolve and create operations #6

Closed
opened 2025-01-21 13:47:21 +00:00 by alexvanin · 1 comment
Owner

Container ID values are unique across the storage network. Container names are unique across domain zone they are registered in. By default, container names are registered in default "root" zone .container. Right now all create and resolve operation are operating in this default zone.

// resolve
var d container.Domain
d.SetName(containerName)
if cnrID, err := resolver.ResolveContainerDomain(d); err == nil {
...

// create
var domain container.Domain
domain.SetName(containerName)
container.WriteDomain(&cnr, domain)

We should support setting a custom zone. I see two ways how we can do it:

  1. define zone as a part of profile config (similar to container policy)
  2. parse zone from container name

Usually FrostFS application parse container names with . symbol. Now this is restricted symbol in container names, so we can split zone and container name. See how s3 gateway parses configured container ID

if err := id.DecodeString(containerString); err != nil {
i := strings.Index(containerString, ".")
if i < 0 {
return cid.ID{}, fmt.Errorf("invalid container address: %s", containerString)
}
if id, err = a.bucketResolver.Resolve(ctx, containerString[i+1:], containerString[:i]); err != nil {
return cid.ID{}, fmt.Errorf("resolve container address %s: %w", containerString, err)
}
}

Container ID values are unique across the storage network. Container names are unique across domain zone they are registered in. By default, container names are registered in default "root" zone `.container`. Right now all create and resolve operation are operating in this default zone. ```go // resolve var d container.Domain d.SetName(containerName) if cnrID, err := resolver.ResolveContainerDomain(d); err == nil { ... // create var domain container.Domain domain.SetName(containerName) container.WriteDomain(&cnr, domain) ``` We should support setting a custom zone. I see two ways how we can do it: 1) define zone as a part of profile config (similar to container policy) 2) parse zone from container name Usually FrostFS application parse container names with `.` symbol. Now this is restricted symbol in container names, so we can split zone and container name. See how s3 gateway parses configured container ID https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/src/commit/619385836d0e3f023eb93c214dbdd1b3df3254e3/cmd/s3-gw/app.go#L1253-L1262
KurlesHS was assigned by alexvanin 2025-01-21 13:47:21 +00:00
Author
Owner

Meant for RClone: TrueCloudLab/rclone#5
Closed.

Meant for RClone: https://git.frostfs.info/TrueCloudLab/rclone/issues/5 Closed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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/restic#6
No description provided.