Make the lease/HR lookup order configurable
This is related to support#18476. In this particular deployment there are some pools with high utilization. The deployment uses HA and MySQL. After simulating many test scenarios, we came up with a bottleneck caused by a large number of MySQL queries for non-existent HRs and leases.
The following parameter (alloc_engine.cc:1023 and 4282) could slice the number of queries in half:
// We have the choice in the order checking the lease and // the reservation. The default is to begin by the lease // if the multi-threading is disabled. bool check_reservation_first = MultiThreadingMgr::instance().getMode();
Sadly, it's not configurable at the moment. There is no best choice here. For networks that have high pool utilization and few IP reservations, the lease lookup first strategy is better. For networks that have many IP reservations, the do HR lookup first strategy is better.
As such, this parameter needs to be configurable.