Cleanup Liberty to Mitaka upgrade corner cases not necessary anymore
This corner case was handled to consider the version of non reporting agents which could have the qos extension enabled. It's not necessary anymore and has been therefore removed. The devref details have been updated to present tense, as they should be. Change-Id: Ie40d3f34a46950f5124cf8ef7f486d90513271f4
This commit is contained in:
parent
36a3e127c0
commit
884b73595c
@ -86,8 +86,8 @@ upgrade the server first and then upgrade the agents:
|
|||||||
|
|
||||||
:doc:`More information about the upgrade strategy <upgrade>`.
|
:doc:`More information about the upgrade strategy <upgrade>`.
|
||||||
|
|
||||||
The plan is to provide a semi-automatic method which avoids manual pinning and
|
We provide an automatic method which avoids manual pinning and unpinning
|
||||||
unpinning of versions by the administrator which could be prone to error.
|
of versions by the administrator which could be prone to error.
|
||||||
|
|
||||||
Resource pull requests
|
Resource pull requests
|
||||||
~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~
|
||||||
@ -120,33 +120,35 @@ want the queues cleaned up.
|
|||||||
|
|
||||||
Leveraging agent state reports for object version discovery
|
Leveraging agent state reports for object version discovery
|
||||||
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
We would add a row to the agent db for tracking agent known objects and version
|
We add a row to the agent db for tracking agent known objects and version
|
||||||
numbers. This would resemble the implementation of the configuration column.
|
numbers. This resembles the implementation of the configuration column.
|
||||||
|
|
||||||
Agents would report at start not only their configuration now, but also
|
Agents report at start not only their configuration now, but also
|
||||||
their subscribed object type / version pairs, that would be stored in the
|
their subscribed object type / version pairs, that are stored in the
|
||||||
database and would be available to any neutron-server requesting it::
|
database and made available to any neutron-server requesting it::
|
||||||
|
|
||||||
'subscribed_versions': {'QoSPolicy': '1.1',
|
'resource_versions': {'QosPolicy': '1.1',
|
||||||
'SecurityGroup': '1.0',
|
'SecurityGroup': '1.0',
|
||||||
'Port': '1.0'}
|
'Port': '1.0'}
|
||||||
|
|
||||||
There's a subset of Liberty agents depending on QoSPolicy that will
|
There was a subset of Liberty agents depending on QosPolicy that required
|
||||||
require 'QoSPolicy': '1.0' if the qos plugin is installed. We will be able
|
'QosPolicy': '1.0' if the qos plugin is installed. We were able to identify
|
||||||
to identify those by the binary name (included in the report):
|
those by the binary name (included in the report):
|
||||||
|
|
||||||
* 'neutron-openvswitch-agent'
|
* 'neutron-openvswitch-agent'
|
||||||
* 'neutron-sriov-nic-agent'
|
* 'neutron-sriov-nic-agent'
|
||||||
|
|
||||||
|
This transition was handled in the Mitaka version, but it's not handled
|
||||||
|
anymore in Newton, since only one major version step upgrades are supported.
|
||||||
|
|
||||||
Version discovery
|
Version discovery
|
||||||
+++++++++++++++++
|
+++++++++++++++++
|
||||||
With the above mechanism in place and considering the exception of
|
With the above mechanism in place and considering the exception of
|
||||||
neutron-openvswitch-agent and neutron-sriov-agent requiring QoSpolicy 1.0,
|
neutron-openvswitch-agent and neutron-sriov-agent requiring QoSpolicy 1.0,
|
||||||
we could discover the subset of versions to be sent on every push
|
we discover the subset of versions to be sent on every push notification.
|
||||||
notification.
|
|
||||||
|
|
||||||
Agents that are in down state would be excluded from this calculation.
|
Agents that are in down state are excluded from this calculation.
|
||||||
We would use an extended timeout for agents in this calculation to make sure
|
We use an extended timeout for agents in this calculation to make sure
|
||||||
we're on the safe side, specially if deployer marked agents with low
|
we're on the safe side, specially if deployer marked agents with low
|
||||||
timeouts.
|
timeouts.
|
||||||
|
|
||||||
@ -165,16 +167,16 @@ The AgentDbMixin provides::
|
|||||||
|
|
||||||
Caching mechanism
|
Caching mechanism
|
||||||
'''''''''''''''''
|
'''''''''''''''''
|
||||||
The version subset per object will be cached to avoid DB requests on every push
|
The version subset per object is cached to avoid DB requests on every push
|
||||||
given that we assume that all old agents are already registered at the time of
|
given that we assume that all old agents are already registered at the time of
|
||||||
upgrade.
|
upgrade.
|
||||||
|
|
||||||
Cached subset will be re-evaluated (to cut down the version sets as agents
|
Cached subset is re-evaluated (to cut down the version sets as agents
|
||||||
upgrade) after configured TTL.
|
upgrade) after neutron.api.rpc.callbacks.version_manager.VERSIONS_TTL.
|
||||||
|
|
||||||
As a fast path to update this cache on all neutron-servers when upgraded agents
|
As a fast path to update this cache on all neutron-servers when upgraded agents
|
||||||
come up (or old agents revive after a long timeout or even a downgrade) the
|
come up (or old agents revive after a long timeout or even a downgrade) the
|
||||||
server registering the new status update will notify the other servers about
|
server registering the new status update notifies the other servers about
|
||||||
the new consumer resource versions via cast.
|
the new consumer resource versions via cast.
|
||||||
|
|
||||||
All notifications for all calculated version sets must be sent, as non-upgraded
|
All notifications for all calculated version sets must be sent, as non-upgraded
|
||||||
|
@ -15,7 +15,6 @@ import copy
|
|||||||
import pprint
|
import pprint
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from neutron_lib import constants
|
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import importutils
|
from oslo_utils import importutils
|
||||||
|
|
||||||
@ -26,14 +25,6 @@ LOG = logging.getLogger(__name__)
|
|||||||
|
|
||||||
VERSIONS_TTL = 60
|
VERSIONS_TTL = 60
|
||||||
|
|
||||||
# This is the list of agents that started using this rpc push/pull mechanism
|
|
||||||
# for versioned objects, but at that time stable/liberty, they were not
|
|
||||||
# reporting versions, so we need to assume they need QosPolicy 1.0
|
|
||||||
#TODO(mangelajo): Remove this logic in Newton, since those agents will be
|
|
||||||
# already reporting From N to O
|
|
||||||
NON_REPORTING_AGENT_TYPES = [constants.AGENT_TYPE_OVS,
|
|
||||||
constants.AGENT_TYPE_NIC_SWITCH]
|
|
||||||
|
|
||||||
|
|
||||||
# NOTE(mangelajo): if we import this globally we end up with a (very
|
# NOTE(mangelajo): if we import this globally we end up with a (very
|
||||||
# long) circular dependency, this can be fixed if we
|
# long) circular dependency, this can be fixed if we
|
||||||
@ -157,14 +148,6 @@ class ResourceConsumerTracker(object):
|
|||||||
|
|
||||||
def _handle_no_set_versions(self, consumer):
|
def _handle_no_set_versions(self, consumer):
|
||||||
"""Handle consumers reporting no versions."""
|
"""Handle consumers reporting no versions."""
|
||||||
if isinstance(consumer, AgentConsumer):
|
|
||||||
if consumer.agent_type in NON_REPORTING_AGENT_TYPES:
|
|
||||||
resources = _import_resources()
|
|
||||||
self._versions_by_consumer[consumer] = {
|
|
||||||
resources.QOS_POLICY: '1.0'}
|
|
||||||
self._versions[resources.QOS_POLICY].add('1.0')
|
|
||||||
return
|
|
||||||
|
|
||||||
if self._versions_by_consumer[consumer]:
|
if self._versions_by_consumer[consumer]:
|
||||||
self._needs_recalculation = True
|
self._needs_recalculation = True
|
||||||
self._versions_by_consumer[consumer] = {}
|
self._versions_by_consumer[consumer] = {}
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import collections
|
|
||||||
import mock
|
import mock
|
||||||
|
|
||||||
from neutron.api.rpc.callbacks import exceptions
|
from neutron.api.rpc.callbacks import exceptions
|
||||||
@ -85,26 +84,6 @@ class ResourceConsumerTrackerTest(base.BaseTestCase):
|
|||||||
self.assertEqual(set(),
|
self.assertEqual(set(),
|
||||||
cv.get_resource_versions(resource_type))
|
cv.get_resource_versions(resource_type))
|
||||||
|
|
||||||
def test_compatibility_liberty_sriov_and_ovs_agents(self):
|
|
||||||
|
|
||||||
def _fake_local_versions(self):
|
|
||||||
local_versions = collections.defaultdict(set)
|
|
||||||
local_versions[resources.QOS_POLICY].add('1.11')
|
|
||||||
return local_versions
|
|
||||||
|
|
||||||
for agent_type in version_manager.NON_REPORTING_AGENT_TYPES:
|
|
||||||
consumer_id = version_manager.AgentConsumer(agent_type,
|
|
||||||
AGENT_HOST_1)
|
|
||||||
|
|
||||||
cv = version_manager.ResourceConsumerTracker()
|
|
||||||
cv._get_local_resource_versions = _fake_local_versions
|
|
||||||
cv._versions = _fake_local_versions(mock.ANY)
|
|
||||||
|
|
||||||
cv.set_versions(consumer_id, {})
|
|
||||||
|
|
||||||
self.assertEqual(set(['1.0', '1.11']),
|
|
||||||
cv.get_resource_versions(resources.QOS_POLICY))
|
|
||||||
|
|
||||||
def test_different_adds_triggers_recalculation(self):
|
def test_different_adds_triggers_recalculation(self):
|
||||||
cv = version_manager.ResourceConsumerTracker()
|
cv = version_manager.ResourceConsumerTracker()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user