Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(1.11) [FLINK-21132][runtime] Don't end input on stop with savepoint #14814

Merged
merged 5 commits into from
Feb 3, 2021

Conversation

rkhachatryan
Copy link
Contributor

@rkhachatryan rkhachatryan commented Jan 29, 2021

What is the purpose of the change

(1.11 backport)

EndOfInput was used to handle any stopping of the job. When
stopping with savepoint the input is not actually ended.
This causes issues with some sinks (e.g. Iceberg).

With this change, endInput is not call for stop-with-savepoint.

To differentiate stop-with-savepoint from other cases
only checkpoint (RPC/barriers) are considered and not network EOP.
That's enough because EOP is only injected after the CP completion
(i.e. when the downstream is also notified by sync savepoint by CP
barriers).

Verifying this change

  • Added SavepointITCase (testStopSavepointWithBoundedInput, testStopSavepointWithBoundedInputConcurrently)
  • Added StreamTaskTest (testSyncSavepointAborted,testSyncSavepointAbortedAsync,testSyncSavepointCompleted)

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): yes (endInput is not called anymore for stop-with-savepoint)
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no
  • If yes, how is the feature documented? no

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 29, 2021

Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.

Automated Checks

Last check on commit 71e3f69 (Fri May 28 08:16:53 UTC 2021)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

Review Progress

  • ❓ 1. The [description] looks good.
  • ❓ 2. There is [consensus] that the contribution should go into to Flink.
  • ❓ 3. Needs [attention] from.
  • ❓ 4. The change fits into the overall [architecture].
  • ❓ 5. Overall code [quality] is good.

Please see the Pull Request Review Guide for a full explanation of the review process.


The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commands
The @flinkbot bot supports the following commands:

  • @flinkbot approve description to approve one or more aspects (aspects: description, consensus, architecture and quality)
  • @flinkbot approve all to approve all aspects
  • @flinkbot approve-until architecture to approve everything until architecture
  • @flinkbot attention @username1 [@username2 ..] to require somebody's attention
  • @flinkbot disapprove architecture to remove an approval you gave earlier

@flinkbot
Copy link
Collaborator

flinkbot commented Jan 29, 2021

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build
  • @flinkbot run azure re-run the last Azure build

@rkhachatryan rkhachatryan force-pushed the f21132-1.11 branch 2 times, most recently from bc2277c to 53237d3 Compare January 29, 2021 19:40
@rkhachatryan rkhachatryan changed the title [WIP] (1.11) [FLINK-21132][runtime] Don't end input on stop with savepoint (1.11) [FLINK-21132][runtime] Don't end input on stop with savepoint Feb 1, 2021
@rkhachatryan rkhachatryan marked this pull request as ready for review February 1, 2021 09:19
Copy link
Contributor

@pnowojski pnowojski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @rkhachatryan . As we discussed in the Jira ticket, I guess this is the best approach for the time being. I've left a couple of smaller comments.

One meta comment. First we added two test cases in SavepointITCase next to test network tasks better, we added a couple of more in StreamTaskTest. How much are those tests overlapping? Maybe we should have all end of input tests on the test harness level?

rkhachatryan and others added 3 commits February 2, 2021 19:35
EndOfInput was used to handle any stopping of the job. When
stopping with savepoint the input is not actually ended.
This causes issues with some sinks (e.g. Iceberg).

With this change, endInput is not call for stop-with-savepoint.

To differentiate stop-with-savepoint from other cases
only checkpoint (RPC/barriers) are considered and not network EOP.
That's enough because EOP is only injected after the CP completion
(i.e. when the downstream is also notified by sync savepoint by CP
barriers).
Copy link
Contributor Author

@rkhachatryan rkhachatryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing @pnowojski !

The test failure was unrelated (FLINK-21216), rebased.
While debugging, I found a missing synchronization in StreamSourceTask (see below).

PTAL.

Copy link
Contributor

@pnowojski pnowojski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes! Can you squash the fixup commits?

@pnowojski pnowojski merged commit 299820a into apache:release-1.11 Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants