Skip to content

JE-66685 [MySQL Autofailover for Primary-Secondary]: Promoting flag i… #333

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

Merged
merged 1 commit into from
Jun 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions addons/promote-new-primary/scripts/promote-master.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ function promoteNewPrimary() {
resp = this.addIteration(true);
if (resp.result != 0) return resp;
return this.setIsRunningStatus(false);
} else {
let nodeGroup = this.getAddOnType() ? PROXY : SQLDB;

return this.cmdByGroup("rm -rf " + TMP_FILE, nodeGroup, 3);
}

return { result: 0 }
Expand Down Expand Up @@ -636,7 +640,7 @@ function promoteNewPrimary() {
}
}

let resp = api.env.control.ChangeTopology({
return api.env.control.ChangeTopology({
envName: envName,
session: session,
env: {
Expand All @@ -645,9 +649,6 @@ function promoteNewPrimary() {
},
nodes: nodes
});
if (resp.result != 0) return resp;

return this.cmdByGroup("rm -rf " + TMP_FILE, SQLDB, 3);
};

this.removeFailedPrimary = function() {
Expand All @@ -670,7 +671,7 @@ function promoteNewPrimary() {

if (nodeGroup == PROXY && !test) {
let resp = this.checkNodesAvailability(PROXY);
if (resp.nodeid) {
if (resp && resp.nodeid) {
return this.cmdById(resp.nodeid, command);
}
}
Expand Down