Skip to content

Commit 66ccb2f

Browse files
Remove "current_password" because it is harmful
1 parent b51cbbd commit 66ccb2f

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

src/Interpreters/ClientInfo.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ class ClientInfo
4747
String current_user;
4848
String current_query_id;
4949
Poco::Net::SocketAddress current_address;
50-
/// Use current user and password when sending query to replica leader
51-
String current_password;
5250

5351
/// When query_kind == INITIAL_QUERY, these values are equal to current.
5452
String initial_user;

src/Interpreters/Context.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,6 @@ void Context::setUser(const String & name, const String & password, const Poco::
660660
auto lock = getLock();
661661

662662
client_info.current_user = name;
663-
client_info.current_password = password;
664663
client_info.current_address = address;
665664

666665
auto new_user_id = getAccessControlManager().find<User>(name);

src/Storages/StorageReplicatedMergeTree.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4416,7 +4416,7 @@ void StorageReplicatedMergeTree::sendRequestToLeaderReplica(const ASTPtr & query
44164416
const auto & query_settings = query_context.getSettingsRef();
44174417
const auto & query_client_info = query_context.getClientInfo();
44184418
String user = query_client_info.current_user;
4419-
String password = query_client_info.current_password;
4419+
String password;
44204420

44214421
if (auto address = findClusterAddress(leader_address); address)
44224422
{

src/Storages/StorageReplicatedMergeTree.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ class StorageReplicatedMergeTree final : public ext::shared_ptr_helper<StorageRe
222222
zkutil::EphemeralNodeHolderPtr replica_is_active_node;
223223

224224
/** Is this replica "leading". The leader replica selects the parts to merge.
225+
* It can be false only when old ClickHouse versions are working on the same cluster, because now we allow multiple leaders.
225226
*/
226227
std::atomic<bool> is_leader {false};
227228
zkutil::LeaderElectionPtr leader_election;
@@ -497,6 +498,7 @@ class StorageReplicatedMergeTree final : public ext::shared_ptr_helper<StorageRe
497498
bool waitForReplicaToProcessLogEntry(const String & replica_name, const ReplicatedMergeTreeLogEntryData & entry, bool wait_for_non_active = true);
498499

499500
/// Choose leader replica, send requst to it and wait.
501+
/// Only makes sense when old ClickHouse versions are working on the same cluster, because now we allow multiple leaders.
500502
void sendRequestToLeaderReplica(const ASTPtr & query, const Context & query_context);
501503

502504
/// Throw an exception if the table is readonly.

0 commit comments

Comments
 (0)