frostfsid: allow empty namespaces #58

Merged
dkirillov merged 2 commits from dkirillov/frostfs-contract:feature/48-allow_empty_default_namespace into master 2023-12-11 09:36:49 +00:00
Collaborator
There is no content yet.
dkirillov self-assigned this 2023-12-07 12:03:56 +00:00
dkirillov added 2 commits 2023-12-07 12:03:58 +00:00
12a34fa777 [#48] frostfsid: Support empty namespaces
Require ns to create subject.
Since we don't allow move subject from one ns to another -
drop add/remove subject to/from namespace

Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
DCO action / DCO (pull_request) Successful in 1m4s Details
Tests / Tests (1.19) (pull_request) Successful in 1m39s Details
Tests / Tests (1.20) (pull_request) Successful in 1m40s Details
46a0c79add
[#48] frostfsid: add GetSubjectByName method
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
dkirillov requested review from storage-core-committers 2023-12-07 12:04:25 +00:00
dkirillov requested review from storage-core-developers 2023-12-07 12:04:27 +00:00
dkirillov requested review from storage-services-committers 2023-12-07 12:04:29 +00:00
dkirillov requested review from storage-services-developers 2023-12-07 12:04:30 +00:00
dstepanov-yadro approved these changes 2023-12-07 13:02:44 +00:00
fyrchik reviewed 2023-12-07 15:08:35 +00:00
@ -368,0 +357,4 @@
it := storage.Find(ctx, groupPrefixFromHash(nsHash), storage.KeysOnly|storage.RemovePrefix)
for iterator.Next(it) {
groupHash := iterator.Value(it).([]byte)
data := storage.Get(ctx, groupSubjectKeyFromHashes(nsHash, groupHash, addr)).([]byte)

We get data here and override it in the if is this intentional?

We get data here and override it in the `if` is this intentional?
Poster
Collaborator

It doesn't matter. We use only data that we got in if

It doesn't matter. We use only `data` that we got in `if`
@ -743,4 +665,2 @@
storage.Put(ctx, nSubjKey, []byte{1})
gKey := groupKey(subject.Namespace, groupID)
data = storage.Get(ctx, gKey).([]byte)

Can we use common.GetSerialized?

Can we use `common.GetSerialized`?
Poster
Collaborator

Do you mean create new function in common package?

func GetSerialized(key []byte) any {
	ctx := storage.GetReadOnlyContext()
	data := storage.Get(ctx, key).([]byte)
	if data == nil {
		panic("not found")
	}

	return std.Deserialize(data)
}
Do you mean create new function in `common` package? ```golang func GetSerialized(key []byte) any { ctx := storage.GetReadOnlyContext() data := storage.Get(ctx, key).([]byte) if data == nil { panic("not found") } return std.Deserialize(data) } ```

My bad, we have SetSerialized, thought GetSerialized is there too.

My bad, we have `SetSerialized`, thought `GetSerialized` is there too.
fyrchik changed title from feature/48-allow_empty_default_namespace to frostfsid: allow empty namespaces 2023-12-07 15:31:03 +00:00
fyrchik approved these changes 2023-12-07 15:31:39 +00:00
alexvanin approved these changes 2023-12-11 09:23:09 +00:00
dkirillov merged commit 897f538a3c into master 2023-12-11 09:36:49 +00:00
dkirillov deleted branch feature/48-allow_empty_default_namespace 2023-12-11 09:36:49 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
TrueCloudLab/storage-services-developers
No Milestone
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-contract#58
There is no content yet.