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

parse transaction timeout as duration #16338

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

shanth96
Copy link
Contributor

@shanth96 shanth96 commented Jul 4, 2024

Description

This PR fixes a bug that causes vttestserver to parse the --queryserver-config-transaction-timeout incorrectly. This should be backported all the way to v19.

Related Issue(s)

Fixes #16337

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 Jul 4, 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 4, 2024
@github-actions github-actions bot added this to the v21.0.0 milestone Jul 4, 2024
@mattlord mattlord added Component: vttestserver Type: Bug Backport to: release-19.0 Needs to be back ported to release-19.0 Backport to: release-20.0 Needs to be backport to release-20.0 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 4, 2024
@mattlord
Copy link
Contributor

mattlord commented Jul 4, 2024

Thank you, @shanth96 !

This was a mistake in the past and it was the odd person out in the flag handling:

go/flags/endtoend/vtcombo.txt:      --queryserver-config-transaction-timeout duration                  query server transaction timeout, a transaction will be killed if it takes longer than this value (default 30s)
go/flags/endtoend/vttablet.txt:      --queryserver-config-transaction-timeout duration                  query server transaction timeout, a transaction will be killed if it takes longer than this value (default 30s)
go/flags/endtoend/vttestserver.txt:      --queryserver-config-transaction-timeout float                     query server transaction timeout (in seconds), a transaction will be killed if it takes longer than this value

You will need to update that vttestserver.txt file as well. And I think that we should use the same default in vttestserver as well. Unless you think there's good reasons not to? The zero value would mean no timeout.

Copy link

codecov bot commented Jul 4, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 68.69%. Comparing base (694a0cf) to head (dafde37).
Report is 416 commits behind head on main.

Files with missing lines Patch % Lines
go/vt/vttest/vtprocess.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16338      +/-   ##
==========================================
- Coverage   68.71%   68.69%   -0.03%     
==========================================
  Files        1547     1547              
  Lines      198286   198287       +1     
==========================================
- Hits       136257   136211      -46     
- Misses      62029    62076      +47     

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

@shanth96 shanth96 force-pushed the fix-queryserver-flag branch from 448563a to 7b9a633 Compare July 5, 2024 03:16
@shanth96
Copy link
Contributor Author

shanth96 commented Jul 5, 2024

And I think that we should use the same default in vttestserver as well. Unless you think there's good reasons not to? The zero value would mean no timeout.

30s makes more sense. Updated

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.

Thanks, @shanth96 !

@arthurschreiber
Copy link
Contributor

This should be backported all the way to v19.

I think if you want this to be backported, the default should not change? Might be easier to have one PR that fixes the parsing behaviour (that can be backported), and a second PR that changes the default (which can then be mentioned in the release notes).

@deepthi
Copy link
Member

deepthi commented Jul 8, 2024

This should be backported all the way to v19.

I think if you want this to be backported, the default should not change? Might be easier to have one PR that fixes the parsing behaviour (that can be backported), and a second PR that changes the default (which can then be mentioned in the release notes).

You could argue that this is used only for testing, and it is OK to change even in an older release. But what you have stated here is of course the official way to change any flags.

@shanth96 can you tell us how you are using vttestserver and why you need this fixed in v19? Non production bugs are typically not fixed in older releases.

@shanth96
Copy link
Contributor Author

shanth96 commented Jul 8, 2024

Turns out we were setting defaults to 300s through a hardcoded value outside the cobra flags definition. Hence, i've updated this PR to use 300s as a default.

@shanth96 can you tell us how you are using vttestserver and why you need this fixed in v19? Non production bugs are typically not fixed in older releases.

Given that I just found out that the default is being set to 300s, I'm okay with it not being backported to v19. Previously, I was under the assumption that we were setting it 0 (no timeout) as default so it was pretty important to be able to backport it to be able to set reasonable timeouts on our CI agents.

@deepthi
Copy link
Member

deepthi commented Jul 8, 2024

Turns out we were setting defaults to 300s through a hardcoded value outside the cobra flags definition

I don't like to see any query timeout / transaction timeout default to > 30 seconds. So if you could set the default to 30 seconds, that will be great. Now that the parsing has been fixed, people can override it to 300s if they want to. I assume this still means that we don't (at least right now) backport anything to v19 and v20, where everyone is getting 300s and no one can change it.

@deepthi deepthi removed Backport to: release-19.0 Needs to be back ported to release-19.0 Backport to: release-20.0 Needs to be backport to release-20.0 labels Jul 8, 2024
@shanth96 shanth96 force-pushed the fix-queryserver-flag branch from ae36eb1 to fef8c84 Compare July 8, 2024 20:54
Signed-off-by: shanth96 <shanth.sathiyaseelan@shopify.com>
@shanth96 shanth96 force-pushed the fix-queryserver-flag branch from fef8c84 to dafde37 Compare July 8, 2024 20:54
@shanth96
Copy link
Contributor Author

shanth96 commented Jul 9, 2024

I don't like to see any query timeout / transaction timeout default to > 30 seconds. So if you could set the default to 30 seconds, that will be great. Now that the parsing has been fixed, people can override it 300s if they want to. I assume this still means that we don't (at least right now) backport anything to v19 and v20, where everyone is getting 300s and no one can change it.

Set it back to 30s and yes, for v19 and v20, everyone will get 300s and no one can change it.

@shanth96
Copy link
Contributor Author

@deepthi can I get some 👀 on this?

@shanth96
Copy link
Contributor Author

@mattlord tests are passing/CI is green. Good to merge I think

@mattlord mattlord merged commit 3d36adb into vitessio:main Jul 12, 2024
126 checks passed
@nonbb
Copy link

nonbb commented Dec 18, 2024

@deepthi or @mattlord wondering what the process is for the v19 back port? The use case for us is that we want to have a testing environment that is akin to what our production / staging versions are using.

@mattlord
Copy link
Contributor

mattlord commented Dec 18, 2024

@nonbb and @shanth96, I'm sorry — the backports seem to have been glossed over. This should be safe and easy to backport to v20 and v19. I will add the labels now to try and kick that off.

@mattlord mattlord added Backport to: release-19.0 Needs to be back ported to release-19.0 Backport to: release-20.0 Needs to be backport to release-20.0 labels Dec 18, 2024
@nonbb
Copy link

nonbb commented Dec 18, 2024

Thank you so much!

@mattlord
Copy link
Contributor

mattlord commented Dec 18, 2024

@nonbb and @shanth96 Looks like we missed the window for the backport bot and they'll need to be done manually. Do you want to open the backport PRs which a cherry-pick of the main commit into the respective branch? I could also do this if needed.

@nonbb
Copy link

nonbb commented Dec 18, 2024

@nonbb and @shanth96 Looks like we missed the window for the backport bot and they'll need to be done manually. Do you want to open the backport PRs which a cherry-pick of the main commit into the respective branch? I could also do this if needed.

Would you mind also helping with that? @mattlord if you don't have time I can try as well!

mattlord pushed a commit to planetscale/vitess that referenced this pull request Dec 18, 2024
Signed-off-by: shanth96 <shanth.sathiyaseelan@shopify.com>
mattlord pushed a commit to planetscale/vitess that referenced this pull request Dec 18, 2024
Signed-off-by: shanth96 <shanth.sathiyaseelan@shopify.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backport to: release-19.0 Needs to be back ported to release-19.0 Backport to: release-20.0 Needs to be backport to release-20.0 Component: vttestserver Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug Report: vttestserver queryserver-config-transaction-timeout fails to parse
5 participants