Skip to content

Commit

Permalink
Fix config property name to match semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
losipiuk committed Oct 4, 2024
1 parent c557560 commit b5d46e3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public final class SystemSessionProperties
public static final String QUERY_RETRY_ATTEMPTS = "query_retry_attempts";
public static final String TASK_RETRY_ATTEMPTS_PER_TASK = "task_retry_attempts_per_task";
public static final String MAX_TASKS_WAITING_FOR_EXECUTION_PER_QUERY = "max_tasks_waiting_for_execution_per_query";
public static final String MAX_TASKS_WAITING_FOR_NODE_PER_STAGE = "max_tasks_waiting_for_node_per_stage";
public static final String MAX_TASKS_WAITING_FOR_NODE_PER_QUERY = "max_tasks_waiting_for_node_per_query";
public static final String RETRY_INITIAL_DELAY = "retry_initial_delay";
public static final String RETRY_MAX_DELAY = "retry_max_delay";
public static final String RETRY_DELAY_SCALE_FACTOR = "retry_delay_scale_factor";
Expand Down Expand Up @@ -816,9 +816,9 @@ public SystemSessionProperties(
queryManagerConfig.getMaxTasksWaitingForExecutionPerQuery(),
false),
integerProperty(
MAX_TASKS_WAITING_FOR_NODE_PER_STAGE,
"Maximum possible number of tasks waiting for node allocation per stage before scheduling of new tasks for stage is paused",
queryManagerConfig.getMaxTasksWaitingForNodePerStage(),
MAX_TASKS_WAITING_FOR_NODE_PER_QUERY,
"Maximum possible number of tasks waiting for node allocation per query before scheduling of new tasks is paused",
queryManagerConfig.getMaxTasksWaitingForNodePerQuery(),
false),
durationProperty(
RETRY_INITIAL_DELAY,
Expand Down Expand Up @@ -1735,7 +1735,7 @@ public static int getMaxTasksWaitingForExecutionPerQuery(Session session)

public static int getMaxTasksWaitingForNodePerStage(Session session)
{
return session.getSystemProperty(MAX_TASKS_WAITING_FOR_NODE_PER_STAGE, Integer.class);
return session.getSystemProperty(MAX_TASKS_WAITING_FOR_NODE_PER_QUERY, Integer.class);
}

public static Duration getRetryInitialDelay(Session session)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"query.queue-config-file",
"query.remote-task.max-consecutive-error-count",
"query.remote-task.min-error-duration",
"retry-attempts",
"retry-attempts"
})
public class QueryManagerConfig
{
Expand Down Expand Up @@ -108,7 +108,7 @@ public class QueryManagerConfig
private double retryDelayScaleFactor = 2.0;

private int maxTasksWaitingForExecutionPerQuery = 10;
private int maxTasksWaitingForNodePerStage = 5;
private int maxTasksWaitingForNodePerQuery = 5;

private boolean enabledAdaptiveTaskRequestSize = true;
private DataSize maxRemoteTaskRequestSize = DataSize.of(8, MEGABYTE);
Expand Down Expand Up @@ -679,16 +679,17 @@ public QueryManagerConfig setMaxTasksWaitingForExecutionPerQuery(int maxTasksWai
}

@Min(1)
public int getMaxTasksWaitingForNodePerStage()
public int getMaxTasksWaitingForNodePerQuery()
{
return maxTasksWaitingForNodePerStage;
return maxTasksWaitingForNodePerQuery;
}

@Config("max-tasks-waiting-for-node-per-stage")
@ConfigDescription("Maximum possible number of tasks waiting for node allocation per stage before scheduling of new tasks for stage is paused")
public QueryManagerConfig setMaxTasksWaitingForNodePerStage(int maxTasksWaitingForNodePerStage)
@Config("max-tasks-waiting-for-node-per-query")
@LegacyConfig("max-tasks-waiting-for-node-per-stage") // TODO drop this alltogether in couple releases as name is misleading
@ConfigDescription("Maximum possible number of tasks waiting for node allocation per query before scheduling of new tasks for query is paused")
public QueryManagerConfig setMaxTasksWaitingForNodePerQuery(int maxTasksWaitingForNodePerQuery)
{
this.maxTasksWaitingForNodePerStage = maxTasksWaitingForNodePerStage;
this.maxTasksWaitingForNodePerQuery = maxTasksWaitingForNodePerQuery;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void testDefaults()
.setRetryMaxDelay(new Duration(1, MINUTES))
.setRetryDelayScaleFactor(2.0)
.setMaxTasksWaitingForExecutionPerQuery(10)
.setMaxTasksWaitingForNodePerStage(5)
.setMaxTasksWaitingForNodePerQuery(5)
.setEnabledAdaptiveTaskRequestSize(true)
.setMaxRemoteTaskRequestSize(DataSize.of(8, DataSize.Unit.MEGABYTE))
.setRemoteTaskRequestSizeHeadroom(DataSize.of(2, DataSize.Unit.MEGABYTE))
Expand Down Expand Up @@ -160,7 +160,7 @@ public void testExplicitPropertyMappings()
.put("retry-max-delay", "1h")
.put("retry-delay-scale-factor", "2.3")
.put("max-tasks-waiting-for-execution-per-query", "22")
.put("max-tasks-waiting-for-node-per-stage", "3")
.put("max-tasks-waiting-for-node-per-query", "3")
.put("query.remote-task.enable-adaptive-request-size", "false")
.put("query.remote-task.max-request-size", "10MB")
.put("query.remote-task.request-size-headroom", "1MB")
Expand Down Expand Up @@ -238,7 +238,7 @@ public void testExplicitPropertyMappings()
.setRetryMaxDelay(new Duration(1, HOURS))
.setRetryDelayScaleFactor(2.3)
.setMaxTasksWaitingForExecutionPerQuery(22)
.setMaxTasksWaitingForNodePerStage(3)
.setMaxTasksWaitingForNodePerQuery(3)
.setEnabledAdaptiveTaskRequestSize(false)
.setMaxRemoteTaskRequestSize(DataSize.of(10, DataSize.Unit.MEGABYTE))
.setRemoteTaskRequestSizeHeadroom(DataSize.of(1, DataSize.Unit.MEGABYTE))
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/sphinx/admin/fault-tolerant-execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ fault-tolerant execution:
property](session-properties-definition).
- `50`
- Only `TASK`
* - `max-tasks-waiting-for-node-per-stage`
* - `max-tasks-waiting-for-node-per-query`
- Allow for up to configured number of tasks to wait for node allocation
per stage, before pausing scheduling for other tasks from this stage.
per query, before pausing scheduling for other tasks from this query.
- 5
- Only `TASK`
:::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static Map<String, String> getExtraProperties()
// enable exchange compression to follow production deployment recommendations
.put("exchange.compression-codec", "LZ4")
.put("max-tasks-waiting-for-execution-per-query", "2")
.put("max-tasks-waiting-for-node-per-stage", "2")
.put("max-tasks-waiting-for-node-per-query", "2")
.put("query.schedule-split-batch-size", "2")
.buildOrThrow();
}
Expand Down

0 comments on commit b5d46e3

Please sign in to comment.