File tree 2 files changed +5
-21
lines changed
2 files changed +5
-21
lines changed Original file line number Diff line number Diff line change @@ -63,23 +63,6 @@ constexpr char kIdNotFound[] = "syncid not found";
63
63
constexpr string_view kClusterDisabled =
64
64
" Cluster is disabled. Enabled via passing --cluster_mode=emulated|yes" ;
65
65
66
- ClusterShardInfos GetConfigForStats (ConnectionContext* cntx) {
67
- CHECK (!IsClusterEmulated ());
68
- CHECK (ClusterConfig::Current () != nullptr );
69
-
70
- auto config = ClusterConfig::Current ()->GetConfig ();
71
- if (cntx->conn ()->IsPrivileged () || !absl::GetFlag (FLAGS_managed_service_info)) {
72
- return config;
73
- }
74
-
75
- auto shards_info = config.Unwrap ();
76
- for (auto & node : shards_info) {
77
- node.replicas .clear ();
78
- }
79
-
80
- return shards_info;
81
- }
82
-
83
66
} // namespace
84
67
85
68
ClusterFamily::ClusterFamily (ServerFamily* server_family) : server_family_(server_family) {
@@ -122,7 +105,7 @@ std::optional<ClusterShardInfos> ClusterFamily::GetShardInfos(ConnectionContext*
122
105
}
123
106
124
107
if (ClusterConfig::Current () != nullptr ) {
125
- return GetConfigForStats (cntx );
108
+ return ClusterConfig::Current ()-> GetConfig ( );
126
109
}
127
110
return nullopt;
128
111
}
Original file line number Diff line number Diff line change @@ -539,15 +539,16 @@ async def test_cluster_managed_service_info(df_factory):
539
539
assert await c_master .execute_command ("CLUSTER SHARDS" ) == expected_full_cluster_shards
540
540
assert await c_master_admin .execute_command ("CLUSTER SHARDS" ) == expected_full_cluster_shards
541
541
542
+ # this flag doesn't affect cluster anymore so the results will be the same
542
543
await c_master .execute_command ("config set managed_service_info true" )
543
544
544
- assert await c_master .execute_command ("CLUSTER SLOTS" ) == expected_hidden_cluster_slots
545
+ assert await c_master .execute_command ("CLUSTER SLOTS" ) == expected_full_cluster_slots
545
546
assert await c_master_admin .execute_command ("CLUSTER SLOTS" ) == expected_full_cluster_slots
546
547
547
- assert await c_master .execute_command ("CLUSTER NODES" ) == expected_hidden_cluster_nodes
548
+ assert await c_master .execute_command ("CLUSTER NODES" ) == expected_full_cluster_nodes
548
549
assert await c_master_admin .execute_command ("CLUSTER NODES" ) == expected_full_cluster_nodes
549
550
550
- assert await c_master .execute_command ("CLUSTER SHARDS" ) == expected_hidden_cluster_shards
551
+ assert await c_master .execute_command ("CLUSTER SHARDS" ) == expected_full_cluster_shards
551
552
assert await c_master_admin .execute_command ("CLUSTER SHARDS" ) == expected_full_cluster_shards
552
553
553
554
You can’t perform that action at this time.
0 commit comments