VolumeManager._sync_provider_info updates wrong snapshot

Bug #1575579 reported by Robin Neatherway
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Pallavi

Bug Description

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.

Tags: bugsmash
affects: openstack-manuals → cinder
lei zhang (zhang-lei)
Changed in cinder:
assignee: nobody → lei zhang (zhang-lei)
assignee: lei zhang (zhang-lei) → nobody
Pallavi (pallavi-s)
Changed in cinder:
assignee: nobody → Pallavi (pallavi-s)
Changed in cinder:
importance: Undecided → Low
Eric Harney (eharney)
Changed in cinder:
importance: Low → Medium
Jay Bryant (jsbryant)
tags: added: bugsmash
Revision history for this message
wangxiyuan (wangxiyuan) wrote :

seems https://review.openstack.org/#/c/317728/ has fixed this bug already.

Revision history for this message
TommyLike (hu-husheng) wrote :

wangxiyuan: +1!

Changed in cinder:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.