Yi Luo
07/19/2024, 2:54 PM{"level":"fatal","timestamp":"2024-07-19T14:30:17.010Z","caller":"signozschemamigrator/migrate.go:128","msg":"Failed to run migrations","component":"migrate cli","error":"clickhouse migrate failed to run, error: Dirty database version 10. Fix and force version.","stacktrace":"main.main\n\t/home/runner/work/signoz-otel-collector/signoz-otel-collector/cmd/signozschemamigrator/migrate.go:128\nruntime.main\n\t/opt/hostedtoolcache/go/1.21.11/x64/src/runtime/proc.go:267"}
Prashant Shahi
07/19/2024, 3:06 PMnitya-signoz
07/19/2024, 3:17 PMYi Luo
07/19/2024, 3:28 PMnitya-signoz
07/19/2024, 3:31 PMshow create table signoz_logs.logs
?Yi Luo
07/19/2024, 3:34 PMQuery id: ac17d601-98df-47b0-a488-d30760bdaf0a
┌─statement──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ CREATE TABLE signoz_logs.logs
(
`timestamp` UInt64 CODEC(DoubleDelta, LZ4),
`observed_timestamp` UInt64 CODEC(DoubleDelta, LZ4),
`id` String CODEC(ZSTD(1)),
`trace_id` String CODEC(ZSTD(1)),
`span_id` String CODEC(ZSTD(1)),
`trace_flags` UInt32,
`severity_text` LowCardinality(String) CODEC(ZSTD(1)),
`severity_number` UInt8,
`body` String CODEC(ZSTD(2)),
`resources_string_key` Array(String) CODEC(ZSTD(1)),
`resources_string_value` Array(String) CODEC(ZSTD(1)),
`attributes_string_key` Array(String) CODEC(ZSTD(1)),
`attributes_string_value` Array(String) CODEC(ZSTD(1)),
`attributes_int64_key` Array(String) CODEC(ZSTD(1)),
`attributes_int64_value` Array(Int64) CODEC(ZSTD(1)),
`attributes_float64_key` Array(String) CODEC(ZSTD(1)),
`attributes_float64_value` Array(Float64) CODEC(ZSTD(1)),
`log` String MATERIALIZED attributes_string_value[indexOf(attributes_string_key, 'log')] CODEC(LZ4),
`attribute_string_martello_env` String MATERIALIZED attributes_string_value[indexOf(attributes_string_key, 'martello_env')] CODEC(LZ4),
`resource_string_host_name` String MATERIALIZED resources_string_value[indexOf(resources_string_key, 'host_name')] CODEC(LZ4),
`resource_string_os_type` String MATERIALIZED resources_string_value[indexOf(resources_string_key, 'os_type')] CODEC(LZ4),
`attribute_string_exception_message` String MATERIALIZED attributes_string_value[indexOf(attributes_string_key, 'exception_message')] CODEC(LZ4),
`attribute_string_exception_stacktrace` String MATERIALIZED attributes_string_value[indexOf(attributes_string_key, 'exception_stacktrace')] CODEC(LZ4),
`attribute_string_dotnet_ilogger_category` String MATERIALIZED attributes_string_value[indexOf(attributes_string_key, 'dotnet_ilogger_category')] CODEC(LZ4),
`resource_string_service_version` String MATERIALIZED resources_string_value[indexOf(resources_string_key, 'service_version')] CODEC(LZ4),
`resource_string_service_name` String MATERIALIZED resources_string_value[indexOf(resources_string_key, 'service_name')] CODEC(LZ4),
`resource_string_k8s_cluster_name` String MATERIALIZED resources_string_value[indexOf(resources_string_key, 'k8s_cluster_name')] CODEC(LZ4),
`attribute_string_martello_region` String MATERIALIZED attributes_string_value[indexOf(attributes_string_key, 'martello_region')] CODEC(LZ4),
`resource_string_k8s_namespace_name` String MATERIALIZED resources_string_value[indexOf(resources_string_key, 'k8s_namespace_name')] CODEC(LZ4),
`resource_string_k8s_node_name` String MATERIALIZED resources_string_value[indexOf(resources_string_key, 'k8s_node_name')] CODEC(LZ4),
`resource_string_vdx_tenant_id` String MATERIALIZED resources_string_value[indexOf(resources_string_key, 'vdx_tenant_id')] CODEC(LZ4),
`resource_string_vdx_tenant_name` String MATERIALIZED resources_string_value[indexOf(resources_string_key, 'vdx_tenant_name')] CODEC(LZ4),
`resource_string_k8s_container_name` String MATERIALIZED resources_string_value[indexOf(resources_string_key, 'k8s_container_name')] CODEC(LZ4),
`attribute_string_exception_message_exists` Bool MATERIALIZED if(indexOf(attributes_string_key, 'exception_message') != 0, true, false) CODEC(ZSTD(1)),
`attribute_string_martello_env_exists` Bool MATERIALIZED if(indexOf(attributes_string_key, 'martello_env') != 0, true, false) CODEC(ZSTD(1)),
`attribute_string_exception_stacktrace_exists` Bool MATERIALIZED if(indexOf(attributes_string_key, 'exception_stacktrace') != 0, true, false) CODEC(ZSTD(1)),
`attribute_string_dotnet_ilogger_category_exists` Bool MATERIALIZED if(indexOf(attributes_string_key, 'dotnet_ilogger_category') != 0, true, false) CODEC(ZSTD(1)),
`attribute_string_martello_region_exists` Bool MATERIALIZED if(indexOf(attributes_string_key, 'martello_region') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_k8s_container_name_exists` Bool MATERIALIZED if(indexOf(resources_string_key, 'k8s_container_name') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_host_name_exists` Bool MATERIALIZED if(indexOf(resources_string_key, 'host_name') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_k8s_cluster_name_exists` Bool MATERIALIZED if(indexOf(resources_string_key, 'k8s_cluster_name') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_k8s_node_name_exists` Bool MATERIALIZED if(indexOf(resources_string_key, 'k8s_node_name') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_vdx_tenant_id_exists` Bool MATERIALIZED if(indexOf(resources_string_key, 'vdx_tenant_id') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_os_type_exists` Bool MATERIALIZED if(indexOf(resources_string_key, 'os_type') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_k8s_namespace_name_exists` Bool MATERIALIZED if(indexOf(resources_string_key, 'k8s_namespace_name') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_vdx_tenant_name_exists` Bool MATERIALIZED if(indexOf(resources_string_key, 'vdx_tenant_name') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_service_name_exists` Bool MATERIALIZED if(indexOf(resources_string_key, 'service_name') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_service_version_exists` Bool MATERIALIZED if(indexOf(resources_string_key, 'service_version') != 0, true, false) CODEC(ZSTD(1)),
`attributes_bool_key` Array(String) CODEC(ZSTD(1)),
`attributes_bool_value` Array(Bool) CODEC(ZSTD(1)),
`attribute_string_exception$$message` String DEFAULT attributes_string_value[indexOf(attributes_string_key, 'exception.message')] CODEC(ZSTD(1)),
`attribute_string_exception$$message_exists` Bool DEFAULT if(indexOf(attributes_string_key, 'exception.message') != 0, true, false) CODEC(ZSTD(1)),
`attribute_string_exception$$stacktrace` String DEFAULT attributes_string_value[indexOf(attributes_string_key, 'exception.stacktrace')] CODEC(ZSTD(1)),
`attribute_string_exception$$stacktrace_exists` Bool DEFAULT if(indexOf(attributes_string_key, 'exception.stacktrace') != 0, true, false) CODEC(ZSTD(1)),
`attribute_string_dotnet$$ilogger$$category` String DEFAULT attributes_string_value[indexOf(attributes_string_key, 'dotnet.ilogger.category')] CODEC(ZSTD(1)),
`attribute_string_dotnet$$ilogger$$category_exists` Bool DEFAULT if(indexOf(attributes_string_key, 'dotnet.ilogger.category') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_k8s$$namespace$$name` String DEFAULT resources_string_value[indexOf(resources_string_key, 'k8s.namespace.name')] CODEC(ZSTD(1)),
`resource_string_k8s$$namespace$$name_exists` Bool DEFAULT if(indexOf(resources_string_key, 'k8s.namespace.name') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_k8s$$cluster$$name` String DEFAULT resources_string_value[indexOf(resources_string_key, 'k8s.cluster.name')] CODEC(ZSTD(1)),
`resource_string_k8s$$cluster$$name_exists` Bool DEFAULT if(indexOf(resources_string_key, 'k8s.cluster.name') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_service$$version` String DEFAULT resources_string_value[indexOf(resources_string_key, 'service.version')] CODEC(ZSTD(1)),
`resource_string_service$$version_exists` Bool DEFAULT if(indexOf(resources_string_key, 'service.version') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_vdx$$tenant$$name` String DEFAULT resources_string_value[indexOf(resources_string_key, 'vdx.tenant.name')] CODEC(ZSTD(1)),
`resource_string_vdx$$tenant$$name_exists` Bool DEFAULT if(indexOf(resources_string_key, 'vdx.tenant.name') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_os$$type` String DEFAULT resources_string_value[indexOf(resources_string_key, 'os.type')] CODEC(ZSTD(1)),
`resource_string_os$$type_exists` Bool DEFAULT if(indexOf(resources_string_key, 'os.type') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_host$$name` String DEFAULT resources_string_value[indexOf(resources_string_key, 'host.name')] CODEC(ZSTD(1)),
`resource_string_host$$name_exists` Bool DEFAULT if(indexOf(resources_string_key, 'host.name') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_vdx$$tenant$$id` String DEFAULT resources_string_value[indexOf(resources_string_key, 'vdx.tenant.id')] CODEC(ZSTD(1)),
`resource_string_vdx$$tenant$$id_exists` Bool DEFAULT if(indexOf(resources_string_key, 'vdx.tenant.id') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_k8s$$node$$name` String DEFAULT resources_string_value[indexOf(resources_string_key, 'k8s.node.name')] CODEC(ZSTD(1)),
`resource_string_k8s$$node$$name_exists` Bool DEFAULT if(indexOf(resources_string_key, 'k8s.node.name') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_service$$name` String DEFAULT resources_string_value[indexOf(resources_string_key, 'service.name')] CODEC(ZSTD(1)),
`resource_string_service$$name_exists` Bool DEFAULT if(indexOf(resources_string_key, 'service.name') != 0, true, false) CODEC(ZSTD(1)),
`resource_string_k8s$$container$$name` String DEFAULT resources_string_value[indexOf(resources_string_key, 'k8s.container.name')] CODEC(ZSTD(1)),
`resource_string_k8s$$container$$name_exists` Bool DEFAULT if(indexOf(resources_string_key, 'k8s.container.name') != 0, true, false) CODEC(ZSTD(1)),
INDEX id_minmax id TYPE minmax GRANULARITY 1,
INDEX log_idx log TYPE bloom_filter(0.01) GRANULARITY 64,
INDEX severity_number_idx severity_number TYPE set(25) GRANULARITY 4,
INDEX severity_text_idx severity_text TYPE set(25) GRANULARITY 4,
INDEX trace_flags_idx trace_flags TYPE bloom_filter GRANULARITY 4,
INDEX attribute_string_exception_message_idx attribute_string_exception_message TYPE bloom_filter(0.01) GRANULARITY 64,
INDEX attribute_string_martello_env_idx attribute_string_martello_env TYPE bloom_filter(0.01) GRANULARITY 64,
INDEX attribute_string_exception_stacktrace_idx attribute_string_exception_stacktrace TYPE bloom_filter(0.01) GRANULARITY 64,
INDEX attribute_string_dotnet_ilogger_category_idx attribute_string_dotnet_ilogger_category TYPE bloom_fil⋯│
nitya-signoz
07/19/2024, 3:38 PMshow create table signoz_logs.logs format Vertical
Yi Luo
07/19/2024, 3:40 PMnitya-signoz
07/19/2024, 3:47 PMselect * from system.mutations where is_done=0
• If there above query result is empty run ALTER TABLE signoz_logs.logs ON CLUSTER cluster ADD INDEX IF NOT EXISTS body_idx lower(body) TYPE ngrambf_v1(4, 60000, 5, 0) GRANULARITY 1;
• Once the above is complete run alter table signoz_logs.schema_migrations update dirty=0 where version=10
Yi Luo
07/19/2024, 3:53 PMYi Luo
07/19/2024, 3:56 PMnitya-signoz
07/19/2024, 4:01 PMYi Luo
07/19/2024, 4:06 PM"msg":"Failed to run migrations","component":"migrate cli","error":"clickhouse migrate failed to run, error: no migration found for version 10: read down for version 10 .: file does not exist","stacktrace":"main.main\n\t/home/runner/work/signoz-otel-collector/signoz-otel-collector/cmd/signozschemamigrator/migrate.go:128\nruntime.main\n\t/opt/hostedtoolcache/go/1.21.11/x64/src/runtime/proc.go:267"}
Yi Luo
07/19/2024, 4:07 PMnitya-signoz
07/19/2024, 4:11 PMYi Luo
07/19/2024, 4:29 PM{
"level": "fatal",
"timestamp": "2024-07-19T16:27:12.020Z",
"caller": "signozschemamigrator/migrate.go:128",
"msg": "Failed to run migrations",
"component": "migrate cli",
"error": "clickhouse migrate failed to run, error: Dirty database version 12. Fix and force version.",
"stacktrace": "main.main\n\t/home/runner/work/signoz-otel-collector/signoz-otel-collector/cmd/signozschemamigrator/migrate.go:128\nruntime.main\n\t/opt/hostedtoolcache/go/1.21.11/x64/src/runtime/proc.go:267"
}
nitya-signoz
07/19/2024, 4:32 PMnitya-signoz
07/19/2024, 4:36 PM{{.SIGNOZ_CLUSTER}}
with cluster
.Let me know once done
------
once the above is done, it means that you have done the migrations manually, now you will have to update the schema migrations table so that those migrations don’t run again.
Here are the steps for that
• truncate table signoz_logs.schema_migrations
• insert into signoz_logs.schema_migrations values (1 ,1 ,1720103647412982569), (1 ,0 ,1720103647810031709), (2 ,1 ,1720103647811955242), (2 ,0 ,1720103647869983948), (3 ,1 ,1720103647875299543), (3 ,0 ,1720103648053893053), (4 ,1 ,1720103648055714316), (4 ,0 ,1720103648113219798), (5 ,1 ,1720103648115626118), (5 ,0 ,1720103648678466995), (6 ,1 ,1720103648680332053), (6 ,0 ,1720103648795967894), (7 ,1 ,1720103648797859904), (7 ,0 ,1720103648967002426), (8 ,1 ,1720103648969563518), (8 ,0 ,1720103649251171410), (9 ,1 ,1720103649252821091), (9 ,0 ,1720103649365897523), (10 ,1 ,1720103649367680188), (10 ,0 ,1720103660451466954), (11 ,1 ,1720103660454458733), (11 ,0 ,1720103661073573745), (12 ,1 ,1720115099220469277), (12 ,0 ,1720115146203106526), (13 ,1 ,1720115146205945060), (13 ,0 ,1720115146319582687)
Yi Luo
07/19/2024, 5:46 PM