diff --git a/core/trino-main/src/main/java/io/trino/SystemSessionProperties.java b/core/trino-main/src/main/java/io/trino/SystemSessionProperties.java index 4e4f94036880..a9adb2e606f8 100644 --- a/core/trino-main/src/main/java/io/trino/SystemSessionProperties.java +++ b/core/trino-main/src/main/java/io/trino/SystemSessionProperties.java @@ -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"; @@ -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, @@ -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) diff --git a/core/trino-main/src/main/java/io/trino/execution/QueryManagerConfig.java b/core/trino-main/src/main/java/io/trino/execution/QueryManagerConfig.java index d8c1da219ca1..a2da2503344e 100644 --- a/core/trino-main/src/main/java/io/trino/execution/QueryManagerConfig.java +++ b/core/trino-main/src/main/java/io/trino/execution/QueryManagerConfig.java @@ -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 { @@ -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); @@ -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; } diff --git a/core/trino-main/src/test/java/io/trino/execution/TestQueryManagerConfig.java b/core/trino-main/src/test/java/io/trino/execution/TestQueryManagerConfig.java index f5ef3873e1f4..6c3af821915b 100644 --- a/core/trino-main/src/test/java/io/trino/execution/TestQueryManagerConfig.java +++ b/core/trino-main/src/test/java/io/trino/execution/TestQueryManagerConfig.java @@ -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)) @@ -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") @@ -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)) diff --git a/docs/src/main/sphinx/admin/fault-tolerant-execution.md b/docs/src/main/sphinx/admin/fault-tolerant-execution.md index 3bf754c92f2f..5b6d578a0329 100644 --- a/docs/src/main/sphinx/admin/fault-tolerant-execution.md +++ b/docs/src/main/sphinx/admin/fault-tolerant-execution.md @@ -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` ::: diff --git a/testing/trino-testing/src/main/java/io/trino/testing/FaultTolerantExecutionConnectorTestHelper.java b/testing/trino-testing/src/main/java/io/trino/testing/FaultTolerantExecutionConnectorTestHelper.java index a68749ae025f..c8c98015489d 100644 --- a/testing/trino-testing/src/main/java/io/trino/testing/FaultTolerantExecutionConnectorTestHelper.java +++ b/testing/trino-testing/src/main/java/io/trino/testing/FaultTolerantExecutionConnectorTestHelper.java @@ -46,7 +46,7 @@ public static Map 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(); }