← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1218259] Re: Volume snapshots table makes 2N+1 volume_get requests

 

** Changed in: horizon
       Status: Fix Committed => Fix Released

** Changed in: horizon
    Milestone: None => havana-rc1

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1218259

Title:
  Volume snapshots table makes 2N+1 volume_get requests

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  The volume snapshots table has a column that shows the associated
  volume name and links to its volume detail page. This calls volume_get
  twice for each snapshot, so loading the Images & Snapshots page takes
  forever if you have a decent number of snapshots.

  class SnapshotVolumeNameColumn(tables.Column):
      def get_raw_data(self, snapshot):
          request = self.table.request
          volume_name = api.cinder.volume_get(request,
                                              snapshot.volume_id).display_name
          return safestring.mark_safe(volume_name)

      def get_link_url(self, snapshot):
          volume_id = api.cinder.volume_get(self.table.request,
                                            snapshot.volume_id).id
          return reverse(self.link, args=(volume_id,))

  https://github.com/openstack/horizon/blob/d45413e9bfc5c0730ce10daa4251cfbff086f3b4/openstack_dashboard/dashboards/project/images_and_snapshots/volume_snapshots/tables.py#L71

  We should be calling volume_list once in the view and associating the
  snapshot with the volume there.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1218259/+subscriptions