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

*: fix auto-id allocate tracing #22371

Merged
merged 3 commits into from
Jan 13, 2021

Conversation

tiancaiamao
Copy link
Contributor

What problem does this PR solve?

Problem Summary:

I'm misled by the trace result of auto-id allocating.
The code is not placed in the correct place.
The allocator caches base and end of the IDs, so even the code run to Alloc(), that does not necessarily mean obtaining a new auto-id from TiKV.

What is changed and how it works?

What's Changed:

  • Add a context parameter to func RunInNewTxn(ctx context.Context ...) function.
  • Move the opentracing.SpanFromContext code from Alloc() to RunInNewTxn

How it Works:

Move the tracing code to the correct place.

Check List

Tests

  • No code

Release note

  • No release note

@tiancaiamao tiancaiamao requested a review from a team as a code owner January 12, 2021 13:50
@tiancaiamao tiancaiamao requested review from qw4990 and removed request for a team January 12, 2021 13:50
@tiancaiamao tiancaiamao added the type/enhancement The issue or PR belongs to an enhancement. label Jan 12, 2021
@github-actions github-actions bot added sig/execution SIG execution sig/sql-infra SIG: SQL Infra labels Jan 12, 2021
@tiancaiamao
Copy link
Contributor Author

/rebuild

Copy link
Contributor

@AilinKid AilinKid 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-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 13, 2021
Copy link
Contributor

@lysu lysu 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-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Jan 13, 2021
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Jan 13, 2021
@tiancaiamao
Copy link
Contributor Author

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 13, 2021
@ti-srebot
Copy link
Contributor

/run-all-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants