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

VTAdmin: Show throttled status in workflows #16308

Merged
merged 15 commits into from
Jul 11, 2024

Conversation

rohit-nayak-ps
Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps commented Jul 2, 2024

Description

When a VReplication workflow is throttled, the app that caused the throttling and the time of the last throttle are recorded in the _vt.vreplication table. Currently those attributes are only shown in the json output tab of the workflow screen and are not easy to find.

The throttler app and time are not reset once throttling has ended. So we only show a stream as throttled if it is within (currently) a minute. The throttler is updating this row on each check (every 250ms - 1s).

This PR changes the status color for a throttled running workflow to black and adds the throttler details (app name and time since throttled) to the summary workflow tooltip and to the streams details section.

It also adds a new internal link in the header to scroll down to the Streams section for convenience and visibility.

Workflow summary page
Workflow Streams Section

Related Issue(s)

#11690

Checklist

  • "Backport to:" labels have been added if this change should be back-ported to release branches
  • If this change is to be back-ported to previous releases, a justification is included in the PR description
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on CI?
  • Documentation was added or is not required

Deployment Notes

Copy link
Contributor

vitess-bot bot commented Jul 2, 2024

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • Apply the release notes (needs details) label if users need to know about this change.
  • New features should be documented.
  • There should be some code comments as to why things are implemented the way they are.
  • There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • Is this flag really necessary?
  • Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • vtctl command output order should be stable and awk-able.

@vitess-bot vitess-bot bot added NeedsBackportReason If backport labels have been applied to a PR, a justification is required NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsWebsiteDocsUpdate What it says labels Jul 2, 2024
@rohit-nayak-ps rohit-nayak-ps added Type: Feature Component: VReplication Component: VTAdmin VTadmin interface and removed NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsWebsiteDocsUpdate What it says NeedsIssue A linked issue is missing for this Pull Request NeedsBackportReason If backport labels have been applied to a PR, a justification is required labels Jul 2, 2024
@github-actions github-actions bot added this to the v21.0.0 milestone Jul 2, 2024
Signed-off-by: Rohit Nayak <[email protected]>
…omponents/routes/workflow/Workflow.module.scss src/components/routes/workflow/Workflow.tsx src/components/routes/workflow/WorkflowStreams.tsx src/components/routes/Workflows.tsx

Signed-off-by: Rohit Nayak <[email protected]>
@rohit-nayak-ps rohit-nayak-ps marked this pull request as ready for review July 2, 2024 07:00
@rohit-nayak-ps rohit-nayak-ps requested review from deepthi and a team July 2, 2024 07:00
@rohit-nayak-ps rohit-nayak-ps marked this pull request as draft July 2, 2024 15:42
@mattlord mattlord self-requested a review July 2, 2024 17:46
…ime columns don't get cleared once it is no longer throttled

Signed-off-by: Rohit Nayak <[email protected]>
Copy link

codecov bot commented Jul 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.72%. Comparing base (bb76046) to head (e58999b).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16308      +/-   ##
==========================================
+ Coverage   68.71%   68.72%   +0.01%     
==========================================
  Files        1544     1547       +3     
  Lines      198011   198270     +259     
==========================================
+ Hits       136064   136269     +205     
- Misses      61947    62001      +54     

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

Signed-off-by: Rohit Nayak <[email protected]>
@rohit-nayak-ps rohit-nayak-ps marked this pull request as ready for review July 3, 2024 16:38
@rohit-nayak-ps
Copy link
Contributor Author

Current test failures are due to the issue with installing xtrabackup ...

Copy link
Contributor

@mattlord mattlord left a comment

Choose a reason for hiding this comment

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

I think there's still a misunderstanding baked in here about what the throttler info means. If a workflow was throttled 6 hours ago, that would be reflected in the record. That does NOT mean, however, that we've been throttled for 6 hours. In fact it means the opposite, we haven't been throttled in 6 hours.

Comment on lines 133 to 134
// If the stream has been throttled for more than 5 seconds, show it as throttled.
Number(stream?.throttler_status?.time_throttled?.seconds) >
Date.now() / 1000 - ThrottleThresholdSeconds
Copy link
Contributor

Choose a reason for hiding this comment

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

Aren't we showing it if it's been throttled in the last minute? I don't see how we can answer "for more than 5 seconds" or how we're attempting to do that here.

if (numThrottled === 1) {
throttledApp =
stream?.throttler_status?.component_throttled?.toString();
throttledFrom = stream?.throttler_status?.time_throttled;
Copy link
Contributor

Choose a reason for hiding this comment

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

throttledAt would be more accurate here

}
if (numThrottled > 0) {
streamDescription = '';
streamState = 'Throttled';
Copy link
Contributor

Choose a reason for hiding this comment

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

Recently Throttled would be correct.

' throttled in ' +
throttledApp +
' ' +
formatRelativeTime(throttledFrom?.seconds) +
Copy link
Contributor

Choose a reason for hiding this comment

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

Another place where we're treating the last throttled time as if we've been throttled since then when it only indicates when we were last throttled. You can tell if you're constantly being throttled by watching this value over time.

@rohit-nayak-ps rohit-nayak-ps force-pushed the rohit/vtadmin-vrep-1 branch from e58999b to 5cd70c8 Compare July 3, 2024 20:56
Signed-off-by: Rohit Nayak <[email protected]>
Signed-off-by: Rohit Nayak <[email protected]>
Copy link
Contributor

@notfelineit notfelineit left a comment

Choose a reason for hiding this comment

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

thanks Rohit!

@rohit-nayak-ps rohit-nayak-ps merged commit b8497b0 into vitessio:main Jul 11, 2024
95 checks passed
@rohit-nayak-ps rohit-nayak-ps deleted the rohit/vtadmin-vrep-1 branch July 11, 2024 05:41
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.

3 participants