Skip to content

Prevent writing multiple funnels with same name

Halil Coban requested to merge do-not-create-multiple-same-key-funnel into main

This MR is to prevent a scenario where funnels table might end up with multiple records having same name.

Scenario:

  1. There is a funnel with a name funnel_1 in database
  2. Server receives an update request with name funnel_1 and previous_name something_else
  3. Server at first deletes the funnel with previous name, which doesn't exist so no action
  4. Server adds a new record with name. Since primary keys in clickhouse is not unique, insert succeeds resulting in two funnels with name funnel_1

This is a scenario unlikely to happen. However, it can occur after the funnel name MR in Gitlab repo is deployed in the following scenario.

  1. A funnel with name attribute Funnel 1 and a file name something_else.yaml exists in a repository before the deployment of funnel name MR in Gitlab repo.
  2. User renames the file to funnel_1.yaml

Merge request reports