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
sql: ensure auto-retrying transactions respect the statement_timeout #54370
Merged
arulajmani
merged 3 commits into
cockroachdb:release-20.2
from
arulajmani:backport20.2-53968-54368
Sep 17, 2020
Merged
sql: ensure auto-retrying transactions respect the statement_timeout #54370
arulajmani
merged 3 commits into
cockroachdb:release-20.2
from
arulajmani:backport20.2-53968-54368
Sep 17, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rafiss
requested changes
Sep 15, 2020
defer tc.Stopper().Stop(ctx) | ||
|
||
conn, err := tc.ServerConn(0).Conn(ctx) | ||
require.NoError(t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like the require
import was added in 39e7448
i think you can just add the import here
I might need to get #54415 in as well to deflake CI, so I'm putting the DNM label on this for now. |
Previously, if a statement exceeded the statement_timnout in the conn_executor, but failed with a retryable error, we would still retry it. This was because even though we overrode the error, we didn't override the `fms.Event` and `fsm.EventPayload` which actually dictates the next transition. This patch overrides them, thereby ensuring that even if a timed out query/cancelled query encountered a retryable error, we do not transition into retrying it. Fixes cockroachdb#52845 Release justification: low risk, high benefit changes to existing functionality Release note (bug fix): queries that can be automatically retried did not respect the `statement_timeout` earlier, which is now fixed.
Previously the statement timeout in a logic test was set to 1ms, which was sometimes not enough to complete resetting the statement timeout after the test, causing it to flake. This PR increases the timeout from 1ms to 10ms so that we don't flake on the cleanup. Release note: None
Previously, if a user set a really low statement_timeout value, there would be no way to reset it/remove the statement_timeout entirely. To get around this, all `SET` statements are now exempt from the statement timeout.This should also fix some of the flakes we were seeing in checks were decoupled in cockroachdb#53968. `SET` statements aren't canceled as no one checks for a canceled context, which meant this exemption existed implicitly before cockroachdb#53968. Closes cockroachdb#54372 Release note: None
arulajmani
force-pushed
the
backport20.2-53968-54368
branch
from
September 16, 2020 17:17
d6aa6b6
to
4451817
Compare
This should be ready now that #54415 is in. |
solongordon
approved these changes
Sep 16, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport:
Please see individual PRs for details.
/cc @cockroachdb/release