Skip to content

Odd Error while re-syncing an Availability Group Database

For certain reasons, we had to turn off the cluster service on one of the replicas in our availability group. The cluster service was off for an extended period of time, but once it was restarted, most of the availability databases were able to re-sync. For the ones that did not, I did what I usually do – remove the database from the availability group, run a full backup and a transaction log backup, restore those to the secondary replica WITH NORECOVERY, and rejoin the database to the availability group.

However, we had a few databases that failed to rejoin the availability group, and this is the error we encountered:

The remote copy of database has not been rolled forward to a point in time that is encompassed in the local copy of the database log.

Maybe it is just me, but I think this error is poorly worded. What happened is that before we tried to rejoin the secondary, an additional regularly scheduled log backup has completed on the primary. This is show in the diagram below where Log Backup 2 completes on the primary database before Log Backup 1 is restored on the secondary.

To resolve this, we had to just make sure that we disabled the log backup SQL agent job on the primary, restored Log Backup 2 to the secondary, joined the availability group, and re-enabled the log backups on the primary. So now the timeline looks like this.

To me the actual error statement is unclear. This could be (and probably is) just me. If the error statement stated “Additional log backups need to be restored on the Secondary Availability Replica before this database can be added to the Availability Group” it would be much clearer.

Just my two cents.

Leave a Reply

Your email address will not be published. Required fields are marked *