Merge pull request #68520 from ClickHouse/fix-bad-exception-messages

Fix bad exception messages
This commit is contained in:
Kseniia Sumarokova 2024-09-17 13:29:53 +00:00 committed by GitHub
commit 51fa9ebf8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 8 deletions

View File

@ -391,7 +391,7 @@ ReplicatedCheckResult ReplicatedMergeTreePartCheckThread::checkPartImpl(const St
{ {
WriteBufferFromOwnString wb; WriteBufferFromOwnString wb;
message = PreformattedMessage::create( message = PreformattedMessage::create(
"Part {} has a broken projections. It will be ignored. Broken projections info: {}", "Part `{}` has broken projections. It will be ignored. Broken projections info: {}",
part_name, getCurrentExceptionMessage(true)); part_name, getCurrentExceptionMessage(true));
LOG_DEBUG(log, message); LOG_DEBUG(log, message);
result.action = ReplicatedCheckResult::DoNothing; result.action = ReplicatedCheckResult::DoNothing;

View File

@ -323,7 +323,7 @@ static IMergeTreeDataPart::Checksums checkDataPart(
broken_projections_message += "\n"; broken_projections_message += "\n";
broken_projections_message += fmt::format( broken_projections_message += fmt::format(
"Part {} has a broken projection {} (error: {})", "Part `{}` has broken projection `{}` (error: {})",
data_part->name, name, exception_message); data_part->name, name, exception_message);
} }

View File

@ -405,7 +405,7 @@ def test_materialize_broken_projection(cluster):
assert "NO_FILE_IN_DATA_PART" in get_broken_projections_info( assert "NO_FILE_IN_DATA_PART" in get_broken_projections_info(
node, table_name, part="all_1_1_0", projection="proj1" node, table_name, part="all_1_1_0", projection="proj1"
) )
assert "Part all_1_1_0 has a broken projection proj1" in check_table_full( assert "Part `all_1_1_0` has broken projection `proj1`" in check_table_full(
node, table_name node, table_name
) )
@ -415,13 +415,13 @@ def test_materialize_broken_projection(cluster):
assert "FILE_DOESNT_EXIST" in get_broken_projections_info( assert "FILE_DOESNT_EXIST" in get_broken_projections_info(
node, table_name, part="all_1_1_0", projection="proj2" node, table_name, part="all_1_1_0", projection="proj2"
) )
assert "Part all_1_1_0 has a broken projection proj2" in check_table_full( assert "Part `all_1_1_0` has broken projection `proj2`" in check_table_full(
node, table_name node, table_name
) )
materialize_projection(node, table_name, "proj1") materialize_projection(node, table_name, "proj1")
assert "has a broken projection" not in check_table_full(node, table_name) assert "has broken projection" not in check_table_full(node, table_name)
def test_broken_ignored_replicated(cluster): def test_broken_ignored_replicated(cluster):
@ -443,13 +443,13 @@ def test_broken_ignored_replicated(cluster):
check(node, table_name2, 1) check(node, table_name2, 1)
break_projection(node, table_name, "proj1", "all_0_0_0", "data") break_projection(node, table_name, "proj1", "all_0_0_0", "data")
assert "Part all_0_0_0 has a broken projection proj1" in check_table_full( assert "Part `all_0_0_0` has broken projection `proj1`" in check_table_full(
node, table_name node, table_name
) )
break_part(node, table_name, "all_0_0_0") break_part(node, table_name, "all_0_0_0")
node.query(f"SYSTEM SYNC REPLICA {table_name}") node.query(f"SYSTEM SYNC REPLICA {table_name}")
assert "has a broken projection" not in check_table_full(node, table_name) assert "has broken projection" not in check_table_full(node, table_name)
def get_random_string(string_length=8): def get_random_string(string_length=8):
@ -528,7 +528,7 @@ def test_broken_projections_in_backups_3(cluster):
check(node, table_name, 1) check(node, table_name, 1)
break_projection(node, table_name, "proj1", "all_1_1_0", "part") break_projection(node, table_name, "proj1", "all_1_1_0", "part")
assert "Part all_1_1_0 has a broken projection proj1" in check_table_full( assert "Part `all_1_1_0` has broken projection `proj1`" in check_table_full(
node, table_name node, table_name
) )
assert "FILE_DOESNT_EXIST" in get_broken_projections_info( assert "FILE_DOESNT_EXIST" in get_broken_projections_info(