[openstack-dev] [heat] How to avoid property revalidation?
shardy at redhat.com
Sun Jun 15 09:40:14 UTC 2014
So, I stumbled accross an issue while fixing up some tests, which is that
AFAICS since Icehouse we continually revalidate every property every time
they are accessed:
This means that, for example, we revalidate every property every time an
event is created:
And obviously also every time the property is accessed in the code
implementing whatever action we're handling, and potentially also before
the action (e.g the explicit validate before create/update).
This repeated revalidation seems like it could get very expensive - for
example there are several resources (Instance/Server resources in
particular) which validate against glance via a custom constraint, so we're
probably doing at least 6 calls to glance validating the image every
create. My suspicion is this is one of the reasons for the performance
regression observed in bug #1324102.
I've been experimenting with some code which implements local caching of
the validated properties, but according to the tests this introduces some
problems where the cached value doesn't always match what is expected,
still investigating why but I guess it's updates where we need to
re-resolve what is cached during the update.
Does anyone (and in particular Zane and Thomas who I know have deep
experience in this area) have any ideas on what strategy we might employ to
reduce this revalidation overhead?
More information about the OpenStack-dev