Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure StorageID in metabase is used correctly #2888

Open
carpawell opened this issue Jul 8, 2024 · 5 comments
Open

Ensure StorageID in metabase is used correctly #2888

carpawell opened this issue Jul 8, 2024 · 5 comments
Labels
enhancement Improving existing functionality I4 No visible changes S3 Minimally significant U3 Regular

Comments

@carpawell
Copy link
Member

Is your feature request related to a problem? Please describe.

I'm always frustrated when we use "dynamic" code. In the storage engine currently, we can accept any (non-empty) storage ID and think that it corresponds to the peapod (or blobovniczas tree earlier). In fact, we now store 1/2 IDs that are left by blobovnizcas (it was a migration mistake or some garbage) and nobody knows it.

Describe the solution you'd like

If a storage ID is unknown, do WARN or ERROR logs. All the storages can be checked additionally. Such a situation is completely erroneous, a metabase must be in sync with a blobstor, no unexpected IDs should be found.

if len(prm.StorageID) == 0 {
return b.storage[len(b.storage)-1].Storage.Get(prm)
}
return b.storage[0].Storage.Get(prm)

Describe alternatives you've considered

(:

Additional context

I have found blobovnicza tree's IDs in mainnet when looked at #2844.

@carpawell carpawell added I2 Regular impact feature Completely new functionality labels Jul 8, 2024
@carpawell
Copy link
Member Author

BTW, storage indexes hardcoding is also awful to me ([0] is for FSTree, and [1] is for peapod and just believe me).

@cthulhu-rider
Copy link
Contributor

@carpawell SDK is not the best place for this issue 🤔

@carpawell carpawell transferred this issue from nspcc-dev/neofs-sdk-go Jul 9, 2024
@carpawell
Copy link
Member Author

Woops

@roman-khimov
Copy link
Member

Do we need storage ID at all?

@roman-khimov roman-khimov added enhancement Improving existing functionality U3 Regular S3 Minimally significant I4 No visible changes and removed I2 Regular impact feature Completely new functionality labels Jul 16, 2024
@carpawell
Copy link
Member Author

Do we need storage ID at all?

This is how we understand what storage to check (a "small" one (peapod currently) or a "big" one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving existing functionality I4 No visible changes S3 Minimally significant U3 Regular
Projects
None yet
Development

No branches or pull requests

3 participants