mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Add test and config changes for system.error_log
This commit is contained in:
parent
f10f266ea3
commit
216d26987a
@ -285,7 +285,7 @@ stop_logs_replication
|
|||||||
|
|
||||||
# Try to get logs while server is running
|
# Try to get logs while server is running
|
||||||
failed_to_save_logs=0
|
failed_to_save_logs=0
|
||||||
for table in query_log zookeeper_log trace_log transactions_info_log metric_log blob_storage_log
|
for table in query_log zookeeper_log trace_log transactions_info_log metric_log blob_storage_log error_log
|
||||||
do
|
do
|
||||||
err=$(clickhouse-client -q "select * from system.$table into outfile '/test_output/$table.tsv.gz' format TSVWithNamesAndTypes")
|
err=$(clickhouse-client -q "select * from system.$table into outfile '/test_output/$table.tsv.gz' format TSVWithNamesAndTypes")
|
||||||
echo "$err"
|
echo "$err"
|
||||||
@ -339,7 +339,7 @@ if [ $failed_to_save_logs -ne 0 ]; then
|
|||||||
# directly
|
# directly
|
||||||
# - even though ci auto-compress some files (but not *.tsv) it does this only
|
# - even though ci auto-compress some files (but not *.tsv) it does this only
|
||||||
# for files >64MB, we want this files to be compressed explicitly
|
# for files >64MB, we want this files to be compressed explicitly
|
||||||
for table in query_log zookeeper_log trace_log transactions_info_log metric_log blob_storage_log
|
for table in query_log zookeeper_log trace_log transactions_info_log metric_log blob_storage_log error_log
|
||||||
do
|
do
|
||||||
clickhouse-local "$data_path_config" --only-system-tables --stacktrace -q "select * from system.$table format TSVWithNamesAndTypes" | zstd --threads=0 > /test_output/$table.tsv.zst ||:
|
clickhouse-local "$data_path_config" --only-system-tables --stacktrace -q "select * from system.$table format TSVWithNamesAndTypes" | zstd --threads=0 > /test_output/$table.tsv.zst ||:
|
||||||
if [[ -n "$USE_DATABASE_REPLICATED" ]] && [[ "$USE_DATABASE_REPLICATED" -eq 1 ]]; then
|
if [[ -n "$USE_DATABASE_REPLICATED" ]] && [[ "$USE_DATABASE_REPLICATED" -eq 1 ]]; then
|
||||||
|
@ -1155,7 +1155,7 @@
|
|||||||
<flush_on_crash>false</flush_on_crash>
|
<flush_on_crash>false</flush_on_crash>
|
||||||
</metric_log>
|
</metric_log>
|
||||||
|
|
||||||
<!-- Error log contains rows with current values of Errors collected with "collect_interval_milliseconds" interval. -->
|
<!-- Error log contains rows with current values of errors collected with "collect_interval_milliseconds" interval. -->
|
||||||
<error_log>
|
<error_log>
|
||||||
<database>system</database>
|
<database>system</database>
|
||||||
<table>error_log</table>
|
<table>error_log</table>
|
||||||
|
@ -726,6 +726,13 @@ metric_log:
|
|||||||
flush_interval_milliseconds: 7500
|
flush_interval_milliseconds: 7500
|
||||||
collect_interval_milliseconds: 1000
|
collect_interval_milliseconds: 1000
|
||||||
|
|
||||||
|
# Error log contains rows with current values of errors collected with "collect_interval_milliseconds" interval.
|
||||||
|
error_log:
|
||||||
|
database: system
|
||||||
|
table: error_log
|
||||||
|
flush_interval_milliseconds: 7500
|
||||||
|
collect_interval_milliseconds: 1000
|
||||||
|
|
||||||
# Asynchronous metric log contains values of metrics from
|
# Asynchronous metric log contains values of metrics from
|
||||||
# system.asynchronous_metrics.
|
# system.asynchronous_metrics.
|
||||||
asynchronous_metric_log:
|
asynchronous_metric_log:
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
<query_log remove="remove" />
|
<query_log remove="remove" />
|
||||||
<query_views_log remove="remove" />
|
<query_views_log remove="remove" />
|
||||||
<metric_log remove="remove"/>
|
<metric_log remove="remove"/>
|
||||||
|
<error_log remove="remove"/>
|
||||||
<text_log remove="remove"/>
|
<text_log remove="remove"/>
|
||||||
<trace_log remove="remove"/>
|
<trace_log remove="remove"/>
|
||||||
<asynchronous_metric_log remove="remove" />
|
<asynchronous_metric_log remove="remove" />
|
||||||
|
@ -1485,6 +1485,7 @@ def test_backup_all(exclude_system_log_tables):
|
|||||||
"processors_profile_log",
|
"processors_profile_log",
|
||||||
"asynchronous_insert_log",
|
"asynchronous_insert_log",
|
||||||
"backup_log",
|
"backup_log",
|
||||||
|
"error_log",
|
||||||
]
|
]
|
||||||
exclude_from_backup += ["system." + table_name for table_name in log_tables]
|
exclude_from_backup += ["system." + table_name for table_name in log_tables]
|
||||||
|
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
<clickhouse>
|
||||||
|
<error_log>
|
||||||
|
<database>system</database>
|
||||||
|
<table>error_log</table>
|
||||||
|
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
||||||
|
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
||||||
|
</error_log>
|
||||||
|
</clickhouse>
|
@ -756,6 +756,14 @@
|
|||||||
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
||||||
</metric_log>
|
</metric_log>
|
||||||
|
|
||||||
|
<!-- Error log contains rows with current values of errors collected with "collect_interval_milliseconds" interval. -->
|
||||||
|
<error_log>
|
||||||
|
<database>system</database>
|
||||||
|
<table>error_log</table>
|
||||||
|
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
||||||
|
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
||||||
|
</error_log>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Asynchronous metric log contains values of metrics from
|
Asynchronous metric log contains values of metrics from
|
||||||
system.asynchronous_metrics.
|
system.asynchronous_metrics.
|
||||||
|
@ -9,6 +9,7 @@ def test_xml_full_conf():
|
|||||||
|
|
||||||
all_confd = [
|
all_confd = [
|
||||||
"configs/config.d/access_control.xml",
|
"configs/config.d/access_control.xml",
|
||||||
|
"configs/config.d/error_log.xml",
|
||||||
"configs/config.d/keeper_port.xml",
|
"configs/config.d/keeper_port.xml",
|
||||||
"configs/config.d/logging_no_rotate.xml",
|
"configs/config.d/logging_no_rotate.xml",
|
||||||
"configs/config.d/log_to_console.xml",
|
"configs/config.d/log_to_console.xml",
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
error_log:
|
||||||
|
database: system
|
||||||
|
table: error_log
|
||||||
|
flush_interval_milliseconds: 7500
|
||||||
|
collect_interval_milliseconds: 1000
|
||||||
|
|
@ -129,6 +129,13 @@
|
|||||||
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
||||||
</metric_log>
|
</metric_log>
|
||||||
|
|
||||||
|
<error_log>
|
||||||
|
<database>system</database>
|
||||||
|
<table>error_log</table>
|
||||||
|
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
||||||
|
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
||||||
|
</error_log>
|
||||||
|
|
||||||
<asynchronous_metric_log>
|
<asynchronous_metric_log>
|
||||||
<database>system</database>
|
<database>system</database>
|
||||||
<table>asynchronous_metric_log</table>
|
<table>asynchronous_metric_log</table>
|
||||||
|
@ -9,6 +9,7 @@ def test_xml_main_conf():
|
|||||||
|
|
||||||
all_confd = [
|
all_confd = [
|
||||||
"configs/config.d/access_control.yaml",
|
"configs/config.d/access_control.yaml",
|
||||||
|
"configs/config.d/error_log.yaml",
|
||||||
"configs/config.d/keeper_port.yaml",
|
"configs/config.d/keeper_port.yaml",
|
||||||
"configs/config.d/logging_no_rotate.yaml",
|
"configs/config.d/logging_no_rotate.yaml",
|
||||||
"configs/config.d/log_to_console.yaml",
|
"configs/config.d/log_to_console.yaml",
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
<clickhouse>
|
||||||
|
<error_log>
|
||||||
|
<database>system</database>
|
||||||
|
<table>error_log</table>
|
||||||
|
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
||||||
|
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
||||||
|
</error_log>
|
||||||
|
</clickhouse>
|
@ -129,6 +129,13 @@
|
|||||||
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
||||||
</metric_log>
|
</metric_log>
|
||||||
|
|
||||||
|
<error_log>
|
||||||
|
<database>system</database>
|
||||||
|
<table>error_log</table>
|
||||||
|
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
||||||
|
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
||||||
|
</error_log>
|
||||||
|
|
||||||
<asynchronous_metric_log>
|
<asynchronous_metric_log>
|
||||||
<database>system</database>
|
<database>system</database>
|
||||||
<table>asynchronous_metric_log</table>
|
<table>asynchronous_metric_log</table>
|
||||||
|
@ -10,6 +10,7 @@ def test_extra_yaml_mix():
|
|||||||
all_confd = [
|
all_confd = [
|
||||||
"configs/config.d/0_common_instance_config.yaml",
|
"configs/config.d/0_common_instance_config.yaml",
|
||||||
"configs/config.d/access_control.yaml",
|
"configs/config.d/access_control.yaml",
|
||||||
|
"configs/config.d/error_log.xml",
|
||||||
"configs/config.d/keeper_port.xml",
|
"configs/config.d/keeper_port.xml",
|
||||||
"configs/config.d/logging_no_rotate.xml",
|
"configs/config.d/logging_no_rotate.xml",
|
||||||
"configs/config.d/log_to_console.yaml",
|
"configs/config.d/log_to_console.yaml",
|
||||||
|
@ -0,0 +1,6 @@
|
|||||||
|
error_log:
|
||||||
|
database: system
|
||||||
|
table: error_log
|
||||||
|
flush_interval_milliseconds: 7500
|
||||||
|
collect_interval_milliseconds: 1000
|
||||||
|
|
@ -90,6 +90,11 @@ metric_log:
|
|||||||
table: metric_log
|
table: metric_log
|
||||||
flush_interval_milliseconds: 7500
|
flush_interval_milliseconds: 7500
|
||||||
collect_interval_milliseconds: 1000
|
collect_interval_milliseconds: 1000
|
||||||
|
error_log:
|
||||||
|
database: system
|
||||||
|
table: error_log
|
||||||
|
flush_interval_milliseconds: 7500
|
||||||
|
collect_interval_milliseconds: 1000
|
||||||
asynchronous_metric_log:
|
asynchronous_metric_log:
|
||||||
database: system
|
database: system
|
||||||
table: asynchronous_metric_log
|
table: asynchronous_metric_log
|
||||||
|
@ -10,6 +10,7 @@ def test_yaml_full_conf():
|
|||||||
all_confd = [
|
all_confd = [
|
||||||
"configs/config.d/0_common_instance_config.yaml",
|
"configs/config.d/0_common_instance_config.yaml",
|
||||||
"configs/config.d/access_control.yaml",
|
"configs/config.d/access_control.yaml",
|
||||||
|
"configs/config.d/error_log.yaml",
|
||||||
"configs/config.d/keeper_port.yaml",
|
"configs/config.d/keeper_port.yaml",
|
||||||
"configs/config.d/logging_no_rotate.yaml",
|
"configs/config.d/logging_no_rotate.yaml",
|
||||||
"configs/config.d/log_to_console.yaml",
|
"configs/config.d/log_to_console.yaml",
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
<clickhouse>
|
||||||
|
<error_log>
|
||||||
|
<database>system</database>
|
||||||
|
<table>error_log</table>
|
||||||
|
<flush_interval_milliseconds>7500</flush_interval_milliseconds>
|
||||||
|
<collect_interval_milliseconds>1000</collect_interval_milliseconds>
|
||||||
|
</error_log>
|
||||||
|
</clickhouse>
|
@ -90,6 +90,11 @@ metric_log:
|
|||||||
table: metric_log
|
table: metric_log
|
||||||
flush_interval_milliseconds: 7500
|
flush_interval_milliseconds: 7500
|
||||||
collect_interval_milliseconds: 1000
|
collect_interval_milliseconds: 1000
|
||||||
|
error_log:
|
||||||
|
database: system
|
||||||
|
table: error_log
|
||||||
|
flush_interval_milliseconds: 7500
|
||||||
|
collect_interval_milliseconds: 1000
|
||||||
asynchronous_metric_log:
|
asynchronous_metric_log:
|
||||||
database: system
|
database: system
|
||||||
table: asynchronous_metric_log
|
table: asynchronous_metric_log
|
||||||
|
@ -10,6 +10,7 @@ def test_yaml_main_conf():
|
|||||||
all_confd = [
|
all_confd = [
|
||||||
"configs/config.d/0_common_instance_config.yaml",
|
"configs/config.d/0_common_instance_config.yaml",
|
||||||
"configs/config.d/access_control.xml",
|
"configs/config.d/access_control.xml",
|
||||||
|
"configs/config.d/error_log.xml",
|
||||||
"configs/config.d/keeper_port.xml",
|
"configs/config.d/keeper_port.xml",
|
||||||
"configs/config.d/logging_no_rotate.xml",
|
"configs/config.d/logging_no_rotate.xml",
|
||||||
"configs/config.d/log_to_console.xml",
|
"configs/config.d/log_to_console.xml",
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<query_log remove="remove" />
|
<query_log remove="remove" />
|
||||||
<query_views_log remove="remove" />
|
<query_views_log remove="remove" />
|
||||||
<metric_log remove="remove"/>
|
<metric_log remove="remove"/>
|
||||||
|
<error_log remove="remove"/>
|
||||||
<text_log remove="remove"/>
|
<text_log remove="remove"/>
|
||||||
<trace_log remove="remove"/>
|
<trace_log remove="remove"/>
|
||||||
<asynchronous_metric_log remove="remove" />
|
<asynchronous_metric_log remove="remove" />
|
||||||
|
@ -21,6 +21,7 @@ system_logs = [
|
|||||||
("system.part_log", 1),
|
("system.part_log", 1),
|
||||||
("system.trace_log", 1),
|
("system.trace_log", 1),
|
||||||
("system.metric_log", 1),
|
("system.metric_log", 1),
|
||||||
|
("system.error_log", 1),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ def test_system_logs_recreate():
|
|||||||
"part_log",
|
"part_log",
|
||||||
"trace_log",
|
"trace_log",
|
||||||
"metric_log",
|
"metric_log",
|
||||||
|
"error_log",
|
||||||
]
|
]
|
||||||
|
|
||||||
node.query("SYSTEM FLUSH LOGS")
|
node.query("SYSTEM FLUSH LOGS")
|
||||||
|
@ -0,0 +1 @@
|
|||||||
|
1
|
@ -0,0 +1,5 @@
|
|||||||
|
select sleep(2) format Null; --More than collect_interval_milliseconds
|
||||||
|
|
||||||
|
system flush logs;
|
||||||
|
|
||||||
|
select count()>0 from system.error_log
|
Loading…
Reference in New Issue
Block a user