Admin context is required to delete a temporary volume from DB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Undecided
|
Masaki Kanno |
Bug Description
Non-disruptive backup creates a temporary volume.
Information of the volume is deleted from DB if the volume cannot be
created. [1]
Admin context is necessary to delete the information. [2]
However, the context that is used to delete the information is not
admin context. We must elevate the context to admin context.
cinder/
1223 def _create_
1224 temp_volume = {
1225 'size': volume['size'],
1226 'display_name': 'backup-vol-%s' % volume['id'],
1227 'host': volume['host'],
1228 'user_id': context.user_id,
1229 'project_id': context.project_id,
1230 'status': 'creating',
1231 }
1232 temp_vol_ref = self.db.
1233 try:
1234 self.create_
1235 except Exception:
1236 with excutils.
1237 self.db.
1238
1239 self.db.
1240 {'status': 'available'})
1241 return temp_vol_ref
1242
cinder/
1228 @require_
1229 @_retry_on_deadlock
1230 def volume_
1231 session = get_session()
1232 now = timeutils.utcnow()
1233 with session.begin():
1234 model_query(
1235 filter_
1236 update({'status': 'deleted',
1237 'deleted': True,
1238 'deleted_at': now,
1239 'updated_at': literal_
1240 'migration_status': None})
<<snip>>
Changed in cinder: | |
assignee: | nobody → Masaki Kanno (kanno-masaki) |
Changed in cinder: | |
status: | Fix Committed → Fix Released |
Fix proposed to branch: master /review. openstack. org/230792
Review: https:/