CORE-5070: moved the index purging to a separate thread