diff --git a/ch_tools/chadmin/internal/diagnostics/diagnose.py b/ch_tools/chadmin/internal/diagnostics/diagnose.py index 33a96d5c..aa809a9b 100644 --- a/ch_tools/chadmin/internal/diagnostics/diagnose.py +++ b/ch_tools/chadmin/internal/diagnostics/diagnose.py @@ -12,7 +12,6 @@ ClickhouseUsersConfig, ) from ch_tools.common.dbaas import DbaasConfig -from ch_tools.common.utils import version_ge from ..utils import clickhouse_client from .data import DiagnosticsData, add_command, add_query, execute_query @@ -131,11 +130,6 @@ def diagnose(ctx: Context, output_format: str, normalize_queries: bool) -> None: format_=OutputFormat.Vertical, section="Replication", ), - ] - ) - - if version_ge(version, "21.3"): - tasks.append( add_query( diagnostics, "Replicated fetches", @@ -144,7 +138,8 @@ def diagnose(ctx: Context, output_format: str, normalize_queries: bool) -> None: format_=OutputFormat.Vertical, section="Replication", ), - ) + ] + ) tasks.extend( [ diff --git a/ch_tools/chadmin/internal/diagnostics/query.py b/ch_tools/chadmin/internal/diagnostics/query.py index 45ccba5b..321f267c 100644 --- a/ch_tools/chadmin/internal/diagnostics/query.py +++ b/ch_tools/chadmin/internal/diagnostics/query.py @@ -295,18 +295,9 @@ formatReadableSize(memory_usage) AS "memory usage", user, multiIf(empty(client_name), http_user_agent, concat(client_name, ' ', toString(client_version_major), '.', toString(client_version_minor), '.', toString(client_version_patch))) AS client, - {% if version_ge('21.3') -%} thread_ids, - {% endif -%} - {% if version_ge('21.8') -%} ProfileEvents, Settings - {% else -%} - ProfileEvents.Names, - ProfileEvents.Values, - Settings.Names, - Settings.Values - {% endif -%} FROM system.processes ORDER BY elapsed DESC """ @@ -320,9 +311,7 @@ query_start_time, query_duration_ms, query_id, - {% if version_ge('21.3') -%} query_kind, - {% endif -%} is_initial_query, {% if normalize_queries -%} normalizeQuery(query) AS normalized_query, @@ -339,7 +328,6 @@ initial_user, multiIf(empty(client_name), http_user_agent, concat(client_name, ' ', toString(client_version_major), '.', toString(client_version_minor), '.', toString(client_version_patch))) AS client, client_hostname, - {% if version_ge('21.3') -%} databases, tables, columns, @@ -353,16 +341,8 @@ used_storages, used_table_functions, thread_ids, - {% endif -%} - {% if version_ge('21.8') -%} ProfileEvents, Settings - {% else -%} - ProfileEvents.Names, - ProfileEvents.Values, - Settings.Names, - Settings.Values - {% endif -%} FROM system.query_log WHERE type != 'QueryStart' AND event_date >= today() - 1 @@ -380,9 +360,7 @@ query_start_time, query_duration_ms, query_id, - {% if version_ge('21.3') -%} query_kind, - {% endif -%} is_initial_query, {% if normalize_queries -%} normalizeQuery(query) AS normalized_query, @@ -399,7 +377,6 @@ initial_user, multiIf(empty(client_name), http_user_agent, concat(client_name, ' ', toString(client_version_major), '.', toString(client_version_minor), '.', toString(client_version_patch))) AS client, client_hostname, - {% if version_ge('21.3') -%} databases, tables, columns, @@ -413,16 +390,8 @@ used_storages, used_table_functions, thread_ids, - {% endif -%} - {% if version_ge('21.8') -%} ProfileEvents, Settings - {% else -%} - ProfileEvents.Names, - ProfileEvents.Values, - Settings.Names, - Settings.Values - {% endif -%} FROM system.query_log WHERE type != 'QueryStart' AND event_date >= today() - 1 @@ -440,9 +409,7 @@ query_start_time, query_duration_ms, query_id, - {% if version_ge('21.3') -%} query_kind, - {% endif -%} is_initial_query, {% if normalize_queries -%} normalizeQuery(query) AS normalized_query, @@ -459,7 +426,6 @@ initial_user, multiIf(empty(client_name), http_user_agent, concat(client_name, ' ', toString(client_version_major), '.', toString(client_version_minor), '.', toString(client_version_patch))) AS client, client_hostname, - {% if version_ge('21.3') -%} databases, tables, columns, @@ -473,16 +439,8 @@ used_storages, used_table_functions, thread_ids, - {% endif -%} - {% if version_ge('21.8') -%} ProfileEvents, Settings - {% else -%} - ProfileEvents.Names, - ProfileEvents.Values, - Settings.Names, - Settings.Values - {% endif -%} FROM system.query_log WHERE type != 'QueryStart' AND event_date >= today() - 1 @@ -497,9 +455,7 @@ # language=clickhouse r""" SELECT - {% if version_ge('21.8') -%} thread_name, - {% endif -%} min(thread_id) AS min_thread_id, count() AS threads, '\n' || arrayStringConcat( @@ -510,11 +466,7 @@ arrayMap(x -> demangle(addressToSymbol(x)), trace)), '\n') AS trace FROM system.stack_trace -GROUP BY - {% if version_ge('21.8') -%} - thread_name, - {% endif -%} - trace +GROUP BY thread_name, trace ORDER BY min_thread_id """ ) diff --git a/ch_tools/chadmin/internal/part.py b/ch_tools/chadmin/internal/part.py index 366c7683..95cbfa01 100644 --- a/ch_tools/chadmin/internal/part.py +++ b/ch_tools/chadmin/internal/part.py @@ -49,7 +49,6 @@ def list_parts( delete_ttl_info_max, move_ttl_info.expression, move_ttl_info.min, - {% if version_ge('21.8') -%} move_ttl_info.max, default_compression_codec, recompression_ttl_info.expression, @@ -62,9 +61,6 @@ def list_parts( rows_where_ttl_info.min, rows_where_ttl_info.max, projections - {% else -%} - move_ttl_info.max - {% endif -%} FROM system.parts {% if database -%} WHERE database {{ format_str_match(database) }} @@ -289,18 +285,14 @@ def list_part_log( SELECT event_time, event_type, - {% if version_ge('21.8') -%} merge_reason, - {% endif -%} duration_ms, database, table, partition_id, part_name, - {% if version_ge('21.8') -%} part_type, disk_name, - {% endif -%} rows, size_in_bytes, merged_from,