yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #11629
[Bug 1277393] Re: unable to transform an old object into a new one with changed types of fields
I don't think upgrading an object makes any sense. Objects within the
same major version need to be backwards compatible, so sending an object
with a field format change to an older node (or a newer one that can't
cope with it) is not reasonable.
** Changed in: nova
Status: New => Invalid
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1277393
Title:
unable to transform an old object into a new one with changed types of
fields
Status in OpenStack Compute (Nova):
Invalid
Bug description:
Object Model considers the downgrade but some work in upgrade part are left, so it is unable to transform an old object into a new one with changed types of fields.
This problem is related to https://review.openstack.org/#/c/67693/
Metrics is a string field in computeNode before version 1.3. And we
make it to be an object field. Then the problem is when the old node
still sends a string-based set of metrics, it will throw a exception
in obj_from_primitive due to the type changes.
AUDIT [nova.service] Starting conductor node (version 2014.1)
}}}
Traceback (most recent call last):
File "nova/tests/objects/test_compute_node.py", line 165, in test_metrics_compat_upgrade
compute = base.NovaObject.obj_from_primitive(primitive)
File "nova/objects/base.py", line 246, in obj_from_primitive
objdata[name]))
File "nova/objects/fields.py", line 183, in from_primitive
return self._type.from_primitive(obj, attr, value)
File "nova/objects/fields.py", line 374, in from_primitive
return obj_base.NovaObject.obj_from_primitive(value, obj._context)
File "nova/objects/base.py", line 230, in obj_from_primitive
if primitive['nova_object.namespace'] != 'nova':
TypeError: string indices must be integers, not str
The reason is in version 1.2, the primitive of metrics in compute node is str
'[{"timestamp": "2014-02-07T08:12:16Z", "name": "cpu.frequency", "value": 1600.0, "source": "libvirt.LibvirtDriver"}]'
But it should be an object after version 1.3.
The easiest way to reappear the bug is downloading the patch https://review.openstack.org/#/c/67693/ and run
python -m unittest nova.tests.objects.test_compute_node.TestRemoteComputeNodeObject.test_metrics_compat_upgrade
The test case transforms a new compute_node object into an old one and
then transforms it into a new one again.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1277393/+subscriptions
References