fix infinite loop by randomkey if the slave only has expired key.