As we continue to explore the features of Exchange 2013 SP1, let’s take a look at loose truncation. Before we talk about this new feature, let’s go over the behavior of Exchange 2013 without loose truncation.
When one copy of a database that has multiple copies in a DAG goes offline, the other database copies stop log truncation so that they can assist with the resync of the failed copy. This prevents the failed copy from needed to perform a full reseed to get back to the current state when it comes back online. This behavior is fine and dandy if your database volumes have tons of free space and can afford to build up transaction logs for however long it takes you to fix the failed database. If, however, you do not have much in the way of free space or you tend to have database that remain in a failed state for an extended period of time, this behavior will cause more problems than it solves. Thus the introduction of loose truncation.
Loose truncation is a feature of Exchange 2013 Database Availability Groups this is designed to alleviate some of the disk space issues that can occur when one or more copies of a database is offline for an extended period of time. Loose truncation is a setting that tells your DAG members to automatically start truncating transaction log files at a set threshold. Of course this means that if loose truncation does kick in, your failed database will remain in failedandsuspended state until you either manually reseed the database or Autoreseed kicks in.
Enabling loose truncation is a bit of an issue for me. One would expect there to be a PowerShell command, something like Enable-LooseTruncation, to turn this feature on. Unfortunately, this feature was a late addition to SP1 and the accompanying PowerShell command did not make it in. For now you need to activate loose truncation via 3 registry entries located under HKLM\Software\Microsoft\ExchangeServer\v15\BackupInformation
This is the basic key to turn loose truncation on. The default value is 0, meaning loose truncation is active for 0 passive databases. For a two node DAG, you would set this key to one, so as to protect 1 passive database.
This key refers to available disk space in megabytes. The default is 200GB or less free space and loose truncation will trigger. You can set this to any value to meet your specific environmental requirements.
This value defines the amount of logs that will be protected from truncation. On a passive database the number is calculated based on the last available log file.