Skip to content

Optimizations to instance list (OC-2122)

Boros Gábor requested to merge optimizations into master

Created by: bradenmacdonald

This implements OC-2122 to improve the usability of the instance manager UI and API.

Major changes:

  1. Before this PR, the /api/v1/instances/ endpoint would require (5 + 10*n) SQL queries to return the instance list when there were n instances. After this PR, that has been reduced to 9 queries regardless of the number of instances. See the new test_instance_list_efficiency() test for how that is verified.
  2. As discussed in the OC-2122 ticket, I have converted the is_shut_down method (which was fairly expensive) to a database field called is_archived. The meaning of archived is meant to be more clear as well: an archived instance is no longer meant to be online, and all associated resources should be freed, but its data and history should be preserved.
  3. When clicking on an AppServer in the UI, the logs will now not be loaded unless you open the panel that contains the AppServer logs. In addition, the "Status" panel is now expanded by default.

screen shot 2017-03-10 at 10 27 26 pm

Minor changes:

  1. I had an AppServer on my vagrant instance where the VM was terminated but the AppServer was stuck in ConfiguringServer. When I called terminate_vm() on it, I was surprised that nothing happened - so I fixed that method to update the AppServer status appropriately.
  2. The UI did not show whether or not RabbitMQ was provisioned for an instance, as it does for MySQL, MongoDB, and Swift. Now it shows the RabbitMQ provisioning status too.

Notes:

Since is_archived is now a database field and is_shut_down() has been deleted, the data migration uses a heuristic technique to fill in is_archived values which may not perfectly match the old behavior of is_shut_down(). As a result, it's possible there are some corner cases where instances that were previously shown as shut down do not appear as archived or vice versa. I do not anticipate that being a significant problem though.

Merge request reports