Consider SQL Server or Hyperscale SQL DB or any derivative thereof. Consider a source table(s) with 100 million+ rows that will be cached into a target SQL Server database and use BCP to perform the load operation. Consider that the disk TDV is installed on is not large enough to handle all of the BCP files at once. Currently, the cache process will create a tmp file and load it and leave the file on disk until the entire process is complete. This will effectively fill up the disk. It would be better for TDV to clean up tmp files as it goes so that the caching of large tables does not fill up the TDV drive.
If it is more efficient to delete x number of files like say 10 files instead of a file every time then perhaps a new configuration attribute could be added to specify the number of files to process before deleting the previous batch.
Additionally, if a cache processes errors out, it will leave the tmp files orphaned and they never get deleted. When TDV starts up it should clear the tmp files as TDV is at a known state and guaranteed that no caches are in process. Clearing the orphaned tmp files would be safe.