Create a generic way to cleanup ClickHouse data.
Summary
Extracted from #451481 (comment 1862130604) we need a way to cleanup clickhouse data in many tables when corresponding model in Postgres is deleted. E.g. if a project is deleted we should delete data in clickhouse for any data where project_id = deleted_project
.
As @ahegyi mentioned here there are some complications in the process so we need to think about it thoroughly.
Currently we use custom background workers for each separate clickhouse table. E.g. https://gitlab.com/gitlab-org/gitlab/-/tree/master/ee/app/workers/click_house/event_authors_consistency_cron_worker.rb