Update funnels configurator endpoint to remove any funnels that no longer exist
Problem to solve
With Create new configurator endpoint and migration ... (#438033 - moved) we will have added a new configurator endpoint to store funnel definitions in the Clickhouse database. However, this doesn't include the ability to remove funnel definitions, which means that users can only add or update existing funnel definitions. We should update the endpoint to also remove funnel definitions that no longer exist.
Proposed solution
Update the configurator to use something like ALTER DELETE
to find and remove any funnel definitions that no longer exist.
Clickhouse blog on deleting options within Clickhouse.
Reviewing the above blog, in addition to thinking about how funnels can be inserted/updated/deleted. The simplest approach may be to drop the partition by its type
, in this case funnel
, and then insert all the funnel configurations received by the API. This would mean that we only have to do 2 “light-weight” operations rather than 3 (inserting, updating, and deleting). But it would mean there will be a millisecond timeframe, where a users funnel request would return no results whilst we drop the old partition and insert the new configurations
Implementation plan
TBD