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

*: Use strict validation for stale read ts & flashback ts #57050

Merged
merged 7 commits into from
Nov 12, 2024

Conversation

MyonKeminta
Copy link
Contributor

@MyonKeminta MyonKeminta commented Nov 1, 2024

What problem does this PR solve?

Issue Number: close #56809

Problem Summary:

What changed and how does it work?

Use strict check for stale read ts & flashback ts to avoid any reading on future ts, which has risk to break the linearizability of async commit and 1PC transactions.

Pending and waiting for tikv/client-go#1484

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Copy link

ti-chi-bot bot commented Nov 1, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-tests-checked do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 1, 2024
Copy link

tiprow bot commented Nov 1, 2024

Hi @MyonKeminta. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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 kubernetes-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 8, 2024
Copy link

ti-chi-bot bot commented Nov 8, 2024

PR needs rebase.

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 kubernetes-sigs/prow repository.

Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
@MyonKeminta MyonKeminta marked this pull request as ready for review November 11, 2024 10:09
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 11, 2024
Copy link
Contributor

@cfzjywxk cfzjywxk 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 bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 11, 2024
@cfzjywxk cfzjywxk removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. do-not-merge/needs-tests-checked labels Nov 11, 2024
Copy link

ti-chi-bot bot commented Nov 11, 2024

@cfzjywxk: You cannot manually add or delete the reviewing state labels, only I and the tursted members have permission to do so.

In response to removing label named needs-1-more-lgtm.

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.

@MyonKeminta MyonKeminta deleted the m/stale-read-ts-validation-fix branch November 12, 2024 08:00
@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Nov 14, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #57372.

@MyonKeminta
Copy link
Contributor Author

MyonKeminta commented Nov 18, 2024

A brief benchmark result on one of our internal stale read workload, with update low resolution ts interval configured by default (2s):

version read_staleness / s QPS .95 lat / ms
baseline -5 4730.05 5.77
baseline -1 4690.31 5.77
fix -5 4658.86 5.88
fix -1 4709.33 5.77
fix - tso 5ms injection -1 4723.33 5.77

This can be a proof that when the read staleness is shorter than the update interval of low resolution ts, the performance can still be kept.

@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Dec 9, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 9, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #58086.

@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. label Dec 11, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 11, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.1: #58158.

MyonKeminta added a commit to ti-chi-bot/tidb that referenced this pull request Dec 12, 2024
MyonKeminta added a commit to ti-chi-bot/tidb that referenced this pull request Dec 12, 2024
@MyonKeminta MyonKeminta added needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. labels Dec 19, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 19, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #58409.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Dec 19, 2024
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.1: #58410.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SELECT ... AS OF TIMESTAMP statement with explicit time may break linearizability when TSO is drifting
6 participants