Skip to content

[BEAM-4681] Add support for portable timers in Flink batch mode #7008

Merged
mxm merged 6 commits intoapache:masterfrom
mxm:flink-timers-batch
Nov 19, 2018
Merged

[BEAM-4681] Add support for portable timers in Flink batch mode #7008
mxm merged 6 commits intoapache:masterfrom
mxm:flink-timers-batch

Conversation

@mxm
Copy link
Contributor

@mxm mxm commented Nov 12, 2018

This adds support for portable timers in Flink Runner's batch mode, and enables the Java/Python Portable ValidatesRunner tests.

CC @tweise @angoenka @robertwb

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java Build Status Build Status Build Status Build Status Build Status Build Status Build Status Build Status
Python Build Status --- Build Status
Build Status
Build Status --- --- ---

@mxm
Copy link
Contributor Author

mxm commented Nov 12, 2018

Run Java Flink PortableValidatesRunner

@mxm mxm force-pushed the flink-timers-batch branch 2 times, most recently from ed93559 to fb53c99 Compare November 12, 2018 16:47
Copy link
Contributor

@ryan-williams ryan-williams left a comment

Choose a reason for hiding this comment

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

looks great! I left a couple comments/questions

@mxm mxm force-pushed the flink-timers-batch branch from 5a3a299 to 23c278c Compare November 13, 2018 10:17
@mxm
Copy link
Contributor Author

mxm commented Nov 13, 2018

Thanks for the review @ryan-williams!

@mxm mxm force-pushed the flink-timers-batch branch from 81f5f67 to 0da9483 Compare November 13, 2018 10:27
@mxm
Copy link
Contributor Author

mxm commented Nov 13, 2018

Run Java PreCommit

@mxm
Copy link
Contributor Author

mxm commented Nov 13, 2018

Run Java_Examples_Dataflow PreCommit

@mxm
Copy link
Contributor Author

mxm commented Nov 13, 2018

Run Java Flink PortableValidatesRunner

@mxm mxm force-pushed the flink-timers-batch branch from a916c36 to 48f5ae6 Compare November 13, 2018 17:31
@mxm
Copy link
Contributor Author

mxm commented Nov 13, 2018

Rebased this to #6981.

@mxm mxm force-pushed the flink-timers-batch branch 2 times, most recently from bf9045b to 7c74482 Compare November 13, 2018 17:34
@mxm
Copy link
Contributor Author

mxm commented Nov 13, 2018

Run Java Flink PortableValidatesRunner

@mxm
Copy link
Contributor Author

mxm commented Nov 13, 2018

Run Java PreCommit

@mxm
Copy link
Contributor Author

mxm commented Nov 13, 2018

Run Java Flink PortableValidatesRunner

@mxm mxm force-pushed the flink-timers-batch branch 4 times, most recently from 7c247fb to 5cb59b2 Compare November 15, 2018 20:04
@mxm
Copy link
Contributor Author

mxm commented Nov 15, 2018

Run Python Flink ValidatesRunner

@mxm
Copy link
Contributor Author

mxm commented Nov 15, 2018

Run Java Flink PortableValidatesRunner

@mxm mxm requested a review from tweise November 15, 2018 20:09
@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2018

Run Java PreCommit

@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2018

Run Python PreCommit

@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2018

Run Java Flink PortableValidatesRunner

@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2018

Run Flink ValidatesRunner

@mxm mxm force-pushed the flink-timers-batch branch from 5cb59b2 to bbefdbd Compare November 16, 2018 12:04
@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2018

Run Flink ValidatesRunner

@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2018

Run Flink ValidatesRunner

@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2018

Run Java Flink PortableValidatesRunner

@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2018

Run Python Flink ValidatesRunner

@mxm mxm force-pushed the flink-timers-batch branch from 3537b56 to 62a1313 Compare November 16, 2018 14:14
@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2018

Run Python Flink ValidatesRunner

@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2018

Run Flink ValidatesRunner

@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2018

Run Java PreCommit

@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2018

Ran "Java Flink PortableValidatesRunner" locally with the latest master. All tests passed.

@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2018

Unfortunately, the Jenkins setup for it seems to be broken at the moment.

@mxm
Copy link
Contributor Author

mxm commented Nov 16, 2018

Same goes for "Run JavaPortabilityApi PreCommit" which fails continuously at the moment for all commits. My PR doesn't change anything regarding the portability API.

int tagInt = unionTag;
return receivedElement -> {
synchronized (collectorLock) {
collector.collect(new RawUnionValue(tagInt, receivedElement));
Copy link
Contributor

Choose a reason for hiding this comment

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

In streaming doing this in the RPC handler can cause a deadlock when collect triggers the next bundle in an operator chain. Presumably that cannot happen due to different scheduling in batch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. I think you are right. This can deadlock if the receiving side backpressures because it is waiting for input from another channel generated by this operator. Is that what you meant?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but I don't know if it is applicable for batch since it is scheduled stage by stage. For streaming the issue would surface just by running wordcount, for batch not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The stage-by-stage is only in place if the ExecutionMode is set to FORCE_BATCH, instead of the default PIPELINE.

@mxm mxm force-pushed the flink-timers-batch branch from e604fed to 284222a Compare November 19, 2018 11:48
@mxm
Copy link
Contributor Author

mxm commented Nov 19, 2018

Run Website PreCommit

@mxm
Copy link
Contributor Author

mxm commented Nov 19, 2018

Run Python Flink ValidatesRunner

@mxm mxm force-pushed the flink-timers-batch branch from 284222a to b752ad5 Compare November 19, 2018 13:32
@mxm
Copy link
Contributor Author

mxm commented Nov 19, 2018

Squashed for merge.

@mxm
Copy link
Contributor Author

mxm commented Nov 19, 2018

Run Python Flink ValidatesRunner

@mxm
Copy link
Contributor Author

mxm commented Nov 19, 2018

Run Website PreCommit

1 similar comment
@mxm
Copy link
Contributor Author

mxm commented Nov 19, 2018

Run Website PreCommit

Copy link
Contributor

@tweise tweise left a comment

Choose a reason for hiding this comment

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

Minor side note: The commits belonging to BEAM-4681 are one unit of rollback, you decide if you want to squash them or not.

int tagInt = unionTag;
return receivedElement -> {
synchronized (collectorLock) {
collector.collect(new RawUnionValue(tagInt, receivedElement));
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but I don't know if it is applicable for batch since it is scheduled stage by stage. For streaming the issue would surface just by running wordcount, for batch not.

@mxm
Copy link
Contributor Author

mxm commented Nov 19, 2018

The commits belonging to BEAM-4681 are one unit of rollback

I find the structure quite logical and it should enable more incremental rollback:

  • [BEAM-4681] Add support for portable timers in Flink batch mode
    Adds the batch support for timers

  • [BEAM-4681] Use CoderUtils to decode key
    Fixes an issue for Java PVR for streaming timers

  • [BEAM-4681] Enable Python ValidatesRunner timer tests
    Enables Python PVR

  • [BEAM-4681] Enable Java portable ValidatesRunner timer tests
    Enables Java PVR

  • [BEAM-4681] Simplify by replacing the two timer keys with a single one
    Refactoring which can be rolled back independently.

But it is a personal preference and I'd also be fine with squashing.

@mxm
Copy link
Contributor Author

mxm commented Nov 19, 2018

Run Flink ValidatesRunner

@mxm
Copy link
Contributor Author

mxm commented Nov 19, 2018

Run Website PreCommit

@mxm mxm merged commit 50f623c into apache:master Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants