-
Notifications
You must be signed in to change notification settings - Fork 23
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
[Disk Manager] errors from blockstore should be internal by default #2980
base: main
Are you sure you want to change the base?
[Disk Manager] errors from blockstore should be internal by default #2980
Conversation
clientErr := nbs_client.GetClientError(e) | ||
|
||
if clientErr.Code == nbs_client.E_RESOURCE_EXHAUSTED && | ||
strings.Contains(clientErr.Message, "max disk count in group exceeded") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
if clientErr.Code == nbs_client.E_PRECONDITION_FAILED && | ||
strings.Contains(clientErr.Message, "failed to add some disks") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вот эта ошибка в коде disk registry:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Конечно, не очень хорошо при определении публичности закладываться на тескт ошибки.
Но в то же время по-другому сходу и не сделаешь. Если не смотреть на текст, то остаётся смотреть только на код ошибки. https://github.com/ydb-platform/nbs/blob/main/cloud/blockstore/public/sdk/go/client/error.go#L10. А это уже грубовато.
Идеальная картина в моём представлении могла бы выглядеть так. Публичность ошибки определяется в том месте, где она создаётся (в данном случае в коде disk registry). Далее она пробразывается до disk manager в виде флажка. Но для этого придётся потрогать и код nbs, и код blockstore клиента. И в целом не уверен, стоит ли так делать.
Before this fix, all error from blockstore with codes E_PRECONDITION_FAILED and E_RESOURCE_EXHAUSTED were treated as public. This is too wide range of errors to treat them all as public.