Fix bad exception messages

This commit is contained in:
Alexey Milovidov 2024-08-19 05:53:59 +02:00
parent 1283c1e7e7
commit 8b2ffa6c46
3 changed files with 8 additions and 8 deletions

View File

@ -391,7 +391,7 @@ ReplicatedCheckResult ReplicatedMergeTreePartCheckThread::checkPartImpl(const St
{
WriteBufferFromOwnString wb;
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));
LOG_DEBUG(log, message);
result.action = ReplicatedCheckResult::DoNothing;

View File

@ -323,7 +323,7 @@ static IMergeTreeDataPart::Checksums checkDataPart(
broken_projections_message += "\n";
broken_projections_message += fmt::format(
"Part {} has a broken projection {} (error: {})",
"Part `{}` has broken projection `{}` (error: {})",
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(
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
)
@ -415,13 +415,13 @@ def test_materialize_broken_projection(cluster):
assert "FILE_DOESNT_EXIST" in get_broken_projections_info(
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
)
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):
@ -443,13 +443,13 @@ def test_broken_ignored_replicated(cluster):
check(node, table_name2, 1)
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
)
break_part(node, table_name, "all_0_0_0")
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):
@ -528,7 +528,7 @@ def test_broken_projections_in_backups_3(cluster):
check(node, table_name, 1)
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
)
assert "FILE_DOESNT_EXIST" in get_broken_projections_info(