cinder-volume can't be inited with large number of volume

Bug #1681374 reported by wangxiyuan
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Serhii Rusin

Bug Description

the initialization of cinder-volume process has a performance issue when there a large number of volume in the backend.

With our production test, if there are one hundred thousand volumes in one backend, it will cost more than 4G memory during the process initialization. And the process will be always down because of the timeout.

We fount that the problem may be happened here:
https://github.com/openstack/cinder/blob/master/cinder/volume/manager.py#L446-L475

It firstly get all the volumes from the db, and then calculate and check them one by one.

Is it possible taht we can calculate it with the SQL command at one step to avoid memory occupancy.
Then make the "ensure_export" action be an asynchronous operation to avoid blocking the process?

Changed in cinder:
importance: Undecided → Medium
status: New → Confirmed
Changed in cinder:
assignee: nobody → Dinesh Bhor (dinesh-bhor)
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote :

Dinesh, are you still working on this? Any ideas for a solution.

Revision history for this message
Dinesh Bhor (dinesh-bhor) wrote :

Hi Sean and all,

I was working on this but wasn't successful in reproducing this on my environment(which is IMO not enough for this bug). Removing myself from assignee. Please feel free to assign it to yourself.

Changed in cinder:
assignee: Dinesh Bhor (dinesh-bhor) → nobody
Changed in cinder:
assignee: nobody → Serhii Rusin (serhii-rusin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/627634

Changed in cinder:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by Serhii Rusin (<email address hidden>) on branch: master
Review: https://review.openstack.org/627634
Reason: false related changes

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/627636

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.openstack.org/629516

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (stable/rocky)

Change abandoned by Sean McGinnis (<email address hidden>) on branch: stable/rocky
Review: https://review.openstack.org/629516
Reason: Redo once changes are complete and merged to master.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/627636
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=ed02273d2f242a70be41f73b0909645fd9f987a9
Submitter: Zuul
Branch: master

commit ed02273d2f242a70be41f73b0909645fd9f987a9
Author: Serhii Rusin <email address hidden>
Date: Fri Dec 28 08:32:26 2018 -0500

    Initiating Cinder Volume Manager with large number of volumes

    This patch adds the option to split retrieved volumes and snapshots
    by chunks during Volume Manager host initialization. Query results
    will be obtained in batches from the database and not in one shot
    to avoid extreme memory usage. Max number of volumes and snapshots
    per batch is controlled by option init_host_max_objects_retrieval.
    Option is disabled by default for backward compatibility.

    To migrate any ConfKeyManager keys based on fixed_key to the currently
    configured key manager Volume Manager will use special lightweight
    object - VolumeMigration.

    Change-Id: I53eccc77fdc2c35b27ed430af62dc18e7d1bde69
    Closes-Bug: 1681374

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 14.0.0.0rc1

This issue was fixed in the openstack/cinder 14.0.0.0rc1 release candidate.

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.