Skip to content

Commit 09e3a5f

Browse files
committed
Append to server.labels instead of overwriting; remove engine-role-label
Signed-off-by: JaySon-Huang <[email protected]>
1 parent 2be364e commit 09e3a5f

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

dbms/src/Server/Server.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,19 +243,22 @@ struct TiFlashProxyConfig
243243
args_map["advertise-engine-addr"] = args_map["engine-addr"];
244244
args_map["engine-label"] = getProxyLabelByDisaggregatedMode(disaggregated_mode);
245245
// For tiflash write node, it should report a extra label with "key" == "engine-role-label"
246+
String extra_label;
246247
if (disaggregated_mode == DisaggregatedMode::Storage)
247-
args_map["engine-role-label"] = DISAGGREGATED_MODE_WRITE_ENGINE_ROLE;
248+
{
249+
extra_label = fmt::format("engine-role={}", DISAGGREGATED_MODE_WRITE_ENGINE_ROLE);
250+
}
248251
else if (disaggregated_mode == DisaggregatedMode::Compute)
249252
{
250253
// For compute node, explicitly add a label with `exclusive=no-data` to avoid Region
251254
// being placed to the compute node.
252255
// Related logic in pd-server:
253256
// https://github.com/tikv/pd/blob/v8.5.0/pkg/schedule/placement/label_constraint.go#L69-L95
254-
String new_labels = "exclusive=no-data";
255-
if (args_map.contains("labels"))
256-
new_labels = fmt::format("{},{}", args_map["labels"], new_labels);
257-
args_map["labels"] = new_labels;
257+
extra_label = "exclusive=no-data";
258258
}
259+
if (args_map.contains("labels"))
260+
extra_label = fmt::format("{},{}", args_map["labels"], extra_label);
261+
args_map["labels"] = extra_label;
259262

260263
#if SERVERLESS_PROXY == 1
261264
if (config.has("blacklist_file"))

0 commit comments

Comments
 (0)