2

Does the delete shelveset operation reclaim space used by the changeset in tfs database?

I don't want to know the details, just want to know - will the space be reclaimed, or the database will grow, if i create and delete many big shelvesets?

George Polevoy
  • 7,450
  • 3
  • 36
  • 61

2 Answers2

1

Shelvesets are essentially uncommitted pending changes with a special flag set that identifies them as a shelveset rather than a normal workspace.

When you delete a shelveset, the pending changes are undone and the content is flagged for removal.

If the shelveset is quite large and you were hoping to free up disk space on your server, you should know that the space won't immediately be released back to SQL, but it will eventually be. At a high-level, the following things have to happen:

  • TFS has a built-in job (Version Control Administration Job) that runs nighlty and clears up destroyed content.
  • There is another job (Optimize Databases) which will reorganize/rebuild SQL indexes
  • SQL will also need to run it's "ghost cleanup" process to release the pages
  • Unless you shrink the SQL data files, SQL will retain the space as 'free pages' and not return it to the operating system.
granth
  • 8,919
  • 1
  • 43
  • 60
0

The spaced used by the shelveset will be reclaimed when deleted. Shelvesets are like workspaces on the server and when you delete the shelveset the corresponding rows are deleted.

Ed Hintz
  • 864
  • 6
  • 7