Currently, the range deleter is conceptually responsible for the following:
- Deleting ranges of orphaned documents
- Allowing clients to wait on a specific range to be deleted
Another class, the metadata manager, is responsible for the following:
- Tracking which chunks may still be in use by ongoing queries
- Scheduling orphaned ranges for deletion by the range deleter once they are no longer referenced by any ongoing query
However, the current implementation of the range deleter is tightly coupled with the implementation of the metadata manager and the code structure does not clearly delineate these responsibilities.
This ticket is to create a new interface and implementation of the CollectionRangeDeleter such that it is a single-threaded service which pulls ranges to delete from a task queue. It will reuse existing code from the current range deleter to the extent possible. There will be a separate ticket to plug the new version of the range deleter into the metadata manager and remove the old one.