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

[OpenStack] Introduce bulk deletion of Swift objects #3784

Merged
merged 3 commits into from Jul 14, 2020

Conversation

Fedosin
Copy link
Contributor

@Fedosin Fedosin commented Jun 22, 2020

Now we delete Swift objects sequentially, Which, in the case of a large number of objects, can take a very long time.
Gophercloud 0.11.0 added the possibility of objects bulk deletion:
https://github.com/gophercloud/gophercloud/blob/master/CHANGELOG.md#0110-may-14-2020

This commit starts using this feature to delete multiple objects with one request. This should significantly improve cluster removal time.

Implements: https://issues.redhat.com/browse/OSASINFRA-1059
Implements: https://issues.redhat.com/browse/OSASINFRA-1710

@Fedosin
Copy link
Contributor Author

Fedosin commented Jun 22, 2020

/test e2e-openstack

@Fedosin
Copy link
Contributor Author

Fedosin commented Jun 22, 2020

/retest

@mandre
Copy link
Member

mandre commented Jun 25, 2020

/approve
/lgtm
/hold until the e2e-openstack job is green

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 25, 2020
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 25, 2020
@Fedosin
Copy link
Contributor Author

Fedosin commented Jun 25, 2020

/test e2e-aws

@Fedosin
Copy link
Contributor Author

Fedosin commented Jun 25, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 25, 2020
@mandre
Copy link
Member

mandre commented Jun 29, 2020

/assign @abhinavdahiya
We need your approval for the re-vendor.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jul 1, 2020
return true, nil
})
if err != nil {
if _, ok := err.(gophercloud.ErrDefault404); !ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

use errors.As or errors.Is https://godoc.org/github.com/pkg/errors#Is https://godoc.org/github.com/pkg/errors#As more info https://golang.org/pkg/errors/

this is better then simple type coersion because it unwraps and checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with you, but we use this pattern in too many places in the code. I'd prefer to change this in a separate commit.

return false, err
}
if len(resp.Errors) > 0 {
return false, errors.Errorf("Errors occured during bulk deleting of container %q objects", container)
Copy link
Contributor

Choose a reason for hiding this comment

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

errors should not start with capital letters as it makes it weird when wrapped

Copy link
Contributor

Choose a reason for hiding this comment

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

This is hiding the actaul errorrs in the returned error. You can try and use https://godoc.org/k8s.io/apimachinery/pkg/util/errors#NewAggregate if the list of resp.Errors implements error iterface

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

@abhinavdahiya
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, mandre

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 1, 2020
@pierreprinetti
Copy link
Member

/hold for openstack CI and for the required changes

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 1, 2020
Gophercloud 0.10.0 contains a breaking change, where all IDFromName
functions were moved to a standalone gophercloud/utils repo:
https://github.com/gophercloud/gophercloud/blob/master/CHANGELOG.md#0100-april-12-2020
This PR also addresses this change.
To incorporate latest changes from gophercloud, we have to bump
the terraform plugin as well.
Now we delete Swift objects sequentially, Which, in the case of a
large number of objects, can take a very long time.
Gophercloud 0.11.0 added the possibility of objects bulk deletion:
https://github.com/gophercloud/gophercloud/blob/master/CHANGELOG.md#0110-may-14-2020

This commit starts using this feature to delete multiple objects
with one request. This should significantly improve cluster removal
time.

Implements: https://issues.redhat.com/browse/OSASINFRA-1059
@Fedosin
Copy link
Contributor Author

Fedosin commented Jul 13, 2020

/retest

1 similar comment
@mandre
Copy link
Member

mandre commented Jul 13, 2020

/retest

@Fedosin
Copy link
Contributor Author

Fedosin commented Jul 14, 2020

/test e2e-openstack

1 similar comment
@Fedosin
Copy link
Contributor Author

Fedosin commented Jul 14, 2020

/test e2e-openstack

@Fedosin
Copy link
Contributor Author

Fedosin commented Jul 14, 2020

/retest

@Fedosin
Copy link
Contributor Author

Fedosin commented Jul 14, 2020

/test e2e-aws

@Fedosin
Copy link
Contributor Author

Fedosin commented Jul 14, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 14, 2020
@iamemilio
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 14, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci-robot
Copy link
Contributor

@Fedosin: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-metal-ipi 013c689 link /test e2e-metal-ipi
ci/prow/e2e-ovirt 013c689 link /test e2e-ovirt

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit ed57ddf into openshift:master Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants