-
Notifications
You must be signed in to change notification settings - Fork 75
pkg/migrator: Log some errors on V(2) #129
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
base: master
Are you sure you want to change the base?
Conversation
Some errors that can happen when writing resources back during migration are not particularly significant, yet they can cause a lot or log spam. This change marks some errors coming from the try function to be logged on V(2) so that there are not that many log messages. These include: * conflict * not found * UID precondition failed (effectively a conflict)
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tchap The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Welcome @tchap! |
|
Hi @tchap. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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-sigs/prow repository. |
| // isUIDPreconditionError checks whether the error contains "Precondition failed: UID in precondition". | ||
| // This error message is typically present when the resource is deleted before it can be written back. | ||
| func isUIDPreconditionError(err error) bool { | ||
| return strings.Contains(err.Error(), "Precondition failed: UID in precondition") | ||
| } | ||
|
|
||
| // isConflictError checks whether the given error is a conflict error. | ||
| // This is true when errors.IsConflict or isUIDPreconditionError returns true. | ||
| func isConflictError(err error) bool { | ||
| return errors.IsConflict(err) || isUIDPreconditionError(err) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the UID precondition fails, doesn't that imply that the current iteration of the resource was created after the migration started? And if so, is it redundant to "migrate" it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this issue was originally raised because the migrator was trying to migrate resources that were deleted during migration, so there was a race. So the precondition failed with the stored UID being empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't API servers generally return HTTP 404 when that happens? How can it enforce a UID precondition at all if the named object does not exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the log spam this PR is trying to address caused by kubernetes/kubernetes#124347?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems so, the full error message is the same, just for a different object.
|
@tchap: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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-sigs/prow repository. |
|
/ok-to-test |
|
@tchap: The following test failed, say
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-sigs/prow repository. I understand the commands that are listed here. |
Some errors that can happen when writing resources back during migration are not particularly significant, yet they can cause a lot of log spam.
This change marks some errors coming from the try function to be logged on V(2) so that there are not that many log messages. These include: