← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1131594] Re: instance_info_cache_update bug if not found

 

** Changed in: nova
       Status: Fix Committed => Fix Released

-- 
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/1131594

Title:
  instance_info_cache_update bug if not found

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  instance_info_cache_update() in sqlalchemy/api will create an entry if
  it is found not to exist.  However, it creates a very minimal entry
  and drops potential data that should be added.

          info_cache = model_query(context, models.InstanceInfoCache,
                                   session=session).\
                           filter_by(instance_uuid=instance_uuid).\
                           first()

          if info_cache and not info_cache['deleted']:
              # NOTE(tr3buchet): let's leave it alone if it's already deleted
              info_cache.update(values)
          else:
              # NOTE(tr3buchet): just in case someone blows away an instance's
              #                  cache entry            
              info_cache = models.InstanceInfoCache()
              info_cache.update({'instance_uuid': instance_uuid})

  This should be something more like:

    info_cache = model_query(...)
    if info_cache:
        if info_cache['deleted']:
            return
        info_cache.update(values)
    else:
       info_cache = models.InstanceInfoCache()
       values['instance_uuid'] = instance_uuid
       info_cache.update(values)

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1131594/+subscriptions