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 slow_query bug when query with time e... (#16768) #16806

Merged
merged 3 commits into from
Apr 24, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Apr 24, 2020

cherry-pick #16768 to release-4.0


What problem does this PR solve?

The #16445 PR not work, since the precision of slow log is nanosecond, but TiDB time precision is microsecond.

Fix below bug.

mysql>select time from cluster_slow_query limit 1
+----------------------------+
| time                       |
+----------------------------+
| 2020-03-13 10:36:27.299064 |
+----------------------------+
1 row in set
Time: 0.020s
mysql>select time from cluster_slow_query where time='2019-12-30 22:55:47.200716' limit 1;
+------+
| time |  -- should has at 1 item.
+------+
0 rows in set

tidb-slow.log

# Time: 2020-03-13T10:36:27.299063744+08:00
# Txn_start_ts: 415253656258478098
# User: [email protected]
# Conn_ID: 4311306
# Query_time: 0.22649397
# Process_time: 0.015 Wait_time: 0.015 Backoff_time: 0.21 Request_count: 14 Total_keys: 439 Process_keys: 426
# DB: seewo_performance_tidb
# Index_ids: [2]
# Is_internal: false
# Digest: 9ee332c0e08d5c27a3f061aaca1fe1c1d1c016713fc7204ced3430771c88fb33

What is changed and how it works?

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM

Release note

@sre-bot sre-bot requested a review from a team as a code owner April 24, 2020 11:14
@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 24, 2020

/run-all-tests

@breezewish
Copy link
Member

LGTM

@breezewish
Copy link
Member

/run-integration-copr-test

@crazycs520 crazycs520 added the priority/release-blocker This issue blocks a release. Please solve it ASAP. label Apr 24, 2020
Deardrops
Deardrops previously approved these changes Apr 24, 2020
Copy link
Contributor

@Deardrops Deardrops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, wait for #16643

Signed-off-by: crazycs520 <[email protected]>
@crazycs520
Copy link
Contributor

/run-all-tests

@crazycs520
Copy link
Contributor

/run-integration-copr-test

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason zz-jason changed the title executor: fix slow_query bug when query with time equal condition (#16768) executor: fix slow_query bug when query with time e... (#16768) Apr 24, 2020
@zz-jason zz-jason merged commit efc5d9c into pingcap:release-4.0 Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/release-blocker This issue blocks a release. Please solve it ASAP. sig/execution SIG execution type/bugfix This PR fixes a bug. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants