Kea HA hot-standby mode - standby peer not catching up
I'm testing a Kea HA setup in hot-standby mode, with the following settings:
- Kea 2.0.1 DHCPv4 + control agent.
- Two Kea instances: one "primary" and the other "standby".
- memfile backend with file persistence enabled.
- Lease synchronization enabled in the HA setup.
- The only hooks libraries in use are ha and lease_cmds.
I ran perfdhcp simulating multiple clients against the primary. After a while of sending many requests to the primary, I see that both instances have stored leases, but the standby didn't completely catch up with the primary.
That is, when I inspect the leases on both instances using the lease4-get-all API command, I see that the number of leases did increase on both instances, but the standby has less leases than the primary.
If I manually call the ha-sync API command, or if I restart the standby, or if I reload the configuration in the standby, the standby does a sync and catches up with the primary, and the number of leases becomes equal again. However, if I then run perfdhcp repeatedly, standby eventually starts falling behind again.
Note that, when this happens, if I call the "ha-heartbeat" API command on both instances, they both report an "unsent-update-count" of 0.
A similar thing happens with DHCPv6.
Is this behavior expected? Is it normal for the standby to not catch up with the primary during HA operation, needing manual intervention ("ha-sync", restart or config reload) to catch up?