提交 c87fb915 编写于 作者: A Alexey Milovidov

Progress on task

上级 93626701
......@@ -1099,7 +1099,7 @@ private:
{
if (!loaded_object->supportUpdates())
{
LOG_TRACE(log, "Supposed update time for '" + loaded_object->getLoadableName() + "' is never (loaded, does not support updates)");
LOG_TRACE(log, "Supposed update time for '" << loaded_object->getLoadableName() << "' is never (loaded, does not support updates)");
return never;
}
......@@ -1108,7 +1108,7 @@ private:
const auto & lifetime = loaded_object->getLifetime();
if (lifetime.min_sec == 0 && lifetime.max_sec == 0)
{
LOG_TRACE(log, "Supposed update time for '" + loaded_object->getLoadableName() + "' is never (loaded, lifetime 0)");
LOG_TRACE(log, "Supposed update time for '" << loaded_object->getLoadableName() << "' is never (loaded, lifetime 0)");
return never;
}
......
......@@ -113,7 +113,11 @@ static void logQuery(const String & query, const Context & context, bool interna
const auto & initial_query_id = context.getClientInfo().initial_query_id;
const auto & current_user = context.getClientInfo().current_user;
LOG_DEBUG(&Logger::get("executeQuery"), "(from " << context.getClientInfo().current_address.toString() << (current_user != "default" ? ", user: " + context.getClientInfo().current_user : "") << (!initial_query_id.empty() && current_query_id != initial_query_id ? ", initial_query_id: " + initial_query_id : std::string()) << ") " << joinLines(query));
LOG_DEBUG_FORMATTED(&Logger::get("executeQuery"), "(from {}{}{}) {}",
context.getClientInfo().current_address.toString(),
(current_user != "default" ? ", user: " + context.getClientInfo().current_user : ""),
(!initial_query_id.empty() && current_query_id != initial_query_id ? ", initial_query_id: " + initial_query_id : std::string()),
joinLines(query));
}
}
......@@ -140,7 +144,13 @@ static void setExceptionStackTrace(QueryLogElement & elem)
/// Log exception (with query info) into text log (not into system table).
static void logException(Context & context, QueryLogElement & elem)
{
LOG_ERROR(&Logger::get("executeQuery"), elem.exception << " (from " << context.getClientInfo().current_address.toString() << ") (in query: " << joinLines(elem.query) << ")" << (!elem.stack_trace.empty() ? ", Stack trace (when copying this message, always include the lines below):\n\n" + elem.stack_trace : ""));
if (elem.stack_trace.empty())
LOG_ERROR_FORMATTED(&Logger::get("executeQuery"), "{} (from {}) (in query: {})",
elem.exception, context.getClientInfo().current_address.toString(), joinLines(elem.query));
else
LOG_ERROR_FORMATTED(&Logger::get("executeQuery"), "{} (from {}) (in query: {})"
", Stack trace (when copying this message, always include the lines below):\n\n{}",
elem.exception, context.getClientInfo().current_address.toString(), joinLines(elem.query), elem.stack_trace);
}
......@@ -495,7 +505,10 @@ static std::tuple<ASTPtr, BlockIO> executeQueryImpl(
if (elem.read_rows != 0)
{
LOG_INFO(&Logger::get("executeQuery"), std::fixed << std::setprecision(3) << "Read " << elem.read_rows << " rows, " << formatReadableSizeWithBinarySuffix(elem.read_bytes) << " in " << elapsed_seconds << " sec., " << static_cast<size_t>(elem.read_rows / elapsed_seconds) << " rows/sec., " << formatReadableSizeWithBinarySuffix(elem.read_bytes / elapsed_seconds) << "/sec.");
LOG_INFO_FORMATTED(&Logger::get("executeQuery"), "Read {} rows, {} in {} sec., {} rows/sec., {}/sec.",
elem.read_rows, formatReadableSizeWithBinarySuffix(elem.read_bytes), elapsed_seconds,
static_cast<size_t>(elem.read_rows / elapsed_seconds),
formatReadableSizeWithBinarySuffix(elem.read_bytes / elapsed_seconds));
}
elem.thread_ids = std::move(info.thread_ids);
......
......@@ -366,7 +366,14 @@ bool MergeTreeDataMergerMutator::selectAllPartsToMergeWithinPartition(
if (now - disk_space_warning_time > 3600)
{
disk_space_warning_time = now;
LOG_WARNING(log, "Won't merge parts from " << parts.front()->name << " to " << (*prev_it)->name << " because not enough free space: " << formatReadableSizeWithBinarySuffix(available_disk_space) << " free and unreserved, " << formatReadableSizeWithBinarySuffix(sum_bytes) << " required now (+" << static_cast<int>((DISK_USAGE_COEFFICIENT_TO_SELECT - 1.0) * 100) << "% on overhead); suppressing similar warnings for the next hour");
LOG_WARNING_FORMATTED(log,
"Won't merge parts from {} to {} because not enough free space: {} free and unreserved"
", {} required now (+{}% on overhead); suppressing similar warnings for the next hour",
parts.front()->name,
(*prev_it)->name,
formatReadableSizeWithBinarySuffix(available_disk_space),
formatReadableSizeWithBinarySuffix(sum_bytes),
static_cast<int>((DISK_USAGE_COEFFICIENT_TO_SELECT - 1.0) * 100));
}
if (out_disable_reason)
......
......@@ -66,7 +66,10 @@ MergeTreeReverseSelectProcessor::MergeTreeReverseSelectProcessor(
size_t total_rows = data_part->index_granularity.getTotalRows();
if (!quiet)
LOG_TRACE(log, "Reading " << all_mark_ranges.size() << " ranges in reverse order from part " << data_part->name << ", approx. " << total_rows << (all_mark_ranges.size() > 1 ? ", up to " + toString(data_part->index_granularity.getRowsCountInRanges(all_mark_ranges)) : "") << " rows starting from " << data_part->index_granularity.getMarkStartingRow(all_mark_ranges.front().begin));
LOG_TRACE_FORMATTED(log, "Reading {} ranges in reverse order from part {}, approx. {}, up to {} rows starting from {}",
all_mark_ranges.size(), data_part->name, total_rows,
data_part->index_granularity.getRowsCountInRanges(all_mark_ranges),
data_part->index_granularity.getMarkStartingRow(all_mark_ranges.front().begin));
addTotalRowsApprox(total_rows);
......
......@@ -47,7 +47,9 @@ MergeTreeSelectProcessor::MergeTreeSelectProcessor(
size_t total_rows = data_part->index_granularity.getRowsCountInRanges(all_mark_ranges);
if (!quiet)
LOG_TRACE(log, "Reading " << all_mark_ranges.size() << " ranges from part " << data_part->name << ", approx. " << total_rows << (all_mark_ranges.size() > 1 ? ", up to " + toString(total_rows) : "") << " rows starting from " << data_part->index_granularity.getMarkStartingRow(all_mark_ranges.front().begin));
LOG_TRACE_FORMATTED(log, "Reading {} ranges from part {}, approx. {} rows starting from {}",
all_mark_ranges.size(), data_part->name, total_rows,
data_part->index_granularity.getMarkStartingRow(all_mark_ranges.front().begin));
addTotalRowsApprox(total_rows);
ordered_names = header_without_virtual_columns.getNames();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册