TFS2017 When the old builds/releases are purged

2019-07-29 17:15发布

问题:

We started one month ago to heavily use the Release Management part of TFS and I noticed that the collection's database size is increasing with an accelerate rate.

In order to stabilize the database size growth we're adjusting the retention policies of the release definitions.

Do you know when the purging process of the deleted builds/releases is occurring? Can be manually triggered?

TFS v15.117.26714.0

回答1:

Update 11/03

When you change the Permanently Destroy Releases in Retention Policy Settings page, after save changes, it will prompt:

Changes to the settings will be effective only for the new Release Definitions and Environments created after the save.

So it will not influence your old deleted release, afraid the old deleted release will keep 30 days(default setting) when it created. You may have to wait.


Update

When you delete a build through the retention policy, however this is only a logical delete and the records remain in the database but are flagged with a delete flag.

The Destroy command will physically delete the build from the system, it will be completely gone and all records will be removed from the DB.

TFS will not recover the space straight away, which is deleted later by a job ran by the TFS Background Job Agent. The TFSJob Agent will recover the space during its normal running process so you may not see the space recovered for 24 hrs +.

If you don’t want to wait that much, you can run tf destroy with the /startcleanup switch which immediately kicks off the cleanup job.


When are builds deleted

TFS: Your retention policies run every day at 3:00 A.M. UTC. There is no option to change this process.

Source Link

It's not able to manually trigger the purging process of the deleted builds/releases in TFS for now.

Note builds that are deployed as part of releases are also governed by the release retention policy. The build linked to a release has its own retention policy, which may be shorter than that of the release.

If you want to retain the build for the same period as the release, set the Retain build checkbox for the appropriate environments. This overrides the retention policy for the build, and ensures that the artifacts are available if you need to redeploy that release.

When you delete a release definition, delete a release, or when the retention policy deletes a release automatically, the retention policy for the associated build will determine when that build is deleted.