Extend HA hooks library to synchronize leases by chunks, i.e. multiple fetches of leases
One of the major use cases for the lease_cmds hooks library is to provide a way to synchronize leases between HA enabled servers. Currently the HA hooks library will fetch the entire lease database which requires the lease_cmds hooks library to create a JSON structure of the whole lease database. This eats the CPU and memory. In case of large number of leases in the database it may freeze the server for a long period of time.
In order to mitigate this issue the lease_cmds hooks librart must support fetching limited number of leases, e.g. 1000, 2000 leases etc. The controlling client should be able to specify last fetched leases with the limit and the server should return leases with addresses beyond this last fetched address. That way, the entire lease database may be returned in chunks with client specifying the start of the next chunk.
This ticket is about extending the HA hooks library to utilize this mechanism implemented with #5651 in the lease_cmds.