Why does TFS allow orphaned content and how do I get rid of it?

My TfsVersionControl database has grown to 40 + GB. We recently made a TFS Destroy in a folder tree that should have cleared at least 10 GB, but instead it had no effect.

When I look at tables in TfsVersionControl, I am primarily shocked to see that there are no foreign keys in the database. Running a few queries, I see that orphanhood is happening:

  • tbl_Content has 13.9 GB of records that do not have an associated tbl_File record
  • tbl_File and tbl_Content have 2.4 GB that do not have an associated tbl_Namespace record

The cleanup work seems to be done nightly (prc_DeleteUnusedContent), and running it against the database manually does not remove the orphans. I see in the log for cleaning work that it failed 3/16, which is the morning after I destroyed a large amount of data. The error occurred due to the complete transaction log.

Could this error be the reason that I was left with all these lost screens that cannot be removed? How can I permanently destroy this unnecessary content?

+4
source share
2 answers

After a long break with people at Microsoft, it turns out that this is a known error in the failure of some cleaning processes. There is a knowledge base article here: http://support.microsoft.com/kb/974596

This hotfix is ​​deprecated if you already installed TFS 2010.

In addition, Tech at Microsoft launched a DELETE statement on tbl_Content to delete all entries that do not indicate the actual tbl_File entry. I would publish SQL, but I do not want to be responsible for everyone who copies and pastes. This is pretty explanatory and easy, as you think.

+1
source

See the MSDN Blog Post http://social.msdn.microsoft.com/Forums/en-SG/tfsversioncontrol/thread/5f3f8916-1c6d-46f7-9dae-2cdaeaee98db

As Chandra of the TFS team noted:

This is due to a bug in TFS 2008 - where if the night job failed, it caused this problem. Contact Microsoft Support and they can provide you with a fix. Please do not try to fix this yourself.

+1
source

Source: https://habr.com/ru/post/1304785/


All Articles