[
https://issues.apache.org/jira/browse/BEAM-9824?focusedWorklogId=427988&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-427988
]
ASF GitHub Bot logged work on BEAM-9824:
----------------------------------------
Author: ASF GitHub Bot
Created on: 28/Apr/20 06:08
Start Date: 28/Apr/20 06:08
Worklog Time Spent: 10m
Work Description: dmvk commented on a change in pull request #11530:
URL: https://github.com/apache/beam/pull/11530#discussion_r416351768
##########
File path:
runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkBatchTransformTranslators.java
##########
@@ -330,7 +331,12 @@ public void translateNode(
outputType,
FlinkIdentityFunction.of(),
getCurrentTransformName(context));
- context.setOutputDataSet(context.getOutput(transform),
retypedDataSet.rebalance());
+ final Configuration partitionOptions = new Configuration();
+ partitionOptions.setString(
+ Optimizer.HINT_SHIP_STRATEGY,
Optimizer.HINT_SHIP_STRATEGY_REPARTITION);
Review comment:
yes, it should be
`SHIP_REPARTITION` gets intepreted as `PARTITION_RANDOM`
```java
} else if
(shipStrategy.equalsIgnoreCase(Optimizer.HINT_SHIP_STRATEGY_REPARTITION)) {
preSet = ShipStrategyType.PARTITION_RANDOM;
```
which should have exactly the same impl as `PARTITION_FORCED_REBALANCE`
from
`org.apache.flink.runtime.operators.shipping.OutputEmitter#selectChannel`:
```java
@Override
public final int selectChannel(SerializationDelegate<T> record) {
switch (strategy) {
case FORWARD:
return forward();
case PARTITION_RANDOM:
case PARTITION_FORCED_REBALANCE:
return robin(numberOfChannels);
case PARTITION_HASH:
return hashPartitionDefault(record.getInstance(),
numberOfChannels);
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 427988)
Time Spent: 40m (was: 0.5h)
> Multiple reshuffles are ignored in some cases on Flink batch runner.
> --------------------------------------------------------------------
>
> Key: BEAM-9824
> URL: https://issues.apache.org/jira/browse/BEAM-9824
> Project: Beam
> Issue Type: Bug
> Components: runner-flink
> Affects Versions: 2.19.0, 2.20.0
> Reporter: David Morávek
> Assignee: David Morávek
> Priority: Major
> Fix For: 2.22.0
>
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Multiple reshuffles are ignored in some cases on Flink batch runner. This may
> lead to huge performace penalty in IO connectors (when reshuffling splits).
> In flink optimizer, when we `.rebalance()` dataset, is output channel is
> marked as `FORCED_REBALANCED`. When we chain this with another
> `.rebalance()`, the latter is ignored because it's source is already
> `FORCED_REBALANCED`, thus requested property is met. This is correct beaviour
> because rebalance is idempotent.
> When we include `flatMap` in between rebalances ->
> `.rebalance().flatMap(...).rebalance()`, we need to reshuffle again, because
> dataset distribution may have changed (eg. you can possibli emit unbouded
> stream from a single element). Unfortunatelly `flatMap` output is still
> incorrectly marked as `FORCED_REBALANCED` and the second reshuffle gets
> ignored.
> This especially affects IO connectors -> `FileIO.match()` returns reshuffled
> list of matched files -> we split each file into ranges -> **reshuffle** ->
> read. Ignoring the second reshuffle leads to huge perf. degradation (5m -> 2h
> in one of our production pipelines)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)