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

engine: unit status use cached source status #7618

Merged
merged 5 commits into from
Nov 16, 2022

Conversation

D3Hunter
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #7343

What is changed and how it works?

  • df-service will call get job api which calls dm status, but current impl will get source status every time, if the source is down, it won't return after 30s timeout, which will make df-service get/list job timeout and fails. so change unit.Status to use cached source status.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

`None`.

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Nov 15, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lance6716
  • okJiang

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Nov 15, 2022
@D3Hunter D3Hunter added the area/engine Issues or PRs related to Dataflow Engine. label Nov 15, 2022
@ti-chi-bot ti-chi-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 15, 2022
@D3Hunter
Copy link
Contributor Author

/run-all-tests


if sourceStatus == nil || time.Since(sourceStatus.UpdateTime) > sourceStatusRefreshInterval {
u.Status(ctx)
u.updateSourceStatus(ctx)
Copy link
Contributor

@lance6716 lance6716 Nov 15, 2022

Choose a reason for hiding this comment

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

Still need to call u.unit.Status here, because the metrics related variables are updated in u.unit.Status

Copy link
Contributor Author

@D3Hunter D3Hunter Nov 15, 2022

Choose a reason for hiding this comment

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

which variables?

Copy link
Contributor

Choose a reason for hiding this comment

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

for example

			s.metricsProxies.Metrics.RemainingTimeGauge.Set(float64(remainingSeconds))

this line is contained in (*Syncer).printStatus <- (*Syncer).Status

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 here c55d42d

bad idea to have a status getter to have such side effects.

@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2022

Codecov Report

Merging #7618 (354b1a6) into master (0438dd4) will decrease coverage by 0.0713%.
The diff coverage is 36.1797%.

Additional details and impacted files
Flag Coverage Δ
cdc 66.6298% <34.4186%> (-0.2870%) ⬇️
dm 52.1570% <0.0000%> (+0.0742%) ⬆️
engine 63.8267% <100.0000%> (+0.0407%) ⬆️

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

@@               Coverage Diff                @@
##             master      #7618        +/-   ##
================================================
- Coverage   60.0458%   59.9745%   -0.0714%     
================================================
  Files           807        808         +1     
  Lines         92391      92656       +265     
================================================
+ Hits          55477      55570        +93     
- Misses        32099      32259       +160     
- Partials       4815       4827        +12     

@D3Hunter
Copy link
Contributor Author

/run-all-tests

@lance6716
Copy link
Contributor

/run-engine-integration-test

Copy link
Member

@okJiang okJiang left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 16, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Nov 16, 2022
@D3Hunter
Copy link
Contributor Author

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 2199c21

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 16, 2022
@ti-chi-bot
Copy link
Member

@D3Hunter: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@D3Hunter
Copy link
Contributor Author

/run-engine-integration-test

2 similar comments
@D3Hunter
Copy link
Contributor Author

/run-engine-integration-test

@D3Hunter
Copy link
Contributor Author

/run-engine-integration-test

@ti-chi-bot ti-chi-bot merged commit bfd7dce into pingcap:master Nov 16, 2022
@D3Hunter D3Hunter deleted the use-cached-sourceStatus branch November 16, 2022 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/engine Issues or PRs related to Dataflow Engine. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants