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

start to refactor persistence layer to prepare for direct path #30265

Merged
merged 6 commits into from
Feb 27, 2024

Conversation

m-trieu
Copy link
Contributor

@m-trieu m-trieu commented Feb 8, 2024

Change classes that explicitly inject a MetricTrackingWindmillServerStub to take in a Function.
This will give flexibility in later refactoring as we apply different ways to fetch the data without MetricTrackingWindmillServerStub.
Add PersistentStateReadMetricsTracker, which is similar to MetricTrackingWindmillServerStub but allows callers to inject a GetDataStream (which is necessary for direct path since the calls need to be appropriately routed) and is streaming engine specific.

R: @scwhittle


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.

Copy link
Contributor

github-actions bot commented Feb 9, 2024

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

Copy link
Contributor

github-actions bot commented Feb 9, 2024

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

R: @robertwb added as fallback since no labels match configuration

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).

Copy link
Contributor

@scwhittle scwhittle left a comment

Choose a reason for hiding this comment

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

Can you merge with the conflicts? Otherwise looking good

@m-trieu m-trieu force-pushed the mt-direct-path-prep branch from 0b741de to 0bce6d7 Compare February 20, 2024 00:48
@m-trieu
Copy link
Contributor Author

m-trieu commented Feb 21, 2024

ready for another look @scwhittle

@m-trieu
Copy link
Contributor Author

m-trieu commented Feb 21, 2024

Run Java Precommit

@scwhittle
Copy link
Contributor

Run Java PreCommit

@scwhittle
Copy link
Contributor

Looks like this assert failed in test:

Could be flaky if doesn't wait enough to get commit or it could be an indication that the heartbeat response plumbing isn't working.

@m-trieu
Copy link
Contributor Author

m-trieu commented Feb 22, 2024

Looks like this assert failed in test:

Could be flaky if doesn't wait enough to get commit or it could be an indication that the heartbeat response plumbing isn't working.

@scwhittle ran locally and it passed. looks we depend on sleep() in the test, and i wonder if that leads to flakiness in the GitHub actions environment?

    Map<Long, Windmill.WorkItemCommitRequest> commits =
        server.waitForAndGetCommitsWithTimeout(2, Duration.standardSeconds((5)));
    assertEquals(1, commits.size());

also kind of strange that we are waiting for 2 commits but are asserting that there is only 1 commit.

But looks like this is a flaky test failure

@scwhittle
Copy link
Contributor

Run Java PreCommit

@scwhittle
Copy link
Contributor

That test expects 1 commit but meant to wait for some extra time to make sure there were not 2.
But it should do so perhaps with larger time limit for 1 and then shorter time limit to verify more don't show up.

createWindmillServerStub(
options,
clientId,
new WorkHeartbeatResponseProcessor(
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see where this is setup if the forTesting method is used.

Are you sure this isn't the cause of the test failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it gets set up here in FakeWindmillServer
Uploading image.png…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it gets set up here in FakeWindmillServer
image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

figured it out looks like the work isn't being populated in the computation map will fix it

thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

/** Decorates calls to Streaming Engine persistence by tracking metrics on RPCs. */
@Internal
@ThreadSafe
public final class PersistentStateReadMetricsTracker {
Copy link
Contributor

Choose a reason for hiding this comment

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

This appears unused in this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm going to remove it for now to merge the rest to avoid review delay.

…ache/beam/runners/dataflow/worker/windmill/state/PersistentStateReadMetricsTracker.java

rm unused PersistentStateReadMetricsTracker
@scwhittle scwhittle merged commit 6c3e8ad into apache:master Feb 27, 2024
17 checks passed
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.

2 participants