See code at https://git.openstack.org/cgit/openstack/cinder/tree/cinder/volume/manager.py#n379
update = ([updt for updt in snapshot_updates if updt['id'] == snap['id']][0])
if update:
self.db.snapshot_update(ctxt,
updt['id'],
{'provider_id': updt['provider_id']})
The list comprehension filters snapshot_updates, but keeps only the first element. The subsequent call to snapshot_update uses the iteration variable updt, which will be the *last* element. updt should almost certainly be replace with update. In addition, it seems likely that taking only the first such snapshot might be a mistake, which could be fixed by removing the '[0]'. Note that the bug will be masked whenever there is only one snapshot_update with a matching id.
seems https:/ /review. openstack. org/#/c/ 317728/ has fixed this bug already.