Skip to content

Conversation

@lostluck
Copy link
Contributor

@lostluck lostluck commented Dec 12, 2023

Adds State API handling to Prism.

In particular:

  • Stateful stages are forced to be fusion roots.
  • Persisted state is added to engine.stageState
  • Tentative state is held onto in worker.Bundle, and mutated there as needed.
  • Add eager key extracting parsing for stateful receiving stages.
    • Very inefficient at present.
  • Implements FnAPI handling for:
    • BagState
    • MultimapState
    • MultimapKeysState
  • Unified handling for the two main state kinds
    • WRT/ Garbage collection and copying to bundles, and interaction.
  • Added a variable for State Unit Tests to switch between to stateful execution modes:
    • Greedily pack bundles with all data and state.
    • One Element Per Key.
    • One Key per Bundle.
    • One Element per Key, one key per Bundle.

Resolves #28543


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

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • 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.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@github-actions
Copy link
Contributor

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

@codecov
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Attention: 84 lines in your changes are missing coverage. Please review.

Comparison is base (dae646b) 37.85% compared to head (e1346e8) 38.15%.
Report is 140 commits behind head on master.

Files Patch % Lines
...o/pkg/beam/runners/prism/internal/worker/worker.go 10.16% 52 Missing and 1 partial ⚠️
...am/runners/prism/internal/engine/elementmanager.go 92.54% 9 Missing and 3 partials ⚠️
...m/runners/prism/internal/jobservices/management.go 0.00% 11 Missing and 1 partial ⚠️
.../go/pkg/beam/runners/prism/internal/engine/data.go 95.91% 3 Missing and 1 partial ⚠️
...s/go/pkg/beam/runners/prism/internal/preprocess.go 72.72% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #29712      +/-   ##
==========================================
+ Coverage   37.85%   38.15%   +0.30%     
==========================================
  Files         690      696       +6     
  Lines      101352   102086     +734     
==========================================
+ Hits        38363    38954     +591     
- Misses      61395    61514     +119     
- Partials     1594     1618      +24     
Flag Coverage Δ
go 53.93% <78.06%> (+0.53%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @riteshghorse for label go.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@lostluck
Copy link
Contributor Author

I thought I made this a draft PR. I still have a bit more cleanup / deduplication to do Ritesh. Sorry for the inconvenience.

@lostluck
Copy link
Contributor Author

R: @riteshghorse

Ready for a look! Thanks for your patience. No rush to get the review in for 2.53.0, it's OK if it's not in the cut.

@github-actions
Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

Copy link
Contributor

@riteshghorse riteshghorse left a comment

Choose a reason for hiding this comment

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

Mostly looks good, one question!

Copy link
Contributor

@riteshghorse riteshghorse left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@lostluck lostluck merged commit bc42a63 into apache:master Dec 14, 2023
@lostluck lostluck deleted the beam28543 branch December 14, 2023 18:45
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.

[Task][prism]: Support State API

2 participants