Skip to content

Commit

Permalink
session: rename query_plan -> request_plan
Browse files Browse the repository at this point in the history
  • Loading branch information
muzarski committed Dec 23, 2024
1 parent f68bb95 commit 8429b53
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions scylla/src/transport/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1948,11 +1948,11 @@ where

let runner = async {
let cluster_data = self.cluster.get_data();
let query_plan =
let request_plan =
load_balancing::Plan::new(load_balancer.as_ref(), &statement_info, &cluster_data);

// If a speculative execution policy is used to run query, query_plan has to be shared
// between different async functions. This struct helps to wrap query_plan in mutex so it
// If a speculative execution policy is used to run query, request_plan has to be shared
// between different async functions. This struct helps to wrap request_plan in mutex so it
// can be shared safely.
struct SharedPlan<'a, I>
where
Expand Down Expand Up @@ -1981,8 +1981,8 @@ where

match speculative_policy {
Some(speculative) if statement_config.is_idempotent => {
let shared_query_plan = SharedPlan {
iter: std::sync::Mutex::new(query_plan),
let shared_request_plan = SharedPlan {
iter: std::sync::Mutex::new(request_plan),
};

let request_runner_generator = |is_speculative: bool| {
Expand All @@ -2007,7 +2007,7 @@ where
}

self.execute_request_with_retries(
&shared_query_plan,
&shared_request_plan,
&execute_request_once,
&execution_profile,
ExecuteRequestContext {
Expand Down Expand Up @@ -2042,7 +2042,7 @@ where
speculative_id: None,
});
self.execute_request_with_retries(
query_plan,
request_plan,
&execute_request_once,
&execution_profile,
ExecuteRequestContext {
Expand Down Expand Up @@ -2093,7 +2093,7 @@ where
/// Returns None, if provided plan is empty.
async fn execute_request_with_retries<'a, QueryFut, ResT>(
&'a self,
query_plan: impl Iterator<Item = (NodeRef<'a>, Shard)>,
request_plan: impl Iterator<Item = (NodeRef<'a>, Shard)>,
execute_request_once: impl Fn(Arc<Connection>, Consistency, &ExecutionProfileInner) -> QueryFut,
execution_profile: &ExecutionProfileInner,
mut context: ExecuteRequestContext<'a>,
Expand All @@ -2107,7 +2107,7 @@ where
.consistency_set_on_statement
.unwrap_or(execution_profile.consistency);

'nodes_in_plan: for (node, shard) in query_plan {
'nodes_in_plan: for (node, shard) in request_plan {
let span = trace_span!("Executing query", node = %node.address);
'same_node_retries: loop {
trace!(parent: &span, "Execution started");
Expand Down

0 comments on commit 8429b53

Please sign in to comment.