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

Use s3manager.BatchDelete #113

Closed
igungor opened this issue Mar 24, 2020 · 3 comments
Closed

Use s3manager.BatchDelete #113

igungor opened this issue Mar 24, 2020 · 3 comments

Comments

@igungor
Copy link
Member

igungor commented Mar 24, 2020

No description provided.

@igungor igungor added this to the v1.0.0 milestone Mar 24, 2020
@sonmezonur
Copy link
Member

Seems like we cannot use s3manager.BatchDelete for this release.

There are two different approaches to use s3manager.BatchDelete API.

  1. Create paginator and use this paginator on delete operations.
  input := &s3.ListObjectsInput{
    Bucket:  aws.String("bucket"),
    Prefix: aws.String("prefix")
  }
  iter := s3manager.NewDeleteListIterator(svc, input)

This is fast but will not work since it removes the list result directly. We also need to remove keys that match with wildcard strings (not whole listing result). As an alternative, maybe we can write custom paginator (since it is an interface) and use this paginator on batch delete operations. But this does not reduce the complexity (I prefer our current architecture).

  1. Give the list of objects to DeleteObjectsIterator and use this iterator on delete operations.
batcher.Delete(ctx, &s3manager.DeleteObjectsIterator{Objects: objects})

This is super easy and clean but slow. It won't perform well since it is required to list and collect all objects first and pass collected objects to DeleteObjectsIterator. Currently, we don't block during S3 pagination (listing). We are directly sending these keys into the URL channel and it works asynchronously.

That is why I am proposing to close this issue and remove from this milestone :)

@igungor What do you think? You can close the issue if you agree.

@igungor
Copy link
Member Author

igungor commented Mar 25, 2020

Thank you Onur.

Not a blocker. Let's keep the issue open for a while.

@igungor igungor removed this from the v1.0.0 milestone Mar 25, 2020
@igungor
Copy link
Member Author

igungor commented Apr 8, 2020

s3manager.BatchDelete does not provide any improvement over our solution.

@igungor igungor closed this as completed Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants