mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
checking in the upgrade stuff for now
This commit is contained in:
parent
ec96a9afea
commit
82f7504832
@ -3,7 +3,7 @@
|
|||||||
# major.minor.patch versioning scheme for vmops
|
# major.minor.patch versioning scheme for vmops
|
||||||
company.major.version=2
|
company.major.version=2
|
||||||
company.minor.version=2
|
company.minor.version=2
|
||||||
company.patch.version=3
|
company.patch.version=4
|
||||||
|
|
||||||
svn.revision=2
|
svn.revision=2
|
||||||
|
|
||||||
|
|||||||
@ -160,6 +160,19 @@ public class ClusterManagerImpl implements ClusterManager {
|
|||||||
return answers[0].getResult();
|
return answers[0].getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* called by DatabaseUpgradeChecker to see if there are other peers running.
|
||||||
|
* @param notVersion If version is passed in, the peers CANNOT be running at this
|
||||||
|
* version. If version is null, return true if any peer is
|
||||||
|
* running regardless of version.
|
||||||
|
* @return true if there are peers running and false if not.
|
||||||
|
*/
|
||||||
|
public static final boolean arePeersRunning(String notVersion) {
|
||||||
|
return false; //TODO: Leaving this for Kelven to take care of.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void broadcast(long agentId, Command[] cmds) {
|
public void broadcast(long agentId, Command[] cmds) {
|
||||||
Date cutTime = DateUtil.currentGMTTime();
|
Date cutTime = DateUtil.currentGMTTime();
|
||||||
@ -564,9 +577,10 @@ public class ClusterManagerImpl implements ClusterManager {
|
|||||||
// missed cleanup
|
// missed cleanup
|
||||||
Date cutTime = DateUtil.currentGMTTime();
|
Date cutTime = DateUtil.currentGMTTime();
|
||||||
List<ManagementServerHostVO> inactiveList = _mshostDao.getInactiveList(new Date(cutTime.getTime() - heartbeatThreshold));
|
List<ManagementServerHostVO> inactiveList = _mshostDao.getInactiveList(new Date(cutTime.getTime() - heartbeatThreshold));
|
||||||
if(inactiveList.size() > 0)
|
if(inactiveList.size() > 0) {
|
||||||
notifyNodeLeft(inactiveList);
|
notifyNodeLeft(inactiveList);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void peerScan() {
|
private void peerScan() {
|
||||||
Date cutTime = DateUtil.currentGMTTime();
|
Date cutTime = DateUtil.currentGMTTime();
|
||||||
@ -632,8 +646,9 @@ public class ClusterManagerImpl implements ClusterManager {
|
|||||||
|
|
||||||
profiler.stop();
|
profiler.stop();
|
||||||
if(profiler.getDuration() > 1000) {
|
if(profiler.getDuration() > 1000) {
|
||||||
if(s_logger.isDebugEnabled())
|
if(s_logger.isDebugEnabled()) {
|
||||||
s_logger.debug("Notifying management server join event took " + profiler.getDuration() + " ms");
|
s_logger.debug("Notifying management server join event took " + profiler.getDuration() + " ms");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
s_logger.warn("Notifying management server join event took " + profiler.getDuration() + " ms");
|
s_logger.warn("Notifying management server join event took " + profiler.getDuration() + " ms");
|
||||||
}
|
}
|
||||||
@ -647,8 +662,9 @@ public class ClusterManagerImpl implements ClusterManager {
|
|||||||
|
|
||||||
profiler.stop();
|
profiler.stop();
|
||||||
if(profiler.getDuration() > 1000) {
|
if(profiler.getDuration() > 1000) {
|
||||||
if(s_logger.isDebugEnabled())
|
if(s_logger.isDebugEnabled()) {
|
||||||
s_logger.debug("Notifying management server leave event took " + profiler.getDuration() + " ms");
|
s_logger.debug("Notifying management server leave event took " + profiler.getDuration() + " ms");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
s_logger.warn("Notifying management server leave event took " + profiler.getDuration() + " ms");
|
s_logger.warn("Notifying management server leave event took " + profiler.getDuration() + " ms");
|
||||||
}
|
}
|
||||||
@ -855,9 +871,10 @@ public class ClusterManagerImpl implements ClusterManager {
|
|||||||
public boolean isManagementNodeAlive(long msid) {
|
public boolean isManagementNodeAlive(long msid) {
|
||||||
ManagementServerHostVO mshost = _mshostDao.findByMsid(msid);
|
ManagementServerHostVO mshost = _mshostDao.findByMsid(msid);
|
||||||
if(mshost != null) {
|
if(mshost != null) {
|
||||||
if(mshost.getLastUpdateTime().getTime() >= DateUtil.currentGMTTime().getTime() - heartbeatThreshold)
|
if(mshost.getLastUpdateTime().getTime() >= DateUtil.currentGMTTime().getTime() - heartbeatThreshold) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -865,8 +882,9 @@ public class ClusterManagerImpl implements ClusterManager {
|
|||||||
@Override
|
@Override
|
||||||
public boolean pingManagementNode(long msid) {
|
public boolean pingManagementNode(long msid) {
|
||||||
ManagementServerHostVO mshost = _mshostDao.findByMsid(msid);
|
ManagementServerHostVO mshost = _mshostDao.findByMsid(msid);
|
||||||
if(mshost == null)
|
if(mshost == null) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
String targetIp = mshost.getServiceIP();
|
String targetIp = mshost.getServiceIP();
|
||||||
if("127.0.0.1".equals(targetIp) || "0.0.0.0".equals(targetIp)) {
|
if("127.0.0.1".equals(targetIp) || "0.0.0.0".equals(targetIp)) {
|
||||||
|
|||||||
@ -28,11 +28,12 @@ import java.util.HashMap;
|
|||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
import com.cloud.cluster.ClusterManagerImpl;
|
||||||
import com.cloud.maint.Version;
|
import com.cloud.maint.Version;
|
||||||
import com.cloud.upgrade.dao.VersionVO.Step;
|
import com.cloud.upgrade.dao.VersionVO.Step;
|
||||||
import com.cloud.utils.Pair;
|
|
||||||
import com.cloud.utils.component.ComponentLocator;
|
import com.cloud.utils.component.ComponentLocator;
|
||||||
import com.cloud.utils.component.SystemIntegrityChecker;
|
import com.cloud.utils.component.SystemIntegrityChecker;
|
||||||
|
import com.cloud.utils.db.GlobalLock;
|
||||||
import com.cloud.utils.db.ScriptRunner;
|
import com.cloud.utils.db.ScriptRunner;
|
||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
import com.cloud.utils.exception.CloudRuntimeException;
|
import com.cloud.utils.exception.CloudRuntimeException;
|
||||||
@ -40,12 +41,14 @@ import com.cloud.utils.exception.CloudRuntimeException;
|
|||||||
public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
|
public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
|
||||||
private final Logger s_logger = Logger.getLogger(DatabaseUpgradeChecker.class);
|
private final Logger s_logger = Logger.getLogger(DatabaseUpgradeChecker.class);
|
||||||
|
|
||||||
protected HashMap<Pair<String, String>, DbUpgrade[]> _upgradeMap = new HashMap<Pair<String, String>, DbUpgrade[]>();
|
protected HashMap<String, DbUpgrade[]> _upgradeMap = new HashMap<String, DbUpgrade[]>();
|
||||||
|
|
||||||
VersionDao _dao;
|
VersionDao _dao;
|
||||||
public DatabaseUpgradeChecker() {
|
public DatabaseUpgradeChecker() {
|
||||||
_dao = ComponentLocator.inject(VersionDaoImpl.class);
|
_dao = ComponentLocator.inject(VersionDaoImpl.class);
|
||||||
_upgradeMap.put(new Pair<String, String>("2.1.7", "2.2.3"), new DbUpgrade[] { new Upgrade217to22(), new Upgrade221to222(), new UpgradeSnapshot217to223(), new Upgrade222to224()});
|
_upgradeMap.put("2.1.7", new DbUpgrade[] { new Upgrade217to22(), new Upgrade221to222(), new UpgradeSnapshot217to223(), new Upgrade222to224()});
|
||||||
|
_upgradeMap.put("2.2.2", new DbUpgrade[] { new Upgrade222to224() });
|
||||||
|
_upgradeMap.put("2.2.3", new DbUpgrade[] { new Upgrade222to224() });
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void runScript(File file) {
|
protected void runScript(File file) {
|
||||||
@ -55,11 +58,11 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
|
|||||||
ScriptRunner runner = new ScriptRunner(conn, false, true);
|
ScriptRunner runner = new ScriptRunner(conn, false, true);
|
||||||
runner.runScript(reader);
|
runner.runScript(reader);
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
throw new CloudRuntimeException("Unable to find upgrade script, schema-21to22.sql", e);
|
throw new CloudRuntimeException("Unable to find upgrade script: " + file.getAbsolutePath(), e);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new CloudRuntimeException("Unable to read upgrade script, schema-21to22.sql", e);
|
throw new CloudRuntimeException("Unable to read upgrade script: " + file.getAbsolutePath(), e);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new CloudRuntimeException("Unable to execute upgrade script, schema-21to22.sql", e);
|
throw new CloudRuntimeException("Unable to execute upgrade script: " + file.getAbsolutePath(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +72,7 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
|
|||||||
String trimmedDbVersion = Version.trimToPatch(dbVersion);
|
String trimmedDbVersion = Version.trimToPatch(dbVersion);
|
||||||
String trimmedCurrentVersion = Version.trimToPatch(currentVersion);
|
String trimmedCurrentVersion = Version.trimToPatch(currentVersion);
|
||||||
|
|
||||||
DbUpgrade[] upgrades = _upgradeMap.get(new Pair<String, String>(trimmedDbVersion, trimmedCurrentVersion));
|
DbUpgrade[] upgrades = _upgradeMap.get(trimmedDbVersion);
|
||||||
if (upgrades == null) {
|
if (upgrades == null) {
|
||||||
throw new CloudRuntimeException("There is no upgrade path from " + dbVersion + " to " + currentVersion);
|
throw new CloudRuntimeException("There is no upgrade path from " + dbVersion + " to " + currentVersion);
|
||||||
}
|
}
|
||||||
@ -86,8 +89,8 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!supportsRollingUpgrade) {
|
if (!supportsRollingUpgrade && ClusterManagerImpl.arePeersRunning(null)) {
|
||||||
// TODO: Check if the other management server is still running by looking at the database. If so, then throw an exception.
|
throw new CloudRuntimeException("Unable to run upgrade because the upgrade sequence does not support rolling update and there are other management server nodes running");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (DbUpgrade upgrade : upgrades) {
|
for (DbUpgrade upgrade : upgrades) {
|
||||||
@ -116,6 +119,8 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!ClusterManagerImpl.arePeersRunning(trimmedCurrentVersion)) {
|
||||||
|
s_logger.info("Cleaning upgrades because all management server are now at the same version");
|
||||||
for (DbUpgrade upgrade : upgrades) {
|
for (DbUpgrade upgrade : upgrades) {
|
||||||
s_logger.info("Cleanup upgrade " + upgrade.getClass().getSimpleName() + " to upgrade from " + upgrade.getUpgradableVersionRange()[0] + "-" + upgrade.getUpgradableVersionRange()[1] + " to " + upgrade.getUpgradedVersion());
|
s_logger.info("Cleanup upgrade " + upgrade.getClass().getSimpleName() + " to upgrade from " + upgrade.getUpgradableVersionRange()[0] + "-" + upgrade.getUpgradableVersionRange()[1] + " to " + upgrade.getUpgradedVersion());
|
||||||
VersionVO version = _dao.findByVersion(upgrade.getUpgradedVersion(), Step.Upgrade);
|
VersionVO version = _dao.findByVersion(upgrade.getUpgradedVersion(), Step.Upgrade);
|
||||||
@ -137,27 +142,41 @@ public class DatabaseUpgradeChecker implements SystemIntegrityChecker {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void check() {
|
public void check() {
|
||||||
|
GlobalLock lock = GlobalLock.getInternLock("DatabaseUpgrade");
|
||||||
|
try {
|
||||||
|
s_logger.info("Grabbing lock to check for database integrity.");
|
||||||
|
if (!lock.lock(20*60)) {
|
||||||
|
throw new CloudRuntimeException("Unable to acquire lock to check for database integrity.");
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
String dbVersion = _dao.getCurrentVersion();
|
String dbVersion = _dao.getCurrentVersion();
|
||||||
String currentVersion = this.getClass().getPackage().getImplementationVersion();
|
String currentVersion = this.getClass().getPackage().getImplementationVersion();
|
||||||
if (currentVersion == null) {
|
if (currentVersion == null) {
|
||||||
currentVersion = this.getClass().getSuperclass().getPackage().getImplementationVersion();
|
currentVersion = this.getClass().getSuperclass().getPackage().getImplementationVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s_logger.isDebugEnabled()) {
|
s_logger.info("DB version = " + dbVersion + " Code Version = " + currentVersion);
|
||||||
s_logger.debug("DB version = " + dbVersion + " Code Version = " + currentVersion);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Version.compare(Version.trimToPatch(dbVersion), Version.trimToPatch(currentVersion)) > 0) {
|
if (Version.compare(Version.trimToPatch(dbVersion), Version.trimToPatch(currentVersion)) > 0) {
|
||||||
throw new CloudRuntimeException("Database version " + dbVersion + " is higher than management software version " + currentVersion);
|
throw new CloudRuntimeException("Database version " + dbVersion + " is higher than management software version " + currentVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Version.compare(Version.trimToPatch(dbVersion), Version.trimToPatch(currentVersion)) == 0) {
|
if (Version.compare(Version.trimToPatch(dbVersion), Version.trimToPatch(currentVersion)) == 0) {
|
||||||
|
s_logger.info("DB version and code version matches so no upgrade needed.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
upgrade(dbVersion, currentVersion);
|
upgrade(dbVersion, currentVersion);
|
||||||
|
} finally {
|
||||||
|
lock.unlock();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
lock.releaseRef();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,9 +34,7 @@ import javax.persistence.TemporalType;
|
|||||||
@Table(name="version")
|
@Table(name="version")
|
||||||
public class VersionVO {
|
public class VersionVO {
|
||||||
public enum Step {
|
public enum Step {
|
||||||
Dump,
|
|
||||||
Upgrade,
|
Upgrade,
|
||||||
Cleanup,
|
|
||||||
Complete
|
Complete
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -35,8 +35,8 @@ import com.cloud.utils.db.DbTestUtils;
|
|||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
import com.cloud.utils.exception.CloudRuntimeException;
|
import com.cloud.utils.exception.CloudRuntimeException;
|
||||||
|
|
||||||
public class AdvanceZone217To223UpgradeTest extends TestCase {
|
public class AdvanceZone217To224UpgradeTest extends TestCase {
|
||||||
private static final Logger s_logger = Logger.getLogger(AdvanceZone217To223UpgradeTest.class);
|
private static final Logger s_logger = Logger.getLogger(AdvanceZone217To224UpgradeTest.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Before
|
@Before
|
||||||
@ -64,14 +64,14 @@ public class AdvanceZone217To223UpgradeTest extends TestCase {
|
|||||||
String version = dao.getCurrentVersion();
|
String version = dao.getCurrentVersion();
|
||||||
assert version.equals("2.1.7") : "Version returned is not 2.1.7 but " + version;
|
assert version.equals("2.1.7") : "Version returned is not 2.1.7 but " + version;
|
||||||
|
|
||||||
checker.upgrade("2.1.7", "2.2.3");
|
checker.upgrade("2.1.7", "2.2.4");
|
||||||
|
|
||||||
conn = Transaction.getStandaloneConnection();
|
conn = Transaction.getStandaloneConnection();
|
||||||
try {
|
try {
|
||||||
pstmt = conn.prepareStatement("SELECT version FROM version ORDER BY id DESC LIMIT 1");
|
pstmt = conn.prepareStatement("SELECT version FROM version ORDER BY id DESC LIMIT 1");
|
||||||
ResultSet rs = pstmt.executeQuery();
|
ResultSet rs = pstmt.executeQuery();
|
||||||
assert rs.next() : "No version selected";
|
assert rs.next() : "No version selected";
|
||||||
assert rs.getString(1).equals("2.2.3") : "VERSION stored is not 2.2.3: " + rs.getString(1);
|
assert rs.getString(1).equals("2.2.4") : "VERSION stored is not 2.2.4: " + rs.getString(1);
|
||||||
rs.close();
|
rs.close();
|
||||||
pstmt.close();
|
pstmt.close();
|
||||||
|
|
||||||
@ -35,8 +35,8 @@ import com.cloud.utils.db.DbTestUtils;
|
|||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
import com.cloud.utils.exception.CloudRuntimeException;
|
import com.cloud.utils.exception.CloudRuntimeException;
|
||||||
|
|
||||||
public class BasicZone217To223UpgradeTest extends TestCase {
|
public class BasicZone217To224UpgradeTest extends TestCase {
|
||||||
private static final Logger s_logger = Logger.getLogger(BasicZone217To223UpgradeTest.class);
|
private static final Logger s_logger = Logger.getLogger(BasicZone217To224UpgradeTest.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Before
|
@Before
|
||||||
@ -69,12 +69,12 @@ public class BasicZone217To223UpgradeTest extends TestCase {
|
|||||||
s_logger.debug("Basic zone test version is " + version);
|
s_logger.debug("Basic zone test version is " + version);
|
||||||
}
|
}
|
||||||
|
|
||||||
checker.upgrade("2.1.7", "2.2.3");
|
checker.upgrade("2.1.7", "2.2.4");
|
||||||
|
|
||||||
conn = Transaction.getStandaloneConnection();
|
conn = Transaction.getStandaloneConnection();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
s_logger.debug("Starting tesing upgrade from 2.1.7 to 2.2.3 for Basic zone...");
|
s_logger.debug("Starting tesing upgrade from 2.1.7 to 2.2.4 for Basic zone...");
|
||||||
|
|
||||||
//Version check
|
//Version check
|
||||||
pstmt = conn.prepareStatement(" SELECT version FROM version ORDER BY id DESC LIMIT 1");
|
pstmt = conn.prepareStatement(" SELECT version FROM version ORDER BY id DESC LIMIT 1");
|
||||||
@ -82,8 +82,8 @@ public class BasicZone217To223UpgradeTest extends TestCase {
|
|||||||
|
|
||||||
if (!rs.next()) {
|
if (!rs.next()) {
|
||||||
s_logger.error("ERROR: No version selected");
|
s_logger.error("ERROR: No version selected");
|
||||||
} else if (!rs.getString(1).equals("2.2.3")) {
|
} else if (!rs.getString(1).equals("2.2.4")) {
|
||||||
s_logger.error("ERROR: VERSION stored is not 2.2.3: " + rs.getString(1));
|
s_logger.error("ERROR: VERSION stored is not 2.2.4: " + rs.getString(1));
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
pstmt.close();
|
pstmt.close();
|
||||||
@ -36,8 +36,8 @@ import com.cloud.utils.db.DbTestUtils;
|
|||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
import com.cloud.utils.exception.CloudRuntimeException;
|
import com.cloud.utils.exception.CloudRuntimeException;
|
||||||
|
|
||||||
public class InstanceGroup217To223UpgradeTest extends TestCase {
|
public class InstanceGroup217To224UpgradeTest extends TestCase {
|
||||||
private static final Logger s_logger = Logger.getLogger(InstanceGroup217To223UpgradeTest.class);
|
private static final Logger s_logger = Logger.getLogger(InstanceGroup217To224UpgradeTest.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Before
|
@Before
|
||||||
@ -70,12 +70,12 @@ public class InstanceGroup217To223UpgradeTest extends TestCase {
|
|||||||
s_logger.debug("Basic zone test version is " + version);
|
s_logger.debug("Basic zone test version is " + version);
|
||||||
}
|
}
|
||||||
|
|
||||||
checker.upgrade("2.1.7", "2.2.3");
|
checker.upgrade("2.1.7", "2.2.4");
|
||||||
|
|
||||||
conn = Transaction.getStandaloneConnection();
|
conn = Transaction.getStandaloneConnection();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
s_logger.debug("Starting tesing upgrade from 2.1.7 to 2.2.3 for Instance groups...");
|
s_logger.debug("Starting tesing upgrade from 2.1.7 to 2.2.4 for Instance groups...");
|
||||||
|
|
||||||
//Version check
|
//Version check
|
||||||
pstmt = conn.prepareStatement("SELECT version FROM version");
|
pstmt = conn.prepareStatement("SELECT version FROM version");
|
||||||
@ -83,8 +83,8 @@ public class InstanceGroup217To223UpgradeTest extends TestCase {
|
|||||||
|
|
||||||
if (!rs.next()) {
|
if (!rs.next()) {
|
||||||
s_logger.error("ERROR: No version selected");
|
s_logger.error("ERROR: No version selected");
|
||||||
} else if (!rs.getString(1).equals("2.2.3")) {
|
} else if (!rs.getString(1).equals("2.2.4")) {
|
||||||
s_logger.error("ERROR: VERSION stored is not 2.2.3: " + rs.getString(1));
|
s_logger.error("ERROR: VERSION stored is not 2.2.4: " + rs.getString(1));
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
pstmt.close();
|
pstmt.close();
|
||||||
@ -36,8 +36,8 @@ import com.cloud.utils.db.DbTestUtils;
|
|||||||
import com.cloud.utils.db.Transaction;
|
import com.cloud.utils.db.Transaction;
|
||||||
import com.cloud.utils.exception.CloudRuntimeException;
|
import com.cloud.utils.exception.CloudRuntimeException;
|
||||||
|
|
||||||
public class PortForwarding217To221UpgradeTest extends TestCase {
|
public class PortForwarding217To224UpgradeTest extends TestCase {
|
||||||
private static final Logger s_logger = Logger.getLogger(PortForwarding217To221UpgradeTest.class);
|
private static final Logger s_logger = Logger.getLogger(PortForwarding217To224UpgradeTest.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Before
|
@Before
|
||||||
@ -70,12 +70,12 @@ public class PortForwarding217To221UpgradeTest extends TestCase {
|
|||||||
s_logger.debug("Port forwarding test version is " + version);
|
s_logger.debug("Port forwarding test version is " + version);
|
||||||
}
|
}
|
||||||
|
|
||||||
checker.upgrade("2.1.7", "2.2.3");
|
checker.upgrade("2.1.7", "2.2.4");
|
||||||
|
|
||||||
conn = Transaction.getStandaloneConnection();
|
conn = Transaction.getStandaloneConnection();
|
||||||
try {
|
try {
|
||||||
|
|
||||||
s_logger.debug("Starting tesing upgrade from 2.1.7 to 2.2.3 for Port forwarding rules...");
|
s_logger.debug("Starting tesing upgrade from 2.1.7 to 2.2.4 for Port forwarding rules...");
|
||||||
|
|
||||||
//Version check
|
//Version check
|
||||||
pstmt = conn.prepareStatement("SELECT version FROM version");
|
pstmt = conn.prepareStatement("SELECT version FROM version");
|
||||||
@ -83,8 +83,8 @@ public class PortForwarding217To221UpgradeTest extends TestCase {
|
|||||||
|
|
||||||
if (!rs.next()) {
|
if (!rs.next()) {
|
||||||
s_logger.error("ERROR: No version selected");
|
s_logger.error("ERROR: No version selected");
|
||||||
} else if (!rs.getString(1).equals("2.2.3")) {
|
} else if (!rs.getString(1).equals("2.2.4")) {
|
||||||
s_logger.error("ERROR: VERSION stored is not 2.2.3: " + rs.getString(1));
|
s_logger.error("ERROR: VERSION stored is not 2.2.4: " + rs.getString(1));
|
||||||
}
|
}
|
||||||
rs.close();
|
rs.close();
|
||||||
pstmt.close();
|
pstmt.close();
|
||||||
Loading…
x
Reference in New Issue
Block a user