Skip to content

Commit 06ff9fa

Browse files
committed
feat: ignore managed_service_info flag for cluster
1 parent ce5c44b commit 06ff9fa

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/server/cluster/cluster_family.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ClusterShardInfos GetConfigForStats(ConnectionContext* cntx) {
6868
CHECK(ClusterConfig::Current() != nullptr);
6969

7070
auto config = ClusterConfig::Current()->GetConfig();
71-
if (cntx->conn()->IsPrivileged() || !absl::GetFlag(FLAGS_managed_service_info)) {
71+
if (cntx->conn()->IsPrivileged()) {
7272
return config;
7373
}
7474

tests/dragonfly/cluster_test.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,8 @@ async def test_cluster_managed_service_info(df_factory):
459459
replica_id,
460460
]
461461
)
462-
assert await c_master.execute_command("CLUSTER SLOTS") == expected_full_cluster_slots
462+
# managed_service_info is ignored for cluster because we have "hidden" health for replica
463+
assert await c_master.execute_command("CLUSTER SLOTS") == expected_hidden_cluster_slots
463464
assert await c_master_admin.execute_command("CLUSTER SLOTS") == expected_full_cluster_slots
464465

465466
expected_hidden_cluster_nodes = {
@@ -489,7 +490,8 @@ async def test_cluster_managed_service_info(df_factory):
489490
"node_id": replica_id,
490491
"slots": [],
491492
}
492-
assert await c_master.execute_command("CLUSTER NODES") == expected_full_cluster_nodes
493+
# managed_service_info is ignored for cluster because we have "hidden" health for replica
494+
assert await c_master.execute_command("CLUSTER NODES") == expected_hidden_cluster_nodes
493495
assert await c_master_admin.execute_command("CLUSTER NODES") == expected_full_cluster_nodes
494496

495497
expected_hidden_cluster_shards = [
@@ -536,7 +538,8 @@ async def test_cluster_managed_service_info(df_factory):
536538
"online",
537539
]
538540
)
539-
assert await c_master.execute_command("CLUSTER SHARDS") == expected_full_cluster_shards
541+
# managed_service_info is ignored for cluster because we have "hidden" health for replica
542+
assert await c_master.execute_command("CLUSTER SHARDS") == expected_hidden_cluster_shards
540543
assert await c_master_admin.execute_command("CLUSTER SHARDS") == expected_full_cluster_shards
541544

542545
await c_master.execute_command("config set managed_service_info true")

0 commit comments

Comments
 (0)