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

executor: fix issue of txn_ts of stale-read query is 0 in slow log #52484

Closed
wants to merge 1 commit into from

Conversation

crazycs520
Copy link
Contributor

@crazycs520 crazycs520 commented Apr 10, 2024

What problem does this PR solve?

Issue Number: close #45545

Problem Summary: fix issue of txn_ts of stale-read query is 0 in slow log

What changed and how does it work?

Before This PR

The slow log of stale-read query is the following, Txn_start_ts is 0, which is unexpected.

...
# Txn_start_ts: 0
...
select * from t;

This PR

...
# Txn_start_ts: 448987604713472000
...
select * from t;

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: crazycs520 <crazycs520@gmail.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note-none size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 10, 2024
Copy link

tiprow bot commented Apr 10, 2024

Hi @crazycs520. 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/test-infra repository.

@crazycs520
Copy link
Contributor Author

/check-issue-triage-complete

@MyonKeminta
Copy link
Contributor

Can we consider distinguishing the start_ts allocated from PD and the stale read ts that's calculated in other way, to avoid possible misunderstanding (e.g. the ts might be the same with another transaction's start_ts, and one may think that the statement is part of that transaction)?

Copy link

ti-chi-bot bot commented Apr 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zyguan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

ti-chi-bot bot commented Apr 11, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-11 04:27:08.274765665 +0000 UTC m=+1109289.802306211: ☑️ agreed by zyguan.

Copy link

codecov bot commented Apr 11, 2024

Codecov Report

Merging #52484 (f046130) into master (e540f0f) will increase coverage by 2.0877%.
Report is 4 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52484        +/-   ##
================================================
+ Coverage   72.2050%   74.2928%   +2.0877%     
================================================
  Files          1467       1467                
  Lines        427020     427484       +464     
================================================
+ Hits         308330     317590      +9260     
+ Misses        99515      90046      -9469     
- Partials      19175      19848       +673     
Flag Coverage Δ
integration 48.7543% <100.0000%> (?)
unit 71.0044% <100.0000%> (-0.0909%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (ø)
parser ∅ <ø> (∅)
br 49.6474% <ø> (+8.5451%) ⬆️

@zyguan zyguan mentioned this pull request Apr 12, 2024
13 tasks
@crazycs520
Copy link
Contributor Author

#52494 has a better fix than this.

@crazycs520 crazycs520 closed this Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved needs-1-more-lgtm release-note-none size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stale read query's slow-log doesn't record the StmtReadTS
3 participants