locked
Database cleanup & orphan test results RRS feed

  • Question

  • Hi

    I'm using TFS2013.2 and I'm having a small database size collection.

    my main collection size is 210GB (with 23GB of unused allocated by the SQL automatically).

    i have already used the test attachment cleaner and followed all the posts about this issue so I'm pretty sure that

    the configuration is correct.

    i have also removed the code sense index as it was causing size problems.

    i have also clean old and unused workspaces.

    and still the size is around the 200GB.

    running the table size report

    we see that there is 90GB of content (nothing can be done here..)

    and also 43GB of test results....

    this is after i saw the build retention policy does not include test results.

    i queried the tbl_testrun table to get a list of old build Uris (about 3.5K of builds) i tried via command line and got time out

    so i wrote a small code with tfs api. i got about 500 errors about invalid build uri.

    i double checked and it was not found in the tbl_build. but there were references int he tbl_testrun with records in tbl_testrsult.

    i wish to remove this historical test data as it is taking a lot of space, how can i perform this?

    how can i remove these orphan test results?

    also how can i increase tfs timeout?

    thank you

    Saturday, November 8, 2014 7:57 PM

All replies

  • Hi Liran,

    Thanks for your post.

    I'd like to confirm with you have you destroyed the test results that you don't need any more? Just to be noticed, you need to destroy the files you don't need, not delete them. Because deleting the file will not physically delete it from database, to completely delete the file, you have to destroy it.

    Also, you need to include "/startcleanup" in the destroy command. As this argument will force the file content clean-up process to start immediately after destroying the file. Then checking the database size again.

    Useful blogs for your reference:

    http://social.technet.microsoft.com/wiki/contents/articles/19932.reduce-the-size-of-tfs-databases-after-cleaning-some-source-control-files.aspx

    http://gyorgybalassy.wordpress.com/2014/04/02/cleaning-up-and-reduce-the-size-of-the-tfs-database/

    http://b4root.com/2014/03/11/finding-and-reducing-tfs-database-size/


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, November 10, 2014 9:06 AM
  • I don't quite follow you.

    i am unfamiliar with the option to destroy test result, i do know that u can destroy Source items / work items / builds . but not test results.

    i have used the test attachment cleaner and event set the testrun segment to delete older then 7 days.

    but the log returns that there are not such test runs.

    so i queried the tbl_testresult in the tfs_defaultcollection, and crossed it with tbl_testruns.

    from this i got build Uris. as i said before i managed to delete the builds (deleted builds) test results.

    but some build don't exist anymore even though they have test results,

    so is there any other way to remove test results?

    Tuesday, November 11, 2014 7:24 AM
  • The OP is talking about orphaned test data he's identified and wants to remove from TFS, not versioned files of which are hidden via GUI "delete" and not destroyed permanently unless destroyed via 'tf destroy'.  Different topic altogether.

    It sounds like he's done his research which is why he's likely posted here for a solution.  Ironically I have the same issue within our TFS environment as after TFS 2013.2 db sizes increased signficantly due to bug in new code lens functionality.  Then read all the various posts on how to disable code lens scanning, remove data from TFS db's, etc. but db's are still huge when for all purposes the should be 1/2 their size.

    Tuesday, November 11, 2014 3:37 PM
  • Hi,

    Sorry for misunderstanding. I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 12, 2014 2:06 AM
  • Hi Liran,

    The above screenshot you offered shows that the dbo_Content and dbo.tbl_TestResult tables have very big size. As we know that the dbo_Content table store versioned files, while the dbo.tbl_TestResult table stores test results, so you need to check both sides.

    For dbo_Content table, please try cleaning up some old workspaces or old branches. Please also check this blog: https://mgrowan.wordpress.com/2014/04/02/need-help-tfs-tbl_content-table-and-database-growth-out-of-control/

    For cleaning up the dbo.tbl_TestResult table, please check the build's retention policies and make sure you're not keeping too much old data. See OsirisTerje's answer in this case for the detailed information: https://social.msdn.microsoft.com/Forums/vstudio/en-US/188cf534-d928-46b0-afa4-0b1192714d24/tfs-2010-database-growing-too-fast?forum=tfsgeneral

    Also try deleting unless test runs from MTM. In the Testing Center, choose Test, and then choose Analyze Test Runs, select the run you want to delete and choose the red Delete test run icon.

    The following blog which is about running test attachment cleanup should also be helpful to you: http://geekswithblogs.net/terje/archive/2011/11/15/guide-to-reduce-tfs-database-growth-using-the-test-attachment.aspx  

    Thanks.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 12, 2014 3:39 AM
    Moderator
  • Hi

    i have already done these actions.

    • Deleting old workspace
    • updated relevant build retention policies
    • cleaned up old test result from the MTM
    • i have a scheduled task running every week that uses test attachment cleaner

    the original Test result size was 48GB, after running the action it shrunk to 43Gb.

    which is why i posted the question.

    Wednesday, November 12, 2014 7:56 AM
  • Hi Liran,

    did you ever work this out ? We are seeing the same issue, we have 50000 Test runs in various states and have no idea what the best way is to clean them up.

    Nico

    Tuesday, January 3, 2017 2:50 PM