Log truncation on primary held with AVAILABILITY_REPLICA after seeding a database to Azure SQL MI via Managed Instance link

Abimbola Adeniran 106 Reputation points
2026-11-21T17:31:23.1833333+00:00

Situation

We migrated a ~3TB CDC-enabled database from SQL2016AG to a new SQL Server 2022 (16.0.4325.4) two-node Always On AG in FULL recovery. Had some issues with cdc post cutover but had to recreate the the jobs using EXEC sys.sp_cdc_add_job and kicked it off which went well.

We then had to link the database to an Azure SQL Managed Instance with the Managed Instance link (offload reporting workloads). Seeding took about 2 hours (had to use TF12381 at runtime and disabled it after). The link shows CONNECTED, HEALTHY, replication delay 0 and LinkSynchronizing, with no recent error.

On the SQL2022 AG primary, log_reuse_wait_desc has been AVAILABILITY_REPLICA for several hours. Log backups are running, but the log isn’t being reused and the file keeps growing.

What I’ve checked in sys.dm_hadr_database_replica_states:

  • All three replica rows (the MI and both local nodes) are SYNCHRONIZED or SYNCHRONIZING and HEALTHY.
  • last_hardened_lsn is identical on all three, and log_send_queue_size is 0.

The MI has been running its built-in automated full backup (FullBackupService) since seeding. It is at about 42% after 3 hours. Nothing is blocked on the MI.

Questions:

  1. Can the MI’s automated initial full backup hold back the primary’s log truncation through the link, and is AVAILABILITY_REPLICA the expected wait while it runs?
  2. What else should I be looking at or try? I have looked online for everything and honestly there isnt anything else that comes to mind.
SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories

0 comments No comments

1 answer

Sort by: Newest
  1. Erland Sommarskog 137.9K Reputation points MVP Volunteer Moderator
    2026-11-21T18:10:48.21+00:00

    The documentation says about AVAILABILITY_REPLICA:

    An Always On Availability Groups secondary replica is applying transaction log records of this database to a corresponding secondary database.

    I don't really see why the full backup would not permit log records from being applied. Then again, if I have it right, the log on the secondary cannot be truncated while the backup is running, so may be this is the problem. In any case, I would let that initial backup complete before I sound any alarm.

    If the log space is released when the full backup has completed, you could try to shrink the log. However, this is will not be the last full backup taken on the MI, so it may be that because you have a new situation, you will need a bigger transaction log than before.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.