From 370f21fe9d130e0ac8aeaf11b2082efcde0feea2 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Tue, 13 Mar 2018 11:44:56 -0700 Subject: [PATCH] Svc upgrade: wait for last batch to become healthy Before marking service as successfully upgraded --- .../upgrade/impl/UpgradeManagerImpl.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/iaas/service-discovery/server/src/main/java/io/cattle/platform/servicediscovery/upgrade/impl/UpgradeManagerImpl.java b/code/iaas/service-discovery/server/src/main/java/io/cattle/platform/servicediscovery/upgrade/impl/UpgradeManagerImpl.java index 0d14acc8b7..2648cdd32f 100644 --- a/code/iaas/service-discovery/server/src/main/java/io/cattle/platform/servicediscovery/upgrade/impl/UpgradeManagerImpl.java +++ b/code/iaas/service-discovery/server/src/main/java/io/cattle/platform/servicediscovery/upgrade/impl/UpgradeManagerImpl.java @@ -140,8 +140,11 @@ protected void upgradeDeploymentUnits(final Service service, lockManager.lock(new ServiceLock(service), new LockCallbackNoReturn() { @Override public void doWithLockNoResult() { - // wait for healthy only for upgrade - // should be skipped for rollback + // wait for healthy only for upgrade; should be skipped for rollback + // wait for healthy happens 3 times in this block: + // 1. Before performing an upgrade on the batch + // 2. If startFirst=true, after the upgrade is done, but before stop + // 3. After the batch upgrade is completed if (isUpgrade) { deploymentMgr.activate(service); waitForHealthyState(service, currentProcess, strategy); @@ -167,6 +170,9 @@ public void doWithLockNoResult() { // 2. wait for reconcile (new instances will be started along) activate(service); } + if (isUpgrade) { + waitForHealthyState(service, currentProcess, strategy); + } } protected void markForUpgrade(final long batchSize) {