[ 
https://issues.apache.org/jira/browse/FLINK-40505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martijn Visser updated FLINK-40505:
-----------------------------------
    Fix Version/s: 2.4.1
                   2.5.0
                   1.20.7
                   2.3.2

> SourceCoordinator never removes failed or reset subtasks from 
> watermark-alignment aggregation
> ---------------------------------------------------------------------------------------------
>
>                 Key: FLINK-40505
>                 URL: https://issues.apache.org/jira/browse/FLINK-40505
>             Project: Flink
>          Issue Type: Bug
>          Components: Runtime / Coordination
>            Reporter: Martijn Visser
>            Assignee: Martijn Visser
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 2.4.1, 2.5.0, 1.20.7, 2.3.2
>
>
> The per-subtask watermark aggregation used for watermark alignment keeps a 
> subtask's last {{ReportedWatermarkEvent}} across failures and resets. 
> {{executionAttemptFailed}} and {{subtaskReset}} clear the registered readers 
> but never touch the {{WatermarkAggregator}}: neither the one in the 
> {{SourceCoordinator}} nor the group-level one in the {{CoordinatorStore}}.
> After a failover, the failed attempt's watermark keeps bounding 
> {{maxAllowedWatermark}} for the whole alignment group until the restarted 
> attempt reports again. If it never reports, for example because its restored 
> splits are idle, the group stays bound for good. The retained value isn't a 
> safe bound either, because the restarted attempt can resume from an earlier 
> position than its last report. A global failover recreates the coordinator on 
> the same {{CoordinatorStore}}, so the group-level entry survives that too.
> Example: two subtasks report 100 and 200 with a drift of 1000, so the 
> announced maximum is 1100. After the subtask that reported 100 fails and is 
> reset, the announcement stays at 1100 instead of 1200.
> Fix: remove the subtask's watermark when its attempt fails, and again on 
> reset. A source without watermarks leaves the group instead of adding 
> {{Long.MIN_VALUE}}, and {{close()}} removes the entry the coordinator wrote. 
> While a subtask restarts, it no longer holds back the other sources of its 
> group. Any operator that consumes from both is in the same pipelined region, 
> so it restarts with the subtask.
> A subtask still gets no alignment bound until its first report; that is 
> FLINK-36914 and isn't changed here. FLINK-33109 reported the same symptom and 
> was closed as an HA artifact. FLINK-32414 fixed a related {{Long.MIN_VALUE}} 
> case for subtasks without splits. FLINK-40371 is related but not caused by 
> this, because a restart from a savepoint creates a new {{CoordinatorStore}}.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to