While preparing for a demo for a client I was hit with an interesting error in AlwaysOn Availability Group backup and restore scenario. In my lab setup, I had four nodes SQLAUTH1 to SQLAUTH4 and I have always on high availability turned on SQL Server 2016. I played and did several operations with database and found that I have bloated the transaction log file to 100 GB. And now I need to shrink the transaction log on SQLAUTH1. As soon as I did that, I was welcomed with below message about database cannot be shrunk until all secondaries have moved past the point.
The log for database ‘SQLAuth’ cannot be shrunk until all secondaries have moved past the point where the log was added.
It’s worth mentioning that I did add files in the database so above message is valid. I even took transaction log backup, but no luck. File usage was still shown as 99%.
I looked around at AlwaysOn Dashboard and found that one of the secondary was not getting synchronized. Since it was a lab machine I decided to delete the AG and the thing came back to normal.
But in production, if you can’t afford to delete and reconfigure Always On availability group, then you need to find the cause why secondary is not getting synchronized with primary. In theory, the transaction log files on primary would keep on growing due to secondary not synchronizing with primary. If you find that the data movement is suspended, then you may want to resume it and find the possible cause in the SQL Server ERRORLOG file
One of the possible case I can think of is a change of the service account.
If you are not able to find the cause, feel free to contact me and use my consulting services. As you might know that I have been an independent consultant for a while and one of the services I provide is “On Demand (50 minutes)” service. This service is very helpful for organizations who are in need immediate help with their performance tuning issue. Though, I have set working ours for my regular clients, every single day, I keep two hours available for this offering. This way, I can make sure that anyone who urgently needs my help, can avail the same. Click here to read more about it.
Reference: Pinal Dave (https://blog.sqlauthority.com)