diff options
author | Boris Pavlovic <boris@pavlovic.me> | 2013-03-04 23:31:20 +0400 |
---|---|---|
committer | Boris Pavlovic <boris@pavlovic.me> | 2013-03-04 23:51:26 +0400 |
commit | be6a2cc1670bb27334609e17f0556529f0cc9462 (patch) | |
tree | 3bdf31e0e9024898dedaadc80c6c854c77bc487f /nova/notifications.py | |
parent | bcdbe9ba881db8b38525bfc44a182e6b210459cd (diff) | |
download | nova-be6a2cc1670bb27334609e17f0556529f0cc9462.tar.gz nova-be6a2cc1670bb27334609e17f0556529f0cc9462.tar.xz nova-be6a2cc1670bb27334609e17f0556529f0cc9462.zip |
Imporove db.sqlalchemy.api._validate_unique_server_name method
This method is called by instance_create and instance_update.
If parameter CONF.osapi_compute_unqiue_server_name_scope is set to
'global' or 'project' then it has terrible performance.
Algorithm was next:
1) Get all instances and all connected data (5 joinloads..) in global
(or project).
2) Compare hostname with hostnames in instances (locally)
Now:
1) Get only count of instances with same hostname in global (or project).
2) If count > 0 raise Exception.
Change-Id: I35ea121c3f906b4fff11c38bafa2ab33200bd6b2
Diffstat (limited to 'nova/notifications.py')
0 files changed, 0 insertions, 0 deletions