Log query id in executeQuery; Better type mismatch error; change format in report tool (#1372)

* Log query id in executeQuery; Better type mismatch error; change format in report tool

* Better log query_id

* fix message

* Use c++11 thread_local instaed of gcc's __thread

* lock mutex before notifying waiting thread in sync insertion into distributed [#CLICKHOUSE-3379]

* Cmake: fix build without downloaded submodules (#1379)

* fix
This commit is contained in:
proller 2017-10-23 20:32:39 +03:00 committed by alexey-milovidov
parent ddb0dcd2fd
commit c66228a746
4 changed files with 26 additions and 12 deletions

View File

@ -61,7 +61,17 @@ static String joinLines(const String & query)
/// Log query into text log (not into system table).
static void logQuery(const String & query, const Context & context)
{
LOG_DEBUG(&Logger::get("executeQuery"), "(from " << context.getClientInfo().current_address.toString() << ") " << joinLines(query));
const auto & current_query_id = context.getClientInfo().current_query_id;
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 : "")
<< ", query_id: " << current_query_id
<< (!initial_query_id.empty() && current_query_id != initial_query_id ? ", initial_query_id: " + initial_query_id : std::string())
<< ") "
<< joinLines(query)
);
}

View File

@ -533,7 +533,9 @@ void StorageBuffer::writeBlockToDestination(const Block & block, StoragePtr tabl
if (block.getByName(dst_col.name).type->getName() != dst_col.type->getName())
{
LOG_ERROR(log, "Destination table " << destination_database << "." << destination_table
<< " have different type of column " << dst_col.name << ". Block of data is discarded.");
<< " have different type of column " << dst_col.name << " ("
<< block.getByName(dst_col.name).type->getName() << " != " << dst_col.type->getName()
<< "). Block of data is discarded.");
return;
}

View File

@ -494,7 +494,9 @@ void StorageTrivialBuffer::writeBlockToDestination(const Block & block, StorageP
if (block.getByName(dst_col.name).type->getName() != dst_col.type->getName())
{
LOG_ERROR(log, "Destination table " << destination_database << "." << destination_table
<< " have different type of column " << dst_col.name << ". Block of data is discarded.");
<< " have different type of column " << dst_col.name << " ("
<< block.getByName(dst_col.name).type->getName() << " != " << dst_col.type->getName()
<< "). Block of data is discarded.");
return;
}

View File

@ -3,15 +3,15 @@
# ./clickhouse_report.sh > ch.`hostname`.`date '+%Y%M%''d%H%M%''S'`.dmp 2>&1
# curl https://raw.githubusercontent.com/yandex/ClickHouse/master/utils/report/clickhouse_report.sh | sh > ch.`hostname`.`date '+%Y%M%''d%H%M%''S'`.dmp 2>&1
clickhouse --client -q 'SELECT * FROM system.events FORMAT Pretty'
clickhouse --client -q 'SELECT * FROM system.metrics FORMAT Pretty'
clickhouse --client -q 'SELECT * FROM system.asynchronous_metrics FORMAT Pretty'
clickhouse --client -q 'SELECT * FROM system.build_options FORMAT Pretty'
clickhouse --client -q 'SELECT * FROM system.processes FORMAT Pretty'
clickhouse --client -q 'SELECT * FROM system.merges FORMAT Pretty'
clickhouse --client -q 'SELECT * FROM system.parts FORMAT Pretty'
clickhouse --client -q 'SELECT * FROM system.replication_queue FORMAT Pretty'
clickhouse --client -q 'SELECT * FROM system.dictionaries FORMAT Pretty'
clickhouse --client -q 'SELECT * FROM system.events FORMAT PrettyCompactNoEscapes'
clickhouse --client -q 'SELECT * FROM system.metrics FORMAT PrettyCompactNoEscapes'
clickhouse --client -q 'SELECT * FROM system.asynchronous_metrics FORMAT PrettyCompactNoEscapes'
clickhouse --client -q 'SELECT * FROM system.build_options FORMAT PrettyCompactNoEscapes'
clickhouse --client -q 'SELECT * FROM system.processes FORMAT PrettyCompactNoEscapes'
clickhouse --client -q 'SELECT * FROM system.merges FORMAT PrettyCompactNoEscapes'
clickhouse --client -q 'SELECT * FROM system.parts FORMAT PrettyCompactNoEscapes'
clickhouse --client -q 'SELECT * FROM system.replication_queue FORMAT PrettyCompactNoEscapes'
clickhouse --client -q 'SELECT * FROM system.dictionaries FORMAT PrettyCompactNoEscapes'
ps auxw
df -h
top -bn1