Improve logging one time

This commit is contained in:
alesapin 2022-09-08 13:11:53 +02:00
parent 90647cb0c5
commit 6da37b92e1
3 changed files with 7 additions and 4 deletions

View File

@ -142,7 +142,7 @@ bool ReadBufferFromS3::nextImpl()
/// It doesn't make sense to retry Access Denied or No Such Key /// It doesn't make sense to retry Access Denied or No Such Key
if (!s3_exception->isRetryableError()) if (!s3_exception->isRetryableError())
{ {
tryLogCurrentException(log); tryLogCurrentException(log, fmt::format("while reading key: {}, from bucket: {}", key, bucket));
throw; throw;
} }
} }

View File

@ -1046,12 +1046,12 @@ void MergeTreeData::loadDataPartsFromDisk(
throw; throw;
broken = true; broken = true;
tryLogCurrentException(__PRETTY_FUNCTION__, fmt::format("while loading part {} on path {}", part->name, part_path)); tryLogCurrentException(log, fmt::format("while loading part {} on path {}", part->name, part_path));
} }
catch (...) catch (...)
{ {
broken = true; broken = true;
tryLogCurrentException(__PRETTY_FUNCTION__, fmt::format("while loading part {} on path {}", part->name, part_path)); tryLogCurrentException(log, fmt::format("while loading part {} on path {}", part->name, part_path));
} }
/// Ignore broken parts that can appear as a result of hard server restart. /// Ignore broken parts that can appear as a result of hard server restart.
@ -1065,7 +1065,7 @@ void MergeTreeData::loadDataPartsFromDisk(
} }
catch (...) catch (...)
{ {
tryLogCurrentException(__PRETTY_FUNCTION__, fmt::format("while calculating part size {} on path {}", part->name, part_path)); tryLogCurrentException(log, fmt::format("while calculating part size {} on path {}", part->name, part_path));
} }
std::string part_size_str = "failed to calculate size"; std::string part_size_str = "failed to calculate size";

View File

@ -7543,6 +7543,9 @@ std::pair<bool, NameSet> StorageReplicatedMergeTree::unlockSharedData(const IMer
if (!settings->allow_remote_fs_zero_copy_replication) if (!settings->allow_remote_fs_zero_copy_replication)
return std::make_pair(true, NameSet{}); return std::make_pair(true, NameSet{});
if (!part.data_part_storage)
LOG_WARNING(log, "Datapart storage for part {} (temp: {}) is not initialzied", part.name, part.is_temp);
if (!part.data_part_storage || !part.isStoredOnDisk()) if (!part.data_part_storage || !part.isStoredOnDisk())
{ {
LOG_TRACE(log, "Part {} is not stored on disk, blobs can be removed", part.name); LOG_TRACE(log, "Part {} is not stored on disk, blobs can be removed", part.name);