|
@@ -63,7 +63,7 @@ public class FailoverController {
|
|
"Can't failover to an active service");
|
|
"Can't failover to an active service");
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
- toSvc.monitorHealth();
|
|
|
|
|
|
+ HAServiceProtocolHelper.monitorHealth(toSvc);
|
|
} catch (HealthCheckFailedException hce) {
|
|
} catch (HealthCheckFailedException hce) {
|
|
throw new FailoverFailedException(
|
|
throw new FailoverFailedException(
|
|
"Can't failover to an unhealthy service", hce);
|
|
"Can't failover to an unhealthy service", hce);
|
|
@@ -91,7 +91,7 @@ public class FailoverController {
|
|
|
|
|
|
// Try to make fromSvc standby
|
|
// Try to make fromSvc standby
|
|
try {
|
|
try {
|
|
- fromSvc.transitionToStandby();
|
|
|
|
|
|
+ HAServiceProtocolHelper.transitionToStandby(fromSvc);
|
|
} catch (ServiceFailedException sfe) {
|
|
} catch (ServiceFailedException sfe) {
|
|
LOG.warn("Unable to make " + fromSvcName + " standby (" +
|
|
LOG.warn("Unable to make " + fromSvcName + " standby (" +
|
|
sfe.getMessage() + ")");
|
|
sfe.getMessage() + ")");
|
|
@@ -105,7 +105,7 @@ public class FailoverController {
|
|
boolean failed = false;
|
|
boolean failed = false;
|
|
Throwable cause = null;
|
|
Throwable cause = null;
|
|
try {
|
|
try {
|
|
- toSvc.transitionToActive();
|
|
|
|
|
|
+ HAServiceProtocolHelper.transitionToActive(toSvc);
|
|
} catch (ServiceFailedException sfe) {
|
|
} catch (ServiceFailedException sfe) {
|
|
LOG.error("Unable to make " + toSvcName + " active (" +
|
|
LOG.error("Unable to make " + toSvcName + " active (" +
|
|
sfe.getMessage() + "). Failing back");
|
|
sfe.getMessage() + "). Failing back");
|
|
@@ -122,7 +122,7 @@ public class FailoverController {
|
|
if (failed) {
|
|
if (failed) {
|
|
String msg = "Unable to failover to " + toSvcName;
|
|
String msg = "Unable to failover to " + toSvcName;
|
|
try {
|
|
try {
|
|
- fromSvc.transitionToActive();
|
|
|
|
|
|
+ HAServiceProtocolHelper.transitionToActive(fromSvc);
|
|
} catch (ServiceFailedException sfe) {
|
|
} catch (ServiceFailedException sfe) {
|
|
msg = "Failback to " + fromSvcName + " failed (" +
|
|
msg = "Failback to " + fromSvcName + " failed (" +
|
|
sfe.getMessage() + ")";
|
|
sfe.getMessage() + ")";
|