metabase: Check parameter for CountAliveObjectsInBucket #1414

Merged
fyrchik merged 1 commit from acid-ant/frostfs-node:bugfix/count-in-bucket into master 2024-10-04 14:52:05 +00:00
Member

Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
acid-ant added 1 commit 2024-10-04 12:27:26 +00:00
[#xx] metabase: Check parameter for CountAliveObjectsInBucket
Some checks failed
DCO action / DCO (pull_request) Failing after 2m3s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m18s
Tests and linters / Run gofumpt (pull_request) Successful in 2m13s
Vulncheck / Vulncheck (pull_request) Successful in 2m29s
Build / Build Components (pull_request) Successful in 2m59s
Tests and linters / gopls check (pull_request) Successful in 3m12s
Tests and linters / Staticcheck (pull_request) Successful in 3m47s
Tests and linters / Lint (pull_request) Successful in 3m56s
Tests and linters / Tests (pull_request) Successful in 6m48s
Tests and linters / Tests with -race (pull_request) Successful in 6m50s
d0f1c6d37b
Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
acid-ant force-pushed bugfix/count-in-bucket from d0f1c6d37b to b96d5c9b02 2024-10-04 12:28:04 +00:00 Compare
acid-ant requested review from storage-core-committers 2024-10-04 12:28:24 +00:00
acid-ant requested review from storage-core-developers 2024-10-04 12:28:30 +00:00
dstepanov-yadro approved these changes 2024-10-04 12:32:18 +00:00
Dismissed
fyrchik approved these changes 2024-10-04 12:34:51 +00:00
Dismissed
@ -454,3 +454,2 @@
cidRaw := prm.BucketName[1:bucketKeySize]
if cidRaw == nil {
if prm.BucketName == nil {
Owner

if len(prm.BucketName) == 0 would be nicer, it prevents a possible panic which is not caught by nil comparison

`if len(prm.BucketName) == 0` would be nicer, it prevents a possible panic which is not caught by `nil` comparison
Author
Member

Thanks, fixed.

Thanks, fixed.
Owner

BTW, it still can be less than the bucketKeySize
Not for this PR: is there any reason we leak BucketName to the upper level?
It seems enough to operate with some notion of object type and container id, both of which are already existing abstractions.

BTW, it still can be less than the `bucketKeySize` Not for this PR: is there any reason we leak `BucketName` to the upper level? It seems enough to operate with some notion of `object type` and `container id`, both of which are already existing abstractions.
Author
Member

Right, need to check for bucketKeySize. Updated.
As for BucketName - no strong reason, just for quicker implementation and less compute.
I'll update method signature - will use object type and container id.

Right, need to check for `bucketKeySize`. Updated. As for `BucketName` - no strong reason, just for quicker implementation and less compute. I'll update method signature - will use object type and container id.
acid-ant force-pushed bugfix/count-in-bucket from b96d5c9b02 to 026ef954b8 2024-10-04 12:47:50 +00:00 Compare
acid-ant dismissed dstepanov-yadro's review 2024-10-04 12:47:50 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

acid-ant dismissed fyrchik's review 2024-10-04 12:47:50 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

acid-ant force-pushed bugfix/count-in-bucket from 026ef954b8 to 085c9921d2 2024-10-04 13:39:31 +00:00 Compare
acid-ant force-pushed bugfix/count-in-bucket from 085c9921d2 to 2f710d8f94 2024-10-04 14:11:23 +00:00 Compare
fyrchik approved these changes 2024-10-04 14:52:00 +00:00
fyrchik merged commit 2f710d8f94 into master 2024-10-04 14:52:05 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
3 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-node#1414
No description provided.