Hi Sentry Team,
We are currently running sentry 20.7.2 and we would like to upgrade it to latest sentry version. We noticed we first need to upgrade to 21.6.3 but we have a question around clickhouse schema change.
We noticed the primary key on errors_local table changed in between these versions.
ORDER BY (org_id, project_id, toStartOfDay(timestamp), primary_hash_hex, event_hash)
ORDER BY (project_id, toStartOfDay(timestamp), primary_hash, cityHash64(event_id))
CH doesn’t allow changing the primary key of a table. We looked at the snuba migration tool’s migration for this table snuba/0011_rebuild_errors.py at 92e15e47b180897ef974609a86bf215d47a6321d · getsentry/snuba · GitHub
It seems like we just drop the existing table and create fresh new table with updated schema.
It will create data loss unless we are replaying events from kafka to CH.
I am curious how do you suggest doing it without any data loss.