You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by xt...@apache.org on 2023/02/02 09:11:55 UTC
[flink] branch master updated (68c78dcd0a1 -> 7bc18ef7c30)
This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
from 68c78dcd0a1 [FLINK-30803][python] Fix command line option '-py' to make it work well in per-job mode
new 80b755f803d [hotfix] Validate hybrid shuffle mode only execute in batch mode.
new 4d5283358fb [hotfix] Let NETWORK_BATCH_SHUFFLE_READ_MEMORY option's java doc and description also include hybrid shuffle.
new 439a4f7fc81 [hotfix] Fix typo of InputGateSpecUtils.
new 42345dd63c1 [hotfix] Avoid floating all buffers in the hybrid partition.
new 7bc18ef7c30 [FLINK-30674] Enabling consume partial finished partition by default for speculative execution in hybrid shuffle mode
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../generated/common_memory_section.html | 2 +-
.../task_manager_memory_configuration.html | 2 +-
.../flink/configuration/TaskManagerOptions.java | 6 ++--
...tGateSpecUitls.java => InputGateSpecUtils.java} | 6 +++-
.../partition/consumer/SingleInputGateFactory.java | 2 +-
.../AdaptiveBatchSchedulerFactory.java | 22 +++++++++++----
.../flink/runtime/shuffle/NettyShuffleUtils.java | 2 +-
.../partition/consumer/GateBuffersSpecTest.java | 33 +++++++++++-----------
.../partition/consumer/SingleInputGateTest.java | 4 +--
.../api/graph/StreamingJobGraphGenerator.java | 14 +++++++++
.../api/graph/StreamingJobGraphGeneratorTest.java | 26 +++++++++++++++++
11 files changed, 88 insertions(+), 31 deletions(-)
rename flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/{InputGateSpecUitls.java => InputGateSpecUtils.java} (93%)
[flink] 03/05: [hotfix] Fix typo of InputGateSpecUtils.
Posted by xt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 439a4f7fc81ba4336bd164a60483137de0b35cc0
Author: Weijie Guo <re...@163.com>
AuthorDate: Tue Jan 17 11:51:55 2023 +0800
[hotfix] Fix typo of InputGateSpecUtils.
---
.../{InputGateSpecUitls.java => InputGateSpecUtils.java} | 2 +-
.../network/partition/consumer/SingleInputGateFactory.java | 2 +-
.../org/apache/flink/runtime/shuffle/NettyShuffleUtils.java | 2 +-
.../io/network/partition/consumer/GateBuffersSpecTest.java | 12 ++++++------
.../io/network/partition/consumer/SingleInputGateTest.java | 4 ++--
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateSpecUitls.java b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateSpecUtils.java
similarity index 99%
rename from flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateSpecUitls.java
rename to flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateSpecUtils.java
index 55fe71d9234..6a7085ce84a 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateSpecUitls.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateSpecUtils.java
@@ -27,7 +27,7 @@ import static org.apache.flink.util.Preconditions.checkArgument;
import static org.apache.flink.util.Preconditions.checkState;
/** Utils to manage the specs of the {@link InputGate}, for example, {@link GateBuffersSpec}. */
-public class InputGateSpecUitls {
+public class InputGateSpecUtils {
public static final int DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_BATCH = 1000;
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGateFactory.java b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGateFactory.java
index 04378c99a40..98a5d8e04bb 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGateFactory.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGateFactory.java
@@ -56,7 +56,7 @@ import javax.annotation.Nonnull;
import java.io.IOException;
import java.util.Optional;
-import static org.apache.flink.runtime.io.network.partition.consumer.InputGateSpecUitls.createGateBuffersSpec;
+import static org.apache.flink.runtime.io.network.partition.consumer.InputGateSpecUtils.createGateBuffersSpec;
import static org.apache.flink.runtime.shuffle.ShuffleUtils.applyWithShuffleTypeCheck;
/** Factory for {@link SingleInputGate} to use in {@link NettyShuffleEnvironment}. */
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/shuffle/NettyShuffleUtils.java b/flink-runtime/src/main/java/org/apache/flink/runtime/shuffle/NettyShuffleUtils.java
index 947f0a976a5..0c78cb38dfb 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/shuffle/NettyShuffleUtils.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/shuffle/NettyShuffleUtils.java
@@ -28,7 +28,7 @@ import org.apache.commons.lang3.tuple.Pair;
import java.util.Map;
import java.util.Optional;
-import static org.apache.flink.runtime.io.network.partition.consumer.InputGateSpecUitls.createGateBuffersSpec;
+import static org.apache.flink.runtime.io.network.partition.consumer.InputGateSpecUtils.createGateBuffersSpec;
import static org.apache.flink.util.Preconditions.checkNotNull;
import static org.apache.flink.util.Preconditions.checkState;
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/GateBuffersSpecTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/GateBuffersSpecTest.java
index 8161d00c0d1..4ddd7cbb4ea 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/GateBuffersSpecTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/GateBuffersSpecTest.java
@@ -27,7 +27,7 @@ import org.junit.runners.Parameterized;
import java.util.Optional;
-import static org.apache.flink.runtime.io.network.partition.consumer.InputGateSpecUitls.getEffectiveMaxRequiredBuffersPerGate;
+import static org.apache.flink.runtime.io.network.partition.consumer.InputGateSpecUtils.getEffectiveMaxRequiredBuffersPerGate;
import static org.assertj.core.api.Assertions.assertThat;
/** Tests for {@link GateBuffersSpec}. */
@@ -146,8 +146,8 @@ class GateBuffersSpecTest {
getEffectiveMaxRequiredBuffersPerGate(partitionType, emptyConfig);
int expectEffectiveMaxRequiredBuffers =
isPipelineResultPartition(partitionType)
- ? InputGateSpecUitls.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_STREAM
- : InputGateSpecUitls.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_BATCH;
+ ? InputGateSpecUtils.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_STREAM
+ : InputGateSpecUtils.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_BATCH;
assertThat(effectiveMaxRequiredBuffers).isEqualTo(expectEffectiveMaxRequiredBuffers);
Optional<Integer> configuredMaxRequiredBuffers = Optional.of(100);
@@ -179,7 +179,7 @@ class GateBuffersSpecTest {
int numInputChannels,
ResultPartitionType partitionType,
int numExclusiveBuffersPerChannel) {
- return InputGateSpecUitls.createGateBuffersSpec(
+ return InputGateSpecUtils.createGateBuffersSpec(
getMaxRequiredBuffersPerGate(partitionType),
numExclusiveBuffersPerChannel,
8,
@@ -190,8 +190,8 @@ class GateBuffersSpecTest {
private static Optional<Integer> getMaxRequiredBuffersPerGate(
ResultPartitionType partitionType) {
return isPipelineResultPartition(partitionType)
- ? Optional.of(InputGateSpecUitls.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_STREAM)
- : Optional.of(InputGateSpecUitls.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_BATCH);
+ ? Optional.of(InputGateSpecUtils.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_STREAM)
+ : Optional.of(InputGateSpecUtils.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_BATCH);
}
private static boolean isPipelineResultPartition(ResultPartitionType partitionType) {
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGateTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGateTest.java
index e591d1e7951..2ae6025db09 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGateTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGateTest.java
@@ -1223,9 +1223,9 @@ public class SingleInputGateTest extends InputGateTestBase {
Optional<Integer> expectMaxRequiredBuffersPerGate =
isPipeline
? Optional.of(
- InputGateSpecUitls.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_STREAM)
+ InputGateSpecUtils.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_STREAM)
: Optional.of(
- InputGateSpecUitls.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_BATCH);
+ InputGateSpecUtils.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_BATCH);
nettyShuffleEnvironmentBuilder.setMaxRequiredBuffersPerGate(
expectMaxRequiredBuffersPerGate);
NettyShuffleEnvironment netEnv = nettyShuffleEnvironmentBuilder.build();
[flink] 01/05: [hotfix] Validate hybrid shuffle mode only execute in batch mode.
Posted by xt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 80b755f803d9609eeac83327cf0c934d51a7233f
Author: Weijie Guo <re...@163.com>
AuthorDate: Fri Jan 13 16:44:12 2023 +0800
[hotfix] Validate hybrid shuffle mode only execute in batch mode.
---
.../api/graph/StreamingJobGraphGenerator.java | 14 ++++++++++++
.../api/graph/StreamingJobGraphGeneratorTest.java | 26 ++++++++++++++++++++++
2 files changed, 40 insertions(+)
diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGenerator.java b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGenerator.java
index c960664e840..cd78954990f 100644
--- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGenerator.java
+++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGenerator.java
@@ -21,6 +21,7 @@ import org.apache.flink.annotation.Internal;
import org.apache.flink.annotation.VisibleForTesting;
import org.apache.flink.api.common.ExecutionConfig;
import org.apache.flink.api.common.JobID;
+import org.apache.flink.api.common.RuntimeExecutionMode;
import org.apache.flink.api.common.cache.DistributedCache;
import org.apache.flink.api.common.functions.Function;
import org.apache.flink.api.common.operators.ResourceSpec;
@@ -41,6 +42,7 @@ import org.apache.flink.runtime.jobgraph.IntermediateDataSetID;
import org.apache.flink.runtime.jobgraph.JobEdge;
import org.apache.flink.runtime.jobgraph.JobGraph;
import org.apache.flink.runtime.jobgraph.JobGraphUtils;
+import org.apache.flink.runtime.jobgraph.JobType;
import org.apache.flink.runtime.jobgraph.JobVertex;
import org.apache.flink.runtime.jobgraph.JobVertexID;
import org.apache.flink.runtime.jobgraph.OperatorID;
@@ -243,6 +245,8 @@ public class StreamingJobGraphGenerator {
markSupportingConcurrentExecutionAttempts();
+ validateHybridShuffleExecuteInBatchMode();
+
setSlotSharingAndCoLocation();
setManagedMemoryFraction(
@@ -1467,6 +1471,16 @@ public class StreamingJobGraphGenerator {
}
}
+ private void validateHybridShuffleExecuteInBatchMode() {
+ if (hasHybridResultPartition) {
+ checkState(
+ jobGraph.getJobType() == JobType.BATCH,
+ "hybrid shuffle mode only supports batch job, please set %s to %s",
+ ExecutionOptions.RUNTIME_MODE.key(),
+ RuntimeExecutionMode.BATCH.name());
+ }
+ }
+
/**
* Maps a vertex to its region slot sharing group. If {@link
* StreamGraph#isAllVerticesInSameSlotSharingGroupByDefault()} returns true, all regions will be
diff --git a/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGeneratorTest.java b/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGeneratorTest.java
index 7e81cbda762..67969d8c512 100644
--- a/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGeneratorTest.java
+++ b/flink-streaming-java/src/test/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGeneratorTest.java
@@ -813,6 +813,7 @@ class StreamingJobGraphGeneratorTest {
@Test
void testExchangeModeHybridFull() {
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
+ env.setRuntimeMode(RuntimeExecutionMode.BATCH);
// fromElements -> Map -> Print
DataStream<Integer> sourceDataStream = env.fromElements(1, 2, 3);
@@ -852,6 +853,7 @@ class StreamingJobGraphGeneratorTest {
@Test
void testExchangeModeHybridSelective() {
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
+ env.setRuntimeMode(RuntimeExecutionMode.BATCH);
// fromElements -> Map -> Print
DataStream<Integer> sourceDataStream = env.fromElements(1, 2, 3);
@@ -1367,6 +1369,30 @@ class StreamingJobGraphGeneratorTest {
.isCloseTo(expectedBatchFrac, Offset.offset(delta));
}
+ @Test
+ void testHybridShuffleModeInNonBatchMode() {
+ Configuration configuration = new Configuration();
+ // set all edge to HYBRID_FULL result partition type.
+ configuration.set(
+ ExecutionOptions.BATCH_SHUFFLE_MODE, BatchShuffleMode.ALL_EXCHANGES_HYBRID_FULL);
+ configuration.set(ExecutionOptions.RUNTIME_MODE, RuntimeExecutionMode.STREAMING);
+ StreamExecutionEnvironment env =
+ StreamExecutionEnvironment.getExecutionEnvironment(configuration);
+ env.disableOperatorChaining();
+ DataStreamSource<Integer> source = env.fromElements(1, 2, 3);
+ final DataStream<Integer> partitioned =
+ new DataStream<>(
+ env,
+ new PartitionTransformation<>(
+ source.getTransformation(),
+ new RebalancePartitioner<>(),
+ StreamExchangeMode.HYBRID_FULL));
+ partitioned.addSink(new DiscardingSink<>());
+ StreamGraph streamGraph = env.getStreamGraph();
+ assertThatThrownBy(() -> StreamingJobGraphGenerator.createJobGraph(streamGraph))
+ .isInstanceOf(IllegalStateException.class);
+ }
+
@Test
void testSetNonDefaultSlotSharingInHybridMode() {
Configuration configuration = new Configuration();
[flink] 04/05: [hotfix] Avoid floating all buffers in the hybrid partition.
Posted by xt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 42345dd63c18b6bc8b5098011693014a852876b0
Author: Weijie Guo <re...@163.com>
AuthorDate: Tue Jan 17 11:33:54 2023 +0800
[hotfix] Avoid floating all buffers in the hybrid partition.
---
.../partition/consumer/InputGateSpecUtils.java | 4 ++++
.../partition/consumer/GateBuffersSpecTest.java | 21 +++++++++++----------
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateSpecUtils.java b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateSpecUtils.java
index 6a7085ce84a..08dc3c5a308 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateSpecUtils.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/InputGateSpecUtils.java
@@ -84,6 +84,10 @@ public class InputGateSpecUtils {
return configuredMaxRequiredBuffersPerGate.orElseGet(
() ->
partitionType.isPipelinedOrPipelinedBoundedResultPartition()
+ // hybrid partition may calculate a backlog that is larger
+ // than the accurate value. If all buffers are floating, it
+ // will seriously affect the performance.
+ || partitionType.isHybridResultPartition()
? DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_STREAM
: DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_BATCH);
}
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/GateBuffersSpecTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/GateBuffersSpecTest.java
index 4ddd7cbb4ea..70c8dffc807 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/GateBuffersSpecTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/consumer/GateBuffersSpecTest.java
@@ -63,10 +63,10 @@ class GateBuffersSpecTest {
int numInputChannels = 500;
GateBuffersSpec gateBuffersSpec = createGateBuffersSpec(numInputChannels, partitionType);
- boolean isPipeline = isPipelineResultPartition(partitionType);
+ boolean isPipeline = isPipelinedOrHybridResultPartition(partitionType);
int minFloating = isPipeline ? 1 : 500;
- int maxFloating = isPipelineResultPartition(partitionType) ? 8 : 508;
- int numExclusivePerChannel = isPipelineResultPartition(partitionType) ? 2 : 1;
+ int maxFloating = isPipelinedOrHybridResultPartition(partitionType) ? 8 : 508;
+ int numExclusivePerChannel = isPipelinedOrHybridResultPartition(partitionType) ? 2 : 1;
int targetTotalBuffersPerGate = 1008;
checkBuffersInGate(
@@ -84,8 +84,8 @@ class GateBuffersSpecTest {
GateBuffersSpec gateBuffersSpec = createGateBuffersSpec(numInputChannels, partitionType);
int minFloating = 1;
- int maxFloating = isPipelineResultPartition(partitionType) ? 8 : 1007;
- int numExclusivePerChannel = isPipelineResultPartition(partitionType) ? 2 : 1;
+ int maxFloating = isPipelinedOrHybridResultPartition(partitionType) ? 8 : 1007;
+ int numExclusivePerChannel = isPipelinedOrHybridResultPartition(partitionType) ? 2 : 1;
int targetTotalBuffersPerGate = 2006;
checkBuffersInGate(
@@ -102,7 +102,7 @@ class GateBuffersSpecTest {
int numInputChannels = 1000;
GateBuffersSpec gateBuffersSpec = createGateBuffersSpec(numInputChannels, partitionType);
- boolean isPipeline = isPipelineResultPartition(partitionType);
+ boolean isPipeline = isPipelinedOrHybridResultPartition(partitionType);
int minFloating = isPipeline ? 1 : 1000;
int maxFloating = isPipeline ? 8 : numInputChannels * 2 + 8;
int numExclusivePerChannel = isPipeline ? 2 : 0;
@@ -145,7 +145,7 @@ class GateBuffersSpecTest {
int effectiveMaxRequiredBuffers =
getEffectiveMaxRequiredBuffersPerGate(partitionType, emptyConfig);
int expectEffectiveMaxRequiredBuffers =
- isPipelineResultPartition(partitionType)
+ isPipelinedOrHybridResultPartition(partitionType)
? InputGateSpecUtils.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_STREAM
: InputGateSpecUtils.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_BATCH;
assertThat(effectiveMaxRequiredBuffers).isEqualTo(expectEffectiveMaxRequiredBuffers);
@@ -189,12 +189,13 @@ class GateBuffersSpecTest {
private static Optional<Integer> getMaxRequiredBuffersPerGate(
ResultPartitionType partitionType) {
- return isPipelineResultPartition(partitionType)
+ return isPipelinedOrHybridResultPartition(partitionType)
? Optional.of(InputGateSpecUtils.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_STREAM)
: Optional.of(InputGateSpecUtils.DEFAULT_MAX_REQUIRED_BUFFERS_PER_GATE_FOR_BATCH);
}
- private static boolean isPipelineResultPartition(ResultPartitionType partitionType) {
- return partitionType.isPipelinedOrPipelinedBoundedResultPartition();
+ private static boolean isPipelinedOrHybridResultPartition(ResultPartitionType partitionType) {
+ return partitionType.isPipelinedOrPipelinedBoundedResultPartition()
+ || partitionType.isHybridResultPartition();
}
}
[flink] 05/05: [FLINK-30674] Enabling consume partial finished partition by default for speculative execution in hybrid shuffle mode
Posted by xt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 7bc18ef7c3065b8c2210f66b2329dc6bdf49ff56
Author: Weijie Guo <re...@163.com>
AuthorDate: Fri Jan 13 17:05:44 2023 +0800
[FLINK-30674] Enabling consume partial finished partition by default for speculative execution in hybrid shuffle mode
This closes #21804
---
.../AdaptiveBatchSchedulerFactory.java | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptivebatch/AdaptiveBatchSchedulerFactory.java b/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptivebatch/AdaptiveBatchSchedulerFactory.java
index 7e69a0762b8..73712faeacc 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptivebatch/AdaptiveBatchSchedulerFactory.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptivebatch/AdaptiveBatchSchedulerFactory.java
@@ -71,6 +71,7 @@ import org.apache.flink.util.Preconditions;
import org.apache.flink.util.concurrent.ScheduledExecutorServiceAdapter;
import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
@@ -78,7 +79,6 @@ import java.util.concurrent.Executor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Consumer;
-import static org.apache.flink.configuration.JobManagerOptions.HybridPartitionDataConsumeConstraint.ALL_PRODUCERS_FINISHED;
import static org.apache.flink.configuration.JobManagerOptions.HybridPartitionDataConsumeConstraint.ONLY_FINISHED_PRODUCERS;
import static org.apache.flink.configuration.JobManagerOptions.HybridPartitionDataConsumeConstraint.UNFINISHED_PRODUCERS;
import static org.apache.flink.util.Preconditions.checkState;
@@ -86,6 +86,8 @@ import static org.apache.flink.util.Preconditions.checkState;
/** Factory for {@link AdaptiveBatchScheduler}. */
public class AdaptiveBatchSchedulerFactory implements SchedulerNGFactory {
+ private static final Logger LOG = LoggerFactory.getLogger(AdaptiveBatchSchedulerFactory.class);
+
@Override
public SchedulerNG createInstance(
Logger log,
@@ -263,10 +265,20 @@ public class AdaptiveBatchSchedulerFactory implements SchedulerNGFactory {
final HybridPartitionDataConsumeConstraint hybridPartitionDataConsumeConstraint =
configuration
.getOptional(JobManagerOptions.HYBRID_PARTITION_DATA_CONSUME_CONSTRAINT)
- .orElse(
- enableSpeculativeExecution
- ? ALL_PRODUCERS_FINISHED
- : UNFINISHED_PRODUCERS);
+ .orElseGet(
+ () -> {
+ HybridPartitionDataConsumeConstraint defaultConstraint =
+ enableSpeculativeExecution
+ ? ONLY_FINISHED_PRODUCERS
+ : UNFINISHED_PRODUCERS;
+ LOG.info(
+ "Set {} to {} as it is not configured",
+ JobManagerOptions
+ .HYBRID_PARTITION_DATA_CONSUME_CONSTRAINT
+ .key(),
+ defaultConstraint.name());
+ return defaultConstraint;
+ });
if (enableSpeculativeExecution) {
Preconditions.checkState(
hybridPartitionDataConsumeConstraint != UNFINISHED_PRODUCERS,
[flink] 02/05: [hotfix] Let NETWORK_BATCH_SHUFFLE_READ_MEMORY option's java doc and description also include hybrid shuffle.
Posted by xt...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xtsong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git
commit 4d5283358fb3e084900e6182c8365f566aefef51
Author: Weijie Guo <re...@163.com>
AuthorDate: Fri Jan 13 16:50:28 2023 +0800
[hotfix] Let NETWORK_BATCH_SHUFFLE_READ_MEMORY option's java doc and description also include hybrid shuffle.
---
docs/layouts/shortcodes/generated/common_memory_section.html | 2 +-
.../shortcodes/generated/task_manager_memory_configuration.html | 2 +-
.../java/org/apache/flink/configuration/TaskManagerOptions.java | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/docs/layouts/shortcodes/generated/common_memory_section.html b/docs/layouts/shortcodes/generated/common_memory_section.html
index 9ee881a7cb6..7b9e787770a 100644
--- a/docs/layouts/shortcodes/generated/common_memory_section.html
+++ b/docs/layouts/shortcodes/generated/common_memory_section.html
@@ -78,7 +78,7 @@
<td><h5>taskmanager.memory.framework.off-heap.batch-shuffle.size</h5></td>
<td style="word-wrap: break-word;">64 mb</td>
<td>MemorySize</td>
- <td>Size of memory used by blocking shuffle for shuffle data read (currently only used by sort-shuffle and hybrid shuffle). Notes: 1) The memory is cut from 'taskmanager.memory.framework.off-heap.size' so must be smaller than that, which means you may also need to increase 'taskmanager.memory.framework.off-heap.size' after you increase this config value; 2) This memory size can influence the shuffle performance and you can increase this config value for large-scale batch jobs [...]
+ <td>Size of memory used by batch shuffle for shuffle data read (currently only used by sort-shuffle and hybrid shuffle). Notes: 1) The memory is cut from 'taskmanager.memory.framework.off-heap.size' so must be smaller than that, which means you may also need to increase 'taskmanager.memory.framework.off-heap.size' after you increase this config value; 2) This memory size can influence the shuffle performance and you can increase this config value for large-scale batch jobs (f [...]
</tr>
<tr>
<td><h5>taskmanager.memory.framework.off-heap.size</h5></td>
diff --git a/docs/layouts/shortcodes/generated/task_manager_memory_configuration.html b/docs/layouts/shortcodes/generated/task_manager_memory_configuration.html
index 94bd90cecce..966a349895a 100644
--- a/docs/layouts/shortcodes/generated/task_manager_memory_configuration.html
+++ b/docs/layouts/shortcodes/generated/task_manager_memory_configuration.html
@@ -24,7 +24,7 @@
<td><h5>taskmanager.memory.framework.off-heap.batch-shuffle.size</h5></td>
<td style="word-wrap: break-word;">64 mb</td>
<td>MemorySize</td>
- <td>Size of memory used by blocking shuffle for shuffle data read (currently only used by sort-shuffle and hybrid shuffle). Notes: 1) The memory is cut from 'taskmanager.memory.framework.off-heap.size' so must be smaller than that, which means you may also need to increase 'taskmanager.memory.framework.off-heap.size' after you increase this config value; 2) This memory size can influence the shuffle performance and you can increase this config value for large-scale batch jobs [...]
+ <td>Size of memory used by batch shuffle for shuffle data read (currently only used by sort-shuffle and hybrid shuffle). Notes: 1) The memory is cut from 'taskmanager.memory.framework.off-heap.size' so must be smaller than that, which means you may also need to increase 'taskmanager.memory.framework.off-heap.size' after you increase this config value; 2) This memory size can influence the shuffle performance and you can increase this config value for large-scale batch jobs (f [...]
</tr>
<tr>
<td><h5>taskmanager.memory.framework.off-heap.size</h5></td>
diff --git a/flink-core/src/main/java/org/apache/flink/configuration/TaskManagerOptions.java b/flink-core/src/main/java/org/apache/flink/configuration/TaskManagerOptions.java
index 66db0e9ce5f..0ea1430b3f7 100644
--- a/flink-core/src/main/java/org/apache/flink/configuration/TaskManagerOptions.java
+++ b/flink-core/src/main/java/org/apache/flink/configuration/TaskManagerOptions.java
@@ -580,8 +580,8 @@ public class TaskManagerOptions {
+ "Can be used to avoid constant back and forth small adjustments.");
/**
- * Size of direct memory used by blocking shuffle for shuffle data read (currently only used by
- * sort-shuffle).
+ * Size of direct memory used by batch shuffle for shuffle data read (currently only used by
+ * sort-shuffle and hybrid shuffle).
*/
@Documentation.Section(Documentation.Sections.COMMON_MEMORY)
public static final ConfigOption<MemorySize> NETWORK_BATCH_SHUFFLE_READ_MEMORY =
@@ -590,7 +590,7 @@ public class TaskManagerOptions {
.defaultValue(MemorySize.parse("64m"))
.withDescription(
String.format(
- "Size of memory used by blocking shuffle for shuffle data read "
+ "Size of memory used by batch shuffle for shuffle data read "
+ "(currently only used by sort-shuffle and hybrid shuffle)."
+ " Notes: 1) The memory is cut from '%s' so must be smaller than"
+ " that, which means you may also need to increase '%s' "