HA related changes

This contains sort of changes that are needed to support HA. By default HA should be disabled and should not have any impact on users not using it.
It was @awsiv commit changing this (5c462d1). I haven't noticed this. Thanks for pointing out.