-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't restore clickhouse backup in version 24.5.0 #6305
Comments
Am I reading this right, you are upgrading from Sentry 10.x? Clickhouse backups are not something that Sentry itself owns, but I am curious to why this may be failing for you. I would assume that if you're able to upgrade to 24.5.0 successfully, that means you are on clickhouse 23.8. |
@hubertdeng123 No. We're upgrading from 24.5.0 to 24.6.0. I was just implying that we've been using Sentry for a long time and this might be the cause of the issues we're facing (legacy clickhouse DB scheme etc.). Yes we use clickhouse 23.8. Basically we fixed it, but I'm sure that more of your customers will run into this as clickhouse removed compatibility for the ordinary database format |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
@hubertdeng123 HI! This happened again, when restoring 24.06 😦 Any ideas? In addition we got these problems now, when restoring postgres (unique constraints):
|
Looks like that may be an issue seen here: getsentry/self-hosted#3167 |
There are multiple issues in this one now. We had the same while trying to restore the backup for 24.7.0. |
Any news here? Seems like something on Sentry side must be wrongly set and I'm tempted to issue a query to fix it in clickhouse. E.g. https://www.markhneedham.com/blog/2024/06/27/clickhouse-unknown-setting-allow_nullable_key/ |
Maybe it can be fixed by upgrading clickhouse to > 23.9 |
@hubertdeng123 The clickhouse-backup team told us that creating this table with clickhouse 23.X would no longer work. I'm assuming that Sentry only still works because the tables were created before clickhouse 23. See: Altinity/clickhouse-backup#1005 (comment) What do you think about this? |
I'm going to transfer this over to snuba since they are more familiar with clickhouse and its used at Sentry. Thanks for documenting your investigation! |
Thanks for fixing this! |
Self-Hosted Version
24.5.0
CPU Architecture
x86_64
Docker Version
25.0.3
Docker Compose Version
2.27.0
Steps to Reproduce
s3 cp
, clickhouse with clickhouse-backup, postgres with pgdump ands3 cp
clickhouse-backup
for24.5.0
fails, because of several problems (details below):docker compose run --rm --no-deps clickhouse_backup restore --drop last-backup
error can't create table `default`.`outcomes_mv_hourly_local`: code: 80, message: Incorrect ATTACH TABLE query for Atomic database engine
Issues identified
backup/clickhouse_backup_2024-06-26T02\:00\:00+00\:00/metadata/default/functions_mv_local.json
,allow_nullable_key
is not setHow we fixed the issues
allow_nullable_key
into the backupjson
file that was created.Commands we've executed
# restore failed, so edit /data/sentry/clickhouse/backup/clickhouse_backup_2024-06-26T02\:00\:00+00\:00/metadata/default/functions_mv_local.json - # "query": "CREATE TABLE default.functions_mv_local (`project_id` UInt64, `transaction_name` String, `timestamp` DateTime, `depth` UInt32, `parent_fingerprint` UInt64, `fingerprint` UInt64, `name` String, `package` String, `path` String, `is_application` UInt8, `platform` LowCardinality(String), `environment` LowCardinality(Nullable(String)), `release` LowCardinality(Nullable(String)), `os_name` LowCardinality(String), `os_version` LowCardinality(String), `retention_days` UInt16, `count` AggregateFunction(count, Float64), `percentiles` AggregateFunction(quantiles(0.5, 0.75, 0.9, 0.95, 0.99), Float64), `min` AggregateFunction(min, Float64), `max` AggregateFunction(max, Float64), `avg` AggregateFunction(avg, Float64), `sum` AggregateFunction(sum, Float64), `worst` AggregateFunction(argMax, UUID, Float64), `examples` AggregateFunction(groupUniqArray(5), UUID)) ENGINE = AggregatingMergeTree PARTITION BY (retention_days, toMonday(timestamp)) PRIMARY KEY (project_id, transaction_name, timestamp, depth, parent_fingerprint, fingerprint) ORDER BY (project_id, transaction_name, timestamp, depth, parent_fingerprint, fingerprint, name, package, path, is_application, platform, environment, release, os_name, os_version, retention_days) TTL timestamp + toIntervalDay(retention_days) SETTINGS index_granularity = 2048", + # "query": "CREATE TABLE default.functions_mv_local (`project_id` UInt64, `transaction_name` String, `timestamp` DateTime, `depth` UInt32, `parent_fingerprint` UInt64, `fingerprint` UInt64, `name` String, `package` String, `path` String, `is_application` UInt8, `platform` LowCardinality(String), `environment` LowCardinality(Nullable(String)), `release` LowCardinality(Nullable(String)), `os_name` LowCardinality(String), `os_version` LowCardinality(String), `retention_days` UInt16, `count` AggregateFunction(count, Float64), `percentiles` AggregateFunction(quantiles(0.5, 0.75, 0.9, 0.95, 0.99), Float64), `min` AggregateFunction(min, Float64), `max` AggregateFunction(max, Float64), `avg` AggregateFunction(avg, Float64), `sum` AggregateFunction(sum, Float64), `worst` AggregateFunction(argMax, UUID, Float64), `examples` AggregateFunction(groupUniqArray(5), UUID)) ENGINE = AggregatingMergeTree PARTITION BY (retention_days, toMonday(timestamp)) PRIMARY KEY (project_id, transaction_name, timestamp, depth, parent_fingerprint, fingerprint) ORDER BY (project_id, transaction_name, timestamp, depth, parent_fingerprint, fingerprint, name, package, path, is_application, platform, environment, release, os_name, os_version, retention_days) TTL timestamp + toIntervalDay(retention_days) SETTINGS index_granularity = 2048, allow_nullable_key = 1",
Please let us know, if you've experienced this as well or if we did something wrong or how you deal with testing your restores on the system.
Expected Result
Smooth restore, as with every release since clickhouse exists. Way before 10.X
Actual Result
Event ID
No response
The text was updated successfully, but these errors were encountered: