Error 9003 Log Scan is Invalid Error When Restoring Transaction Log After Applying SP2
We are using SQL 2016 Enterprise Edition and have recently applied SP2 + CU8. We were previously on SP1 + CU6. Since the update we are getting the following error when restoring transaction logs on our DR server. The transaction logs were taken on the secondary server of an AlwaysOn Availability Group.
The log scan number (20913:512:1) passed to log scan in database '' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
The log restore succeeds if NORECOVERY is used and then later logs are applied successfully with STANDBY. But if the file that causes the error is applied with STANDBY future log restores fail when using either NORECOVERY or STANDBY. Performing a Restore Log With RECOVERY also gives the error. The only fix we have found is to do a full restore.
Uninstalling CU8 does not fix the issue. Taking the backups on the Primary server does appear to be a workaround but we would ideally like to take reliable log backups on the Secondary server.