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

[FLINK-18990][task] Read channel state sequentially #13351

Merged
merged 8 commits into from
Oct 9, 2020

Conversation

rkhachatryan
Copy link
Contributor

@rkhachatryan rkhachatryan commented Sep 8, 2020

What is the purpose of the change

Read channel state sequentially to reduce the number of seeks.

Verifying this change

  • Added SequentialChannelStateReaderImplTest and ChannelStateChunkReaderTest for the new code.
  • Added RecoveredInputChannelTest to check that conversion is not permitted untill fully recovered and state consumed
  • some tests are eliminated because: 1) state in StreamTask is read unconditionally; 2) recovered channel can't be converted without being fully consumed anymore

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 / no)
  • 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: yes
  • 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 Sep 8, 2020

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 3c79716 (Tue Sep 08 09:04:30 UTC 2020)

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

@rkhachatryan rkhachatryan changed the title [FLINK-18989][task] Read channel state sequentially [FLINK-18990][task] Read channel state sequentially Sep 8, 2020
@flinkbot
Copy link
Collaborator

flinkbot commented Sep 8, 2020

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

Copy link
Contributor

@AHeise AHeise left a comment

Choose a reason for hiding this comment

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

Very intriguing solution. I left a couple of comments but nothing deep. While reviewing my main issue was to understand the relationship between Sequential and old ChannelStateReader (become only clear after last commit). Last commits looks a bit incomplete.
Note that I still struggle a bit on the concepts of StateHandle and delegate. I dropped a question at the main commit.

@rkhachatryan rkhachatryan force-pushed the read-channel-state-seq branch 3 times, most recently from d5de65d to ce1ddf0 Compare September 29, 2020 06:50
@rkhachatryan
Copy link
Contributor Author

Thanks for reviewing @AHeise and @pnowojski
I've addressed your feedback, please take a look.

Copy link
Contributor

@AHeise AHeise left a comment

Choose a reason for hiding this comment

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

Addressed most of my comments, a few open discussions.

I'm thinking that the last 3 commits (remove tests, methods, class of channel state reader) should be squashed.

@rkhachatryan
Copy link
Contributor Author

@flinkbot run azure

Copy link
Contributor

@AHeise AHeise left a comment

Choose a reason for hiding this comment

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

LGTM % squash last 3 commits. I'm still waiting for @pnowojski to look at the changed test.

@rkhachatryan
Copy link
Contributor Author

Thanks for reviewing @AHeise and @pnowojski .
I've updated StreamTaskMultipleInputSelectiveReadingTest.testInputStarvation and squashed the last three commits.

@rkhachatryan
Copy link
Contributor Author

Build failure unrelated: FLINK-19427
Private build passed.

@rkhachatryan rkhachatryan force-pushed the read-channel-state-seq branch 3 times, most recently from ec6d68e to 3041c48 Compare October 8, 2020 11:37
@rkhachatryan
Copy link
Contributor Author

I rebased the PR and resolved conflicts with FLINK-19027 by moving the assignment of exclusive buffers for RecoveredInputChannel into it's requestBufferBlocking method.

I also replaced RemoteInputChannel.assignExclusiveSegments() with InputChannel.setup() make it clear that RecoveredInputChannel doesn't need setup and avoid if/casts (e4946c0).

@pnowojski, @AHeise please take a look.

Motivation: reduce the required test coverage (tests will be removed in
a later commit).
…ter state was fully consumed

Motivation:
1. Guarantee state is not lost
2. Reduce the required test coverage (tests will be removed in the next
commit)
…elated code

- ChannelStateReader and supporting classes
- methods for channel state recovery in inputChannels, subpartitions, etc.
- tests for reading channel state non-sequentially
@AHeise AHeise merged commit 0b6c086 into apache:master Oct 9, 2020
@rkhachatryan rkhachatryan deleted the read-channel-state-seq branch October 9, 2020 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants