Merge "Disallow rolling upgrade from Ocata to Queens"

This commit is contained in:
Zuul 2017-10-18 16:14:22 +00:00 committed by Gerrit Code Review
commit 6d14576744
3 changed files with 11 additions and 29 deletions

View File

@ -368,7 +368,7 @@
# (default), leave it unset and the latest versions of RPC
# communication and database objects will be used. (string
# value)
# Allowed values: pike, ocata, 9.1, 9.0, 8.0, 7.0
# Allowed values: pike, 9.1, 9.0, 8.0
#pin_release_version = <None>
# Path to the rootwrap configuration file to use for running
@ -3657,8 +3657,8 @@
# Minimum value: 0
#udp_transport_timeout = 1.0
# Maximum number of UDP request retries, 0 means just a single
# request. (integer value)
# Maximum number of UDP request retries, 0 means no retries.
# (integer value)
# Minimum value: 0
#udp_transport_retries = 5

View File

@ -54,18 +54,6 @@
# oldest named release.
RELEASE_MAPPING = {
'7.0': {
'rpc': '1.40',
'objects': {
'Node': ['1.21'],
'Conductor': ['1.2'],
'Chassis': ['1.3'],
'Port': ['1.6'],
'Portgroup': ['1.3'],
'VolumeConnector': ['1.0'],
'VolumeTarget': ['1.0'],
}
},
'8.0': {
'rpc': '1.40',
'objects': {
@ -128,7 +116,6 @@ RELEASE_MAPPING = {
# release (that we are no longer supporting for a rolling upgrade).
#
# There should be at most two named mappings here.
RELEASE_MAPPING['ocata'] = RELEASE_MAPPING['7.0']
RELEASE_MAPPING['pike'] = RELEASE_MAPPING['9.1']
# List of available versions with named versions first; 'master' is excluded.

View File

@ -243,19 +243,14 @@ class IronicObject(object_base.VersionedObject):
db_version = db_object['version']
if db_version is None:
# NOTE(rloo): This can only happen after we've updated the DB
# tables to include the 'version' column but haven't saved the
# object to the DB since the new column was added. This column is
# added in the Pike cycle, so if the version isn't set, use the
# version associated with the most recent release, i.e. '8.0'.
# The objects and RPC versions haven't changed between '8.0' and
# Ocata, which is why it is fine to use Ocata.
# Furthermore, if this is a new object that did not exist in the
# most recent release, we assume it is version 1.0.
# TODO(rloo): This entire if clause can be deleted in Queens
# since the dbsync online migration populates all the versions
# and it must be run to completion before upgrading to Queens.
db_version = versions.RELEASE_MAPPING['ocata']['objects'].get(
# NOTE(rloo): This can only happen if the DB is corrupt or this
# is the conductor object. (Because the rest of the objects will
# all have their DB version set properly.)
# TODO(rloo): This entire if clause can be deleted in Rocky
# since the dbsync online migration populates all the conductor
# versions and it must be run to completion before upgrading to
# Rocky.
db_version = versions.RELEASE_MAPPING['pike']['objects'].get(
objname, ['1.0'])[0]
if not versionutils.is_compatible(db_version, obj.__class__.VERSION):