Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmd/gateway/zcn/gateway-zcn.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,11 @@ func (zob *zcnObjects) DeleteObjects(ctx context.Context, bucket string, objects
ops := make([]sdk.OperationRequest, 0, len(objects))
for _, object := range objects {
remotePath := filepath.Join(basePath, object.ObjectName)
_, err := getSingleRegularRef(zob.alloc, filepath.Clean(remotePath))
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we fetching the ref? If its not there it will be ignored by delete operation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Hitenjain14 minio raised an error here when the requested file didnot exist. The deleteworker expected to work for that case you mentioned might have ignored as minio raised issue stating invalid remote ref.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check where is the error coming from, is it DoMultiOperation for delete if yes then we need to fix it there rather than adding a check here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above changes will impact the performance of delete, getting a singular file ref can take upto 50ms and we do this for every object.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

continue
}

ops = append(ops, sdk.OperationRequest{
OperationType: constants.FileOperationDelete,
RemotePath: remotePath,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain go1.21.6
require (
cloud.google.com/go/storage v1.27.0
github.com/0chain/errors v1.0.3
github.com/0chain/gosdk v1.17.1
github.com/0chain/gosdk v1.16.7-0.20240910131714-b7b2b0e96e01
github.com/Azure/azure-pipeline-go v0.2.2
github.com/Azure/azure-storage-blob-go v0.10.0
github.com/Shopify/sarama v1.28.0
Expand Down
4 changes: 2 additions & 2 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ github.com/0chain/gosdk v1.15.5 h1:e+khk21/YrjlxuvQPFCI2JsQbgSCyr/Y/Km82HCH+MM=
github.com/0chain/gosdk v1.15.5/go.mod h1:y7Ucdmv40VltqulZnncMNjNQ4piX5Dta5ujNmPmXnxg=
github.com/0chain/gosdk v1.16.0 h1:3CKuU9i9d+X2/htJOIyxNwviKG5H/lp+q8ogzCgnoQI=
github.com/0chain/gosdk v1.16.0/go.mod h1:y7Ucdmv40VltqulZnncMNjNQ4piX5Dta5ujNmPmXnxg=
github.com/0chain/gosdk v1.17.1 h1:nyUN2BY/Hcd31ljwK3ITCogjBeEVov/3YTEkDcENecM=
github.com/0chain/gosdk v1.17.1/go.mod h1:y7Ucdmv40VltqulZnncMNjNQ4piX5Dta5ujNmPmXnxg=
github.com/0chain/gosdk v1.16.7-0.20240910131714-b7b2b0e96e01 h1:V2taNFmDo7uhqPhasCIDsPMFWeKELssbtuR6ajOQ65g=
github.com/0chain/gosdk v1.16.7-0.20240910131714-b7b2b0e96e01/go.mod h1:y7Ucdmv40VltqulZnncMNjNQ4piX5Dta5ujNmPmXnxg=
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9 h1:HD8gA2tkByhMAwYaFAX9w2l7vxvBQ5NMoxDrkhqhtn4=
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
github.com/Azure/azure-amqp-common-go/v2 v2.1.0 h1:+QbFgmWCnPzdaRMfsI0Yb6GrRdBj5jVL8N3EXuEUcBQ=
Expand Down