-
Notifications
You must be signed in to change notification settings - Fork 292
CA-413412: Fail to designate new master #6582
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
CA-413412: Fail to designate new master #6582
Conversation
|
I like the clear writeup. |
7ec16e4 to
1e21df9
Compare
ocaml/xapi/helpers.ml
Outdated
| with _ -> | ||
| (* This is an emergency mode function, so we don't care about the error | ||
| in logout *) | ||
| debug "%s: The logout failed in emergency mode function" __FUNCTION__ ; |
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.
This is an anonymous function, thi means that using FUNCTION here will deliver a strange name, I recommend defining a new binding before `finally is called:
let __FUN = __FUNCTION__ inThere 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.
The log is not too ugly - this is from an anonymous function defined in a named function:
Jul 7 14:16:49 eu1-dt034 xapi: [debug||2965 /var/lib/xcp/xapi|VM.sysprep R:0023873edb88|Vm_sysprep] Vm_sysprep.trigger.(fun): notified domain 54
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.
Maybe we should add a mechanism to add the function name automatically. I always forget to add 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.
That would require a PPX because you can't refer to the calling function in the implementation of the logging function. I would be surprised if?(fun=__FUNCTION__) would work.
The user attempted to designate a new master, but the operation failed. The root cause is as follows: After the new proposed master successfully sent the `commit_new_master` API call to the old master, it attempted to send a `logout` request. However, at this point, the old master was already rebooting its xapi service, causing the `logout` to fail. As a result, the process of designating the new master was marked as failed, and the status changed to `broken`. In high-load environments, there can be a delay in sending the logout request, increasing the likelihood that it is sent after the old master has already started rebooting. If `commit_new_master` has already been successful, the success of the subsequent `logout` operation should not be considered critical. Therefore, the solution is to ignore the result of the `logout` request if `commit_new_master` was successful. Signed-off-by: Bengang Yuan <[email protected]>
1e21df9 to
12826e8
Compare
The user attempted to designate a new master, but the operation failed.
The root cause is as follows:
After the new proposed master successfully sent the
commit_new_masterAPI call to the old master, it attempted to send alogoutrequest. However, at this point, the old master was already rebooting its xapi service, causing thelogoutto fail. As a result, the process of designating the new master was marked as failed, and the status changed tobroken. In high-load environments, there can be a delay in sending the logout request, increasing the likelihood that it is sent after the old master has already started rebooting.If
commit_new_masterhas already been successful, the success of the subsequentlogoutoperation should not be considered critical. Therefore, the solution is to ignore the result of thelogoutrequest ifcommit_new_masterwas successful.