Comment 6 for bug 1538011

Revision history for this message
Sean Dague (sdague) wrote : Re: Aggregate metadata keys are not case sensitive

The root cause of this is https://github.com/openstack/nova/blob/a37590c21bca175f642792b6707d2eb4e6349e51/nova/db/sqlalchemy/api.py#L5674

The issue is that _in is case insensitive for mysql, which means that in:

                    query = query.filter(
                        models.AggregateMetadata.key.in_(all_keys))
                    for meta_ref in query.all():
                        key = meta_ref.key
                        meta_ref.update({"value": metadata[key]})
                        already_existing_keys.add(key)

The all_keys is 'ABC' , but matches the existing 'abc'.

We probably just need an 'if key in metadata:' before the meta_ref.update