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

ceph: add support for update() from lib-bucket-provisioner #8514

Merged
merged 1 commit into from Aug 24, 2021

Conversation

thotz
Copy link
Contributor

@thotz thotz commented Aug 10, 2021

Description of your changes:
Recently lib-bucket-provisioner add support for update() API.
Include that on the obc implementation since it can be used to
update quota for OBC.

Which issue is resolved by this Pull Request:
Resolves #7146

Signed-off-by: Jiffin Tony Thottan thottanjiffin@gmail.com
Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Skip Tests for Docs: Add the flag for skipping the build if this is only a documentation change. See here for the flag.
  • Skip Unrelated Tests: Add a flag to run tests for a specific storage provider. See test options.
  • Reviewed the developer guide on Submitting a Pull Request
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.
  • Pending release notes updated with breaking and/or notable changes, if necessary.
  • Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
  • Code generation (make codegen) has been run to update object specifications, if necessary.

@mergify mergify bot added the ceph main ceph tag label Aug 10, 2021
@thotz thotz force-pushed the obcupdateapi branch 2 times, most recently from cb4a222 to fbc71ff Compare August 10, 2021 17:15
Copy link
Member

@travisn travisn left a comment

Choose a reason for hiding this comment

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

Please rebase on the latest master to see if the other CI fixes will help, or if there is still a CI issue to investigate. The object tests had been intermittently failing until yesterday, they should be more reliable in master now.

@travisn
Copy link
Member

travisn commented Aug 12, 2021

It seems the upgrade and smoke suites are failing consistently during test cleanup. The last thing in the test is:

2021-08-12 08:04:22.099486 I | testutil: Running kubectl [delete -f -]
objectbucketclaim.objectbucket.io "smoke-delete-bucket" deleted
panic: test timed out after 30m0s

The logs weren't collected unfortunately. It may be easiest to force push again and then connect to the tmate session to troubleshoot. The operator logs likely show some issue with the deletion. If it's your first time with the tmate session please do ping me or @subhamkrai.

@thotz
Copy link
Contributor Author

thotz commented Aug 12, 2021

It seems the upgrade and smoke suites are failing consistently during test cleanup. The last thing in the test is:

2021-08-12 08:04:22.099486 I | testutil: Running kubectl [delete -f -]
objectbucketclaim.objectbucket.io "smoke-delete-bucket" deleted
panic: test timed out after 30m0s

The logs weren't collected unfortunately. It may be easiest to force push again and then connect to the tmate session to troubleshoot. The operator logs likely show some issue with the deletion. If it's your first time with the tmate session please do ping me or @subhamkrai.

@travisn : apparently with the latest libbucket provisioner(which have update API) delete is getting stuck every time(even without operation performing any update). I cannot see the delete request is reaching the Rook/bucketprovisoner code path. When I restart the rook-operator deletion is getting succeed . Not sure whether I am missing anything key for update to work.
kubectl apply gives below warning :

 kubectl apply -f cluster/examples/kubernetes/ceph/object-bucket-claim-delete-sam.yaml 
Warning: resource objectbucketclaims/ceph-delete-bucket is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically.

Any clues ??

@travisn
Copy link
Member

travisn commented Aug 12, 2021

You can ignore the warning from kubectl apply, the command still succeeded.
Not sure why the latest lib-bucket-provisioner request would not be reaching the operator until the restart. @BlaineEXE Any ideas?

@BlaineEXE
Copy link
Member

You can ignore the warning from kubectl apply, the command still succeeded.
Not sure why the latest lib-bucket-provisioner request would not be reaching the operator until the restart. @BlaineEXE Any ideas?

From the code, the delete operation is ignored because of the finalizer. I think this means the delete operations are handled via upates. With the new updateSupported() method coming before ctrl.enqueueOBC(), I suspect the OBC is not getting enqueued when the deletion timestamp changes.

A question I have is what other things might be getting skipped because of this? I think the updateSupported() method only applies when there are spec changes. I think if other things besides spec change, the update should be supported still.

Specifically, I think this (from the recent commit in lib-bucket-provisioner) is not correct:

if reflect.DeepEqual(new.Spec, old.Spec) {
	return false
}

If the new spec is the same as the old spec, then something else has changed, like metadata, and the update should still be supported. We really only want to stop the update from happening if the spec is modified AND unsupported parts of the spec are modified.

When you were developing the lib-bucket-provisioner changes, were you testing them in Rook? You really should be doing that if not so we don't get broken commits to lib-bucket-provisioner.

