Sql-server – index rebuild job is failing

availability-groupssql serversql server 2014

I am new to DBA job and in my environment index rebuild job is failing and when I checked reason for failure it is showing :

"The transaction log for database 'x' is full due to 'AVAILABILITY_REPLICA'.

We are using SQL Server 2014 with full recovery mode.

Best Answer

It sounds like you are using Availability Groups and either one of your replicas is not syncing correctly, or it is getting so far behind that it is causing the log on your primary to grow until is reaches its maximum size (or you run out of disk).

  • Check that your secondary replica(s) are online and syncing correctly.
  • See if you can increase the max size of your transaction log on the primary
  • Increase the allocated storage on your transaction log drive
  • Rebuild individual indexes with a wait between them to help allow time for log blocks to flush down to your secondary replica(s) (check out Minion Reindex free tool that can help with this)