Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cluster): disable parallel commit for cluster task #17034

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/query/service/src/clusters/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ impl ClusterHelper for Cluster {
)))
}

let mut futures = Vec::with_capacity(message.len());
let mut response = HashMap::with_capacity(message.len());
for (id, message) in message {
let node = get_node(&self.nodes, &id)?;

futures.push({
let do_action_with_retry = {
let config = GlobalConfig::instance();
let flight_address = node.flight_address.clone();
let node_secret = node.secret.clone();
Expand All @@ -161,7 +161,7 @@ impl ClusterHelper for Cluster {
)
.await
{
Ok(result) => return Ok((id, result)),
Ok(result) => return Ok(result),
Err(e)
if e.code() == ErrorCode::CANNOT_CONNECT_NODE
&& attempt < flight_params.retry_times =>
Expand All @@ -175,10 +175,12 @@ impl ClusterHelper for Cluster {
}
}
}
});
};

response.insert(id, do_action_with_retry.await?);
}
let responses: Vec<(String, Res)> = futures::future::try_join_all(futures).await?;
Ok(responses.into_iter().collect::<HashMap<String, Res>>())

Ok(response)
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/query/settings/src/settings_default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -965,16 +965,16 @@ impl DefaultSettings {
range: Some(SettingRange::Numeric(0..=1)),
}),
("flight_connection_max_retry_times", DefaultSettingValue {
value: UserSettingValue::UInt64(3),
value: UserSettingValue::UInt64(0),
desc: "The maximum retry count for cluster flight. Disable if 0.",
mode: SettingMode::Both,
range: Some(SettingRange::Numeric(0..=10)),
}),
("flight_connection_retry_interval", DefaultSettingValue {
value: UserSettingValue::UInt64(3),
value: UserSettingValue::UInt64(1),
desc: "The retry interval of cluster flight is in seconds.",
mode: SettingMode::Both,
range: Some(SettingRange::Numeric(0..=30)),
range: Some(SettingRange::Numeric(0..=10)),
}),
]);

Expand Down
Loading