This repository has been archived by the owner on Jul 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1139735] HA upgrade issues with storage cluster schema change
First check-in for the necessary revisions. What makes a storage cluster schema change difficult is that it requires the entire storage cluster to be upgraded to the new bits, and to be running, in order to apply the changes. This runs contrary to our typical upgrade approach which is to shut everything down and upgrade one install at a time (an install being a server and/or storage node). The basic approach is to now track the install version for each installed component, and only when evrything has been upgraded, then do we allow the storage cluster start and then perform the schema update as a separate upgrade step. - Add version stamp on rhq_server and rhq_storage_node - Add db upgrade logic to add fields and init them to the current version - Add Support to stamp the version on install and upgrades - includes updates to jboss modules, rhqctl and installers - includes ability to contact RDB from storage installer - Add --storage-schema and --list-versions coptions to rhqctl upgrade - Stop server startup unless topology is set to homogenous version, to prevent running an environment that is not completely upgraded. -
- Loading branch information
Showing
21 changed files
with
853 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
modules/core/dbutils/src/main/java/org/rhq/core/db/upgrade/VersionStampUpgradeTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package org.rhq.core.db.upgrade; | ||
|
||
import java.sql.Connection; | ||
import java.sql.SQLException; | ||
|
||
import mazz.i18n.Logger; | ||
|
||
import org.rhq.core.db.DatabaseType; | ||
import org.rhq.core.db.DbUtilsI18NFactory; | ||
import org.rhq.core.db.DbUtilsI18NResourceKeys; | ||
|
||
/** | ||
* Updates the StorageNode and Server version fields to an initial value of the current version. | ||
* | ||
* @author Jay Shaughnessy | ||
*/ | ||
public class VersionStampUpgradeTask implements DatabaseUpgradeTask { | ||
|
||
private final Logger log = DbUtilsI18NFactory.getLogger(VersionStampUpgradeTask.class); | ||
|
||
@Override | ||
public void execute(DatabaseType databaseType, Connection connection) throws SQLException { | ||
String version = this.getClass().getPackage().getImplementationVersion(); | ||
String update = "UPDATE rhq_server SET version = '" + version + "'"; | ||
log.debug(DbUtilsI18NResourceKeys.EXECUTING_SQL, update); | ||
databaseType.executeSql(connection, update); | ||
|
||
update = "UPDATE rhq_storage_node SET version = '" + version + "'"; | ||
log.debug(DbUtilsI18NResourceKeys.EXECUTING_SQL, update); | ||
databaseType.executeSql(connection, update); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.