mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
CLICKHOUSE-3863: Add more convinient exception message
This commit is contained in:
parent
2db2d208e1
commit
e81108b954
@ -14,7 +14,9 @@ void ReplicatedMergeTreeAddress::writeText(WriteBuffer & out) const
|
|||||||
<< "port: " << replication_port << '\n'
|
<< "port: " << replication_port << '\n'
|
||||||
<< "tcp_port: " << queries_port << '\n'
|
<< "tcp_port: " << queries_port << '\n'
|
||||||
<< "database: " << escape << database << '\n'
|
<< "database: " << escape << database << '\n'
|
||||||
<< "table: " << escape << table << '\n';
|
<< "table: " << escape << table << '\n'
|
||||||
|
<< "scheme: " << escape << scheme << '\n';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReplicatedMergeTreeAddress::readText(ReadBuffer & in)
|
void ReplicatedMergeTreeAddress::readText(ReadBuffer & in)
|
||||||
@ -25,6 +27,11 @@ void ReplicatedMergeTreeAddress::readText(ReadBuffer & in)
|
|||||||
>> "tcp_port: " >> queries_port >> "\n"
|
>> "tcp_port: " >> queries_port >> "\n"
|
||||||
>> "database: " >> escape >> database >> "\n"
|
>> "database: " >> escape >> database >> "\n"
|
||||||
>> "table: " >> escape >> table >> "\n";
|
>> "table: " >> escape >> table >> "\n";
|
||||||
|
|
||||||
|
if (!in.eof())
|
||||||
|
in >> "scheme: " >> escape >> scheme >> "\n";
|
||||||
|
else
|
||||||
|
scheme = "http";
|
||||||
}
|
}
|
||||||
|
|
||||||
String ReplicatedMergeTreeAddress::toString() const
|
String ReplicatedMergeTreeAddress::toString() const
|
||||||
|
@ -16,6 +16,7 @@ struct ReplicatedMergeTreeAddress
|
|||||||
UInt16 queries_port;
|
UInt16 queries_port;
|
||||||
String database;
|
String database;
|
||||||
String table;
|
String table;
|
||||||
|
String scheme;
|
||||||
|
|
||||||
ReplicatedMergeTreeAddress() = default;
|
ReplicatedMergeTreeAddress() = default;
|
||||||
explicit ReplicatedMergeTreeAddress(const String & str)
|
explicit ReplicatedMergeTreeAddress(const String & str)
|
||||||
|
@ -1974,6 +1974,9 @@ bool StorageReplicatedMergeTree::executeReplaceRange(const LogEntry & entry)
|
|||||||
auto [user, password] = context.getInterserverCredentials();
|
auto [user, password] = context.getInterserverCredentials();
|
||||||
String interserver_scheme = context.getInterserverScheme();
|
String interserver_scheme = context.getInterserverScheme();
|
||||||
|
|
||||||
|
if (interserver_scheme != address.scheme)
|
||||||
|
throw Exception("Interserver schemes are different '" + interserver_scheme + "' != '" + address.scheme + "', can't fetch part from " + address.host, ErrorCodes::LOGICAL_ERROR);
|
||||||
|
|
||||||
part_desc->res_part = fetcher.fetchPart(part_desc->found_new_part_name, replica_path,
|
part_desc->res_part = fetcher.fetchPart(part_desc->found_new_part_name, replica_path,
|
||||||
address.host, address.replication_port, timeouts, user, password, interserver_scheme, false, TMP_PREFIX + "fetch_");
|
address.host, address.replication_port, timeouts, user, password, interserver_scheme, false, TMP_PREFIX + "fetch_");
|
||||||
|
|
||||||
@ -2709,6 +2712,9 @@ bool StorageReplicatedMergeTree::fetchPart(const String & part_name, const Strin
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (interserver_scheme != address.scheme)
|
||||||
|
throw Exception("Interserver schemes are different '" + interserver_scheme + "' != '" + address.scheme + "', can't fetch part from " + address.host, ErrorCodes::LOGICAL_ERROR);
|
||||||
|
|
||||||
part = fetcher.fetchPart(part_name, replica_path, address.host, address.replication_port, timeouts, user, password, interserver_scheme, to_detached);
|
part = fetcher.fetchPart(part_name, replica_path, address.host, address.replication_port, timeouts, user, password, interserver_scheme, to_detached);
|
||||||
|
|
||||||
if (!to_detached)
|
if (!to_detached)
|
||||||
@ -4588,6 +4594,7 @@ ReplicatedMergeTreeAddress StorageReplicatedMergeTree::getReplicatedMergeTreeAdd
|
|||||||
res.queries_port = context.getTCPPort();
|
res.queries_port = context.getTCPPort();
|
||||||
res.database = database_name;
|
res.database = database_name;
|
||||||
res.table = table_name;
|
res.table = table_name;
|
||||||
|
res.scheme = context.getInterserverScheme();
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user