Code review comment for ~ack/maas:storage-gpt-default

Revision history for this message
Björn Tillenius (bjornt) wrote :

I looked into the query count problems a bit. There are several problems, but I can't see an easy fix.

What's causing problems in this branch is Partition.get_partition_number(). If it's GPT, it has quite some logic to calculate the partition number.

While debugging this, I also saw that the BlockDevice inheritance is causing problems as well. We have quite a lot of places that do block_device.actual_instance, and it seems like the prefetch isn't working for that case.

One place that is causing a lot of extra queries is Node.get_boot_disk().

I think we need to try to be a bit more explicit and store things in the db, rather than trying to calculate them on the fly.

For this branch, I guess it's not much we can do. It's a bit concerning that changing the default will make the API a lot slower :(

« Back to merge proposal