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

VReplication: Take replication lag into account in VStreamManager healthcheck result processing #15761

Merged
merged 6 commits into from
Apr 22, 2024

Conversation

mattlord
Copy link
Contributor

@mattlord mattlord commented Apr 19, 2024

Description

The vtgate VStreamManager — which manages VStream API requests made against a vtgate — watches a healthcheck stream from the tablets that it's streaming data from for each high level vstream. When processing the source tablet's healthcheck responses, however, it was not taking replication lag into account as it should. See the issue for more details.

This PR corrects that by checking the replication lag reported in the healthcheck response against the vtgate's live value tied to the --discovery_low_replication_lag flag (but this is also a dynamic variable).

I think that we should backport this all the way to 17.0 as it's a small and straightforward fix for a somewhat glaring bug.

Related Issue(s)

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

Copy link
Contributor

vitess-bot bot commented Apr 19, 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 Apr 19, 2024
@mattlord mattlord removed NeedsIssue A linked issue is missing for this Pull Request NeedsWebsiteDocsUpdate What it says labels Apr 19, 2024
@mattlord mattlord changed the title VReplication: Take replication lag into account in VStreamManager's healthcheck result processing VReplication: Take replication lag into account in VStreamManager healthcheck result processing Apr 19, 2024
Copy link

codecov bot commented Apr 19, 2024

Codecov Report

Attention: Patch coverage is 95.23810% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 68.40%. Comparing base (178e6e8) to head (ed8deea).
Report is 9 commits behind head on main.

Files Patch % Lines
go/vt/vtgate/vstream_manager.go 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15761      +/-   ##
==========================================
+ Coverage   68.38%   68.40%   +0.01%     
==========================================
  Files        1556     1556              
  Lines      195361   195437      +76     
==========================================
+ Hits       133598   133689      +91     
+ Misses      61763    61748      -15     

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

Signed-off-by: Matt Lord <[email protected]>
@mattlord mattlord removed NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsBackportReason If backport labels have been applied to a PR, a justification is required labels Apr 21, 2024
@mattlord mattlord marked this pull request as ready for review April 21, 2024 00:54
@mattlord mattlord requested review from deepthi, frouioui and GuptaManan100 and removed request for systay and harshit-gangal April 21, 2024 00:55
The event slice is not protected.

Signed-off-by: Matt Lord <[email protected]>
go/vt/vtgate/vstream_manager_test.go Outdated Show resolved Hide resolved
go/vt/vtgate/vstream_manager_test.go Outdated Show resolved Hide resolved
@mattlord mattlord merged commit 495de69 into vitessio:main Apr 22, 2024
104 checks passed
@mattlord mattlord deleted the vstream_repl_lag branch April 22, 2024 14:33
frouioui pushed a commit that referenced this pull request Apr 22, 2024
…reamManager healthcheck result processing (#15761) (#15772)

Signed-off-by: Matt Lord <[email protected]>
Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
Co-authored-by: Matt Lord <[email protected]>
frouioui pushed a commit that referenced this pull request Apr 22, 2024
…reamManager healthcheck result processing (#15761) (#15773)

Signed-off-by: Matt Lord <[email protected]>
Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
Co-authored-by: Matt Lord <[email protected]>
frouioui pushed a commit that referenced this pull request Apr 22, 2024
…reamManager healthcheck result processing (#15761) (#15774)

Signed-off-by: Matt Lord <[email protected]>
Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
Co-authored-by: Matt Lord <[email protected]>
timvaillancourt pushed a commit to slackhq/vitess that referenced this pull request May 30, 2024
…reamManager healthcheck result processing (vitessio#15761) (vitessio#15772)

Signed-off-by: Matt Lord <[email protected]>
Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
Co-authored-by: Matt Lord <[email protected]>
timvaillancourt added a commit to slackhq/vitess that referenced this pull request May 30, 2024
* [release-17.0] VReplication: Take replication lag into account in VStreamManager healthcheck result processing (vitessio#15761) (vitessio#15772)

Signed-off-by: Matt Lord <[email protected]>
Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
Co-authored-by: Matt Lord <[email protected]>

* fix signature

Signed-off-by: Tim Vaillancourt <[email protected]>

---------

Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Tim Vaillancourt <[email protected]>
Co-authored-by: vitess-bot[bot] <108069721+vitess-bot[bot]@users.noreply.github.com>
Co-authored-by: Matt Lord <[email protected]>
twthorn added a commit to slackhq/vitess that referenced this pull request Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Bug Report: VStream does not switch tablets when lag exceeds discovery_low_replication_lag
3 participants