retry replication when it fails
Merge pull request #4362 from ticoann/replication_retry

retry replication when it fails