[#1261] shard: Fix delete objects from FSTree
All checks were successful
DCO action / DCO (pull_request) Successful in 6m56s
Vulncheck / Vulncheck (pull_request) Successful in 7m38s
Build / Build Components (1.22) (pull_request) Successful in 9m57s
Build / Build Components (1.21) (pull_request) Successful in 10m38s
Tests and linters / gopls check (pull_request) Successful in 10m43s
Tests and linters / Staticcheck (pull_request) Successful in 11m1s
Tests and linters / Lint (pull_request) Successful in 13m35s
Pre-commit hooks / Pre-commit (pull_request) Successful in 14m53s
Tests and linters / Tests (1.21) (pull_request) Successful in 15m55s
Tests and linters / Tests with -race (pull_request) Successful in 15m49s
Tests and linters / Tests (1.22) (pull_request) Successful in 16m10s

Replace nil storageID with empty like by shard.Get.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-07-22 13:54:06 +03:00
parent 3119f2fbc3
commit 18182e578e

View file

@ -117,6 +117,12 @@ func (s *Shard) deleteFromBlobstor(ctx context.Context, addr oid.Address) error
return err return err
} }
storageID := res.StorageID() storageID := res.StorageID()
if storageID == nil {
// if storageID is nil it means:
// 1. there is no such object
// 2. object stored by writecache: should not happen, as `validateWritecacheDoesntContainObject` called before `deleteFromBlobstor`
return nil
}
var delPrm common.DeletePrm var delPrm common.DeletePrm
delPrm.Address = addr delPrm.Address = addr