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

[BEAM-10212] Integrate caching client #15214

Merged

Conversation

anthonyqzhu
Copy link
Contributor

Adds state cache and caching client to process bundle execution


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

ValidatesRunner compliance status (on master branch)

Lang ULR Dataflow Flink Samza Spark Twister2
Go --- Build Status Build Status Build Status Build Status ---
Java Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
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
Build Status
Build Status Build Status ---
XLang Build Status Build Status Build Status Build Status Build Status ---

Examples testing status on various runners

Lang ULR Dataflow Flink Samza Spark Twister2
Go --- --- --- --- --- --- ---
Java --- Build Status
Build Status
Build Status
--- --- --- --- ---
Python --- --- --- --- --- --- ---
XLang --- --- --- --- --- --- ---

Post-Commit SDK/Transform Integration Tests Status (on master branch)

Go Java Python
Build Status Build Status Build Status
Build Status
Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace Typescript
Non-portable Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status Build Status
Portable --- Build Status Build Status --- --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@anthonyqzhu
Copy link
Contributor Author

R: @amaliujia

@anthonyqzhu anthonyqzhu force-pushed the BEAM-10212-integrate-caching-client branch from 0669dea to 5184b06 Compare July 26, 2021 19:07
@codecov
Copy link

codecov bot commented Jul 26, 2021

Codecov Report

Merging #15214 (0669dea) into master (1117f7d) will decrease coverage by 0.00%.
The diff coverage is n/a.

❗ Current head 0669dea differs from pull request most recent head 170a7a6. Consider uploading reports for the commit 170a7a6 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15214      +/-   ##
==========================================
- Coverage   83.82%   83.82%   -0.01%     
==========================================
  Files         441      441              
  Lines       59706    59706              
==========================================
- Hits        50051    50048       -3     
- Misses       9655     9658       +3     
Impacted Files Coverage Δ
sdks/python/apache_beam/io/source_test_utils.py 88.47% <0.00%> (-1.39%) ⬇️
sdks/python/apache_beam/transforms/util.py 95.81% <0.00%> (-0.17%) ⬇️
...ks/python/apache_beam/runners/worker/sdk_worker.py 88.85% <0.00%> (-0.16%) ⬇️
...hon/apache_beam/runners/worker/bundle_processor.py 93.51% <0.00%> (+0.24%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1117f7d...170a7a6. Read the comment docs.

@anthonyqzhu anthonyqzhu changed the title [Beam-10212] Integrate caching client [WIP] [Beam-10212] Integrate caching client Jul 26, 2021
@amaliujia
Copy link
Contributor

Overall LGTM. Please verify if the ordering timer test works.

@amaliujia amaliujia changed the title [Beam-10212] Integrate caching client [BEAM-10212] Integrate caching client Jul 30, 2021
@anthonyqzhu anthonyqzhu force-pushed the BEAM-10212-integrate-caching-client branch from 460fac3 to 6c7f798 Compare August 5, 2021 15:14
@amaliujia
Copy link
Contributor

Run Java_Examples_Dataflow PreCommit

@amaliujia
Copy link
Contributor

Run Java_Examples_Dataflow_Java11 PreCommit

// specified. If pipeline is batch, use a CachingBeamFnStateClient to store state responses.
// User state caching is currently not supported in streaming mode.
HandleStateCallsForBundle beamFnStateClient;
if (bundleDescriptor.hasStateApiServiceDescriptor()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain a bit more why hasStateApiServiceDescriptor is true = 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.

hasStateApiServiceDescriptor determines if a state handler is used at all, and options.as(StreamingOptions.class).isStreaming() determines if it is batch or streaming. Updated comments to show this more clearly

Copy link
Contributor

Choose a reason for hiding this comment

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

O I see. options.as(StreamingOptions.class).isStreaming() is used at line 530.

Copy link
Contributor

@amaliujia amaliujia left a comment

Choose a reason for hiding this comment

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

Enabled cache can also pass internal test suite.

@amaliujia
Copy link
Contributor

Run Java_Examples_Dataflow_Java11 PreCommit

@amaliujia
Copy link
Contributor

Run Java_Examples_Dataflow PreCommit

@anthonyqzhu
Copy link
Contributor Author

Run Java PreCommit

2 similar comments
@anthonyqzhu
Copy link
Contributor Author

Run Java PreCommit

@anthonyqzhu
Copy link
Contributor Author

Run Java PreCommit

@amaliujia
Copy link
Contributor

The failing org.apache.beam.examples.WordCountIT.testE2EWordCount is a known issue (and there is a ongoing fix). Per plat mon's suggestion we can merge PR in this case.

@amaliujia amaliujia merged commit 9c9903d into apache:master Aug 6, 2021
// Instantiate a State API call handler depending on whether a State ApiServiceDescriptor was
// specified.
HandleStateCallsForBundle beamFnStateClient;
if (bundleDescriptor.hasStateApiServiceDescriptor()) {
Copy link
Member

Choose a reason for hiding this comment

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

@amaliujia @anthonyqzhu
I was under the impression that we would place the cache behind an experiment instead of opting everyone into its usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We merged this assuming it was okay after seeing the passing tests / TAP presubmit passing as well.

I can introduce an experiment in front of this block today if necessary

Copy link
Member

Choose a reason for hiding this comment

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

Please do.

Copy link
Contributor

@amaliujia amaliujia Aug 11, 2021

Choose a reason for hiding this comment

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

Agreed. Let's file a patch to hide the cache by an experiment.

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