SQL Server – Is Tlog Backup on Replica Clearing VLFs on Primary?

availability-groupsbackupsql-server-2012transaction-log

Is it true that a transaction log backup made on the secondary database is clearing the inactive VLFs on the tlog file on the primary database (in case of Availability Groups)?

I was not able to find an official documentation/statement/article that confirms this. This is the most detailed article I have found, but the next parts that are concerning this aspect are missing.

Best Answer

Thomas Stringer has answered a very similar question at:

Transaction Log Maintanance While Using AlwaysOn Availability Group

The answer is that the Availability Group replicas are aware of each other and when either the primary or secondary does a backup, both logs are able to free log space.

The article you referenced also offers the explanation that Log Blocks, not the VLFs, are what get hardened between the Primary and Secondary media. A VLF can contain several log blocks and this will influence when the space can be recovered.