Merge the tip of origin/release/proposed/2019.2.0 into origin/release/2019.2.0
ed7c7a5 Add BACKUP_KEYSTONE_CREDENTIAL_KEYS in backupninja-backup-pipeline
1f5865f Add check for the situation when variable galera_mysql_version set to 3.6 version and UPDATE_TO_MYSQL57 flag is set
fb10a4d Update MySQL upgrade pipeline to support MySQL 5.7 update procedure
768f79f [ceph] fix issue with upmap used for adding missing osd
10d70fd Replace 'service mysql reload' with 'systemctl restart mysql' in MySQL upgrade pipeline
34603b3 Fix procedure of masterNode determine in MySQL upgrade pipeline
53f0f57 Switch keystone_chek param in false in restore pipeline for maas Related-Prod:PROD-36455
Change-Id: I1b011b1c43d3fca114f0995422e366b642128303
diff --git a/backupninja-restore-pipeline.groovy b/backupninja-restore-pipeline.groovy
index cbd1f43..c1f5be0 100644
--- a/backupninja-restore-pipeline.groovy
+++ b/backupninja-restore-pipeline.groovy
@@ -5,7 +5,7 @@
def maasNodes = []
def restoreSaltMasterAndMaas = (env.getProperty('RESTORE_SALTMASTER_AND_MAAS') ?: true).toBoolean()
def restoreDogtag = (env.getProperty('RESTORE_DOGTAG') ?: true).toBoolean()
-def restoreKeystone = (env.getProperty('RESTORE_KEYSTONE_CREDENTIAL_KEYS') ?: true).toBoolean()
+def restoreKeystone = (env.getProperty('RESTORE_KEYSTONE_CREDENTIAL_KEYS') ?: false).toBoolean()
timeout(time: 12, unit: 'HOURS') {
node() {
diff --git a/ceph-add-node.groovy b/ceph-add-node.groovy
index d1315b2..50fc876 100644
--- a/ceph-add-node.groovy
+++ b/ceph-add-node.groovy
@@ -118,20 +118,21 @@
if(useUpmap) {
stage("update mappings") {
- def mapping = []
def pgmap
for (int x = 1; x <= 3; x++) {
pgmap = ceph.cmdRun(pepperEnv, 'ceph pg ls remapped --format=json', false)
if (pgmap.trim()) {
pgmap = "{\"pgs\":$pgmap}" // common.parseJSON() can't parse a list of maps
pgmap = common.parseJSON(pgmap)['pgs']
- if (!pgmap.get('pg_ready', false)) {
- ceph.generateMapping(pgmap, mapping)
- for(map in mapping) {
- ceph.cmdRun(pepperEnv, map)
- }
- sleep(30)
+ if (pgmap instanceof java.util.Map && pgmap.get('pg_ready', false)) {
+ continue
}
+ def mapping = []
+ ceph.generateMapping(pgmap, mapping)
+ for(map in mapping) {
+ ceph.cmdRun(pepperEnv, map)
+ }
+ sleep(30)
}
}
}
diff --git a/ceph-remove-node.groovy b/ceph-remove-node.groovy
index d8a6d0e..7c2a25b 100644
--- a/ceph-remove-node.groovy
+++ b/ceph-remove-node.groovy
@@ -108,7 +108,8 @@
common.infoMsg("The following osds will be removed: ${osds.join(', ')}")
}
if(osds != cephDisks) {
- common.infoMsg("The following osds will be skiped: ${cephDisks.removeAll(osds).join(', ')}")
+ cephDisks.removeAll(osds)
+ common.infoMsg("The following osds will be skiped: ${cephDisks.join(', ')}")
}
ceph.removeOsd(pepperEnv, HOST, osds, flags, safeRemove, fullWipe)
diff --git a/galera-database-backup-pipeline.groovy b/galera-database-backup-pipeline.groovy
index 466c7ea..e19c6a1 100644
--- a/galera-database-backup-pipeline.groovy
+++ b/galera-database-backup-pipeline.groovy
@@ -88,6 +88,7 @@
[$class: 'BooleanParameterValue', name: 'ASK_CONFIRMATION', value: "false"],
[$class: 'BooleanParameterValue', name: 'BACKUP_SALTMASTER_AND_MAAS', value: "false"],
[$class: 'BooleanParameterValue', name: 'BACKUP_DOGTAG', value: "true"],
+ [$class: 'BooleanParameterValue', name: 'BACKUP_KEYSTONE_CREDENTIAL_KEYS', value: "false"]
]
)
} else {
diff --git a/openstack-galera-upgrade.groovy b/openstack-galera-upgrade.groovy
index f124051..348de49 100644
--- a/openstack-galera-upgrade.groovy
+++ b/openstack-galera-upgrade.groovy
@@ -10,6 +10,7 @@
* OS_UPGRADE Upgrade all installed applications (apt-get upgrade)
* TARGET_SERVERS Comma separated list of salt compound definitions to upgrade.
* INTERACTIVE Ask interactive questions during pipeline run (bool).
+ * UPDATE_TO_MYSQL57 Set this flag if you are updating MySQL from 5.6 to 5.7
*
**/
@@ -22,6 +23,7 @@
def shutdownCluster = SHUTDOWN_CLUSTER.toBoolean()
def interactive = INTERACTIVE.toBoolean()
def LinkedHashMap upgradeStageMap = [:]
+def updateToMysql57 = UPDATE_TO_MYSQL57.toBoolean()
upgradeStageMap.put('Pre upgrade',
[
@@ -118,6 +120,25 @@
for (target in upgradeTargets) {
salt.runSaltProcessStep(env, target, 'saltutil.refresh_pillar', [], null, true)
+ mysqlPillarVersion = salt.getPillar(env, target, "galera:version:mysql").get("return")[0].values()[0].toString().toLowerCase()
+ mysql56InstalledVersion = salt.getReturnValues(salt.runSaltProcessStep(env, target, 'pkg.version', 'mysql-wsrep-server-5.6', null, true)).toString().toLowerCase().take(3)
+ mysql57InstalledVersion = salt.getReturnValues(salt.runSaltProcessStep(env, target, 'pkg.version', 'mysql-wsrep-server-5.7', null, true)).toString().toLowerCase().take(3)
+
+ if (mysqlPillarVersion == '5.6' && mysql57InstalledVersion == '5.7') {
+ error("""Pre upgrade check failed. You are trying to downgrade MySQL package from 5.7 version to 5.6.
+ Check value for galera_mysql_version variable in your model.""")
+ }
+ if (mysqlPillarVersion == '5.7' && mysql56InstalledVersion == '5.6' && updateToMysql57 != true) {
+ error("""Pre upgrade check failed. You are trying to update MySQL package from version 5.6 to version 5.7 the wrong way.
+ If you want to update from 5.6 version to 5.7 set flag UPDATE_TO_MYSQL57 in the current job.
+ If you don't want to update from 5.6 version to 5.7 you need to change the value for galera_mysql_version to 5.6 in your model.""")
+ }
+ if (mysqlPillarVersion == '5.6' && updateToMysql57 == true) {
+ error("""Pre upgrade check failed. You are trying to update MySQL package from version 5.6 to version 5.7 the wrong way.
+ If you want to update from 5.6 version to 5.7 you need to set galera_mysql_version variable in your model to 5.7 value.
+ If you don't want to update from 5.6 version to 5.7 you need to unset flag UPDATE_TO_MYSQL57""")
+ }
+
salt.enforceState(env, target, ['linux.system.repo'])
common.stageWrapper(upgradeStageMap, "Pre upgrade", target, interactive) {
openstack.runOpenStackUpgradePhase(env, target, 'pre')
@@ -125,6 +146,10 @@
}
}
+ if (updateToMysql57 == true) {
+ shutdownCluster = true
+ }
+
if (shutdownCluster){
for (target in stopTargets) {
common.stageWrapper(upgradeStageMap, "Stop MySQL service", target, interactive) {
@@ -133,17 +158,7 @@
}
}
- for (target in upgradeTargets) {
- out = salt.cmdRun(env, target, 'cat /var/lib/mysql/grastate.dat | grep "seqno" | cut -d ":" -f2', true, null, false).get('return')[0].values()[0].replaceAll('Salt command execution success', '').trim()
- common.infoMsg("Get seqno: ${out} for node ${target}")
- if (!out.isNumber()){
- out = -2
- }
- targetSecMapping[out.toInteger()] = target
- secNoList.add(out.toInteger())
- }
-
- def masterNode = targetSecMapping[secNoList.max()]
+ def masterNode = salt.getMinionsSorted(env, galera.getGaleraLastShutdownNode(env))[0]
common.infoMsg("Master node is: ${masterNode}")
// Make sure we start upgrade always from master node
@@ -169,8 +184,18 @@
}
common.stageWrapper(upgradeStageMap, "Upgrade MySQL server", target, interactive) {
- openstack.runOpenStackUpgradePhase(env, target, 'pkgs_latest')
- openstack.runOpenStackUpgradePhase(env, target, 'render_config')
+ if (updateToMysql57 == true) {
+ if (target == masterNode) {
+ openstack.runOpenStackUpgradePhase(env, target, 'update_master')
+ }
+ else {
+ openstack.runOpenStackUpgradePhase(env, target, 'update_slave')
+ }
+ }
+ else {
+ openstack.runOpenStackUpgradePhase(env, target, 'pkgs_latest')
+ openstack.runOpenStackUpgradePhase(env, target, 'render_config')
+ }
}
if (shutdownCluster && target == masterNode){
@@ -190,7 +215,7 @@
if (shutdownCluster) {
openstack.runOpenStackUpgradePhase(env, masterNode, 'render_config')
- salt.cmdRun(env, masterNode, "service mysql reload")
+ salt.cmdRun(env, masterNode, "systemctl restart mysql")
openstack.runOpenStackUpgradePhase(env, masterNode, 'verify')
}