thotz added a commit to thotz/lib-bucket-provisioner that referenced this pull request Aug 13, 2021
The delete operation is handled via update calls, with addition of new
Update() API, the objects need to deleted are not added to the queue due
to check in updateSupported(). So if the deletion timestamp is set, then
this check is ignored in NewController().
FInd more details [here](rook/rook#8514 (comment))

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
@thotz
Copy link
Contributor Author

thotz commented Aug 13, 2021

You can ignore the warning from kubectl apply, the command still succeeded.
Not sure why the latest lib-bucket-provisioner request would not be reaching the operator until the restart. @BlaineEXE Any ideas?

From the code, the delete operation is ignored because of the finalizer. I think this means the delete operations are handled via upates. With the new updateSupported() method coming before ctrl.enqueueOBC(), I suspect the OBC is not getting enqueued when the deletion timestamp changes.

A question I have is what other things might be getting skipped because of this? I think the updateSupported() method only applies when there are spec changes. I think if other things besides spec change, the update should be supported still.

Specifically, I think this (from the recent commit in lib-bucket-provisioner) is not correct:

if reflect.DeepEqual(new.Spec, old.Spec) {
	return false
}

If the new spec is the same as the old spec, then something else has changed, like metadata, and the update should still be supported. We really only want to stop the update from happening if the spec is modified AND unsupported parts of the spec are modified.

When you were developing the lib-bucket-provisioner changes, were you testing them in Rook? You really should be doing that if not so we don't get broken commits to lib-bucket-provisioner.

@BlaineEXE : Thanks for debugging this issue, I added check to avoid update call if deletion stamp is set in NewController() via kube-object-storage/lib-bucket-provisioner#216, it works fine. Let me know your thoughts on the same

@BlaineEXE BlaineEXE added the do-not-merge DO NOT MERGE :) label Aug 16, 2021
@BlaineEXE
Copy link
Member

Please update this PR to reference your thotz:fixobcdeletestuck branch so that the Rook CI will validate it also.

@BlaineEXE BlaineEXE added object-bucket-claims Object Bucket Claims (OBC) object Object protocol - S3 feature labels Aug 16, 2021
@thotz
Copy link
Contributor Author

thotz commented Aug 17, 2021

Please update this PR to reference your thotz:fixobcdeletestuck branch so that the Rook CI will validate it also.

Sure

thotz added a commit to thotz/lib-bucket-provisioner that referenced this pull request Aug 17, 2021
The delete operation is handled via update calls, with addition of new
Update() API, the objects need to deleted are not added to the queue due
to check in updateSupported(). So if the deletion timestamp is set, then
this check is ignored in NewController().
FInd more details [here](rook/rook#8514 (comment))

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
@BlaineEXE
Copy link
Member

@thotz thanks. Merged the lib-bucket-provisioner fix. You should be good to go here.

@thotz
Copy link
Contributor Author

thotz commented Aug 19, 2021

@thotz thanks. Merged the lib-bucket-provisioner fix. You should be good to go here.

Done

Copy link
Member

@BlaineEXE BlaineEXE left a comment

Choose a reason for hiding this comment

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

Just nit comments. This looks good overall. Thanks @thotz

tests/integration/ceph_base_object_test.go Outdated Show resolved Hide resolved
tests/integration/ceph_base_object_test.go Show resolved Hide resolved
tests/integration/ceph_base_object_test.go Show resolved Hide resolved
tests/integration/ceph_base_object_test.go Outdated Show resolved Hide resolved
Recently lib-bucket-provisioner add support for update() API.
Include that on the obc implementation since it can be used to
update quota for OBC.

Fixes: rook#7146

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
@thotz
Copy link
Contributor Author

thotz commented Aug 19, 2021

Just nit comments. This looks good overall. Thanks @thotz

@BlaineEXE : Done

@thotz thotz requested a review from BlaineEXE August 19, 2021 18:49
Copy link
Member

@leseb leseb left a comment

Choose a reason for hiding this comment

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

nit feel free to address or not

@@ -665,3 +665,69 @@ func (p *Provisioner) setAdminOpsAPIClient() error {

return nil
}
func (p Provisioner) updateAdditionalSettings(ob *bktv1alpha1.ObjectBucket) error {
var maxObjectsInt64 int64
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var maxObjectsInt64 int64
var maxObjectsInt64, maxSizeInt64 int64

@leseb leseb removed the do-not-merge DO NOT MERGE :) label Aug 24, 2021
@travisn travisn merged commit 7af10af into rook:master Aug 24, 2021
travisn added a commit that referenced this pull request Aug 26, 2021
ceph: add support for update() from lib-bucket-provisioner (backport #8514)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ceph main ceph tag feature object Object protocol - S3 object-bucket-claims Object Bucket Claims (OBC)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bucket quota can't be updated
4 participants