check attachment_specs may lead to poor performance

Bug #1976331 reported by hanchl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
In Progress
Wishlist
Unassigned

Bug Description

In this change I3be3c99f9317726fa3182f750b27690da3cdab83, we added volume_attachment to the expected attributes. In change Ica1f0e06adf0afcf740aad8cdc8d133ada1760c8, we replaced the storage method of the attachment information in the database.However when the "list volume detail" is modified in this way, the data migration check must be performed when the mounted volume OVO, which seriously affects the performance of the list.I tried to do a performance analysis in my environment, and it took about 40s for 1700 mounted volume queries.
Total time: 38.3067 s
File: /var/lib/openstack/lib/python3.8/site-packages/cinder/objects/volume_attachment.py
Function: _from_db_object at line 80

   Line # Hits Time Per Hit % Time Line Contents
   ==============================================================
   120 1726 38725465.0 22436.5 96.4 connector = db.attachment_specs_get(context, attachment.id)
   121 1726 6331.0 3.7 0.0 if connector:
   122 # Update ourselves and delete the attachment_specs.
   123 attachment.connector = connector
   124 attachment.save()
   125 # TODO(mriedem): Really need a delete-all method for this.
   126 for spec_key in connector:
   127 db.attachment_specs_delete(
   128 context, attachment.id, spec_key)
   129

tags: added: attachment objects
Changed in cinder:
importance: Undecided → Wishlist
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/cinder/+/844822

Changed in cinder:
status: New → In Progress
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.