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

ddl: query since min job id #54693

Merged
merged 2 commits into from
Jul 22, 2024
Merged

ddl: query since min job id #54693

merged 2 commits into from
Jul 22, 2024

Conversation

D3Hunter
Copy link
Contributor

@D3Hunter D3Hunter commented Jul 17, 2024

What problem does this PR solve?

Issue Number: ref #54436

Problem Summary:

What changed and how does it work?

second pr mentioned in #54547, now we pessimistic lock global id, and generate global id and insert job in one txn, so we can make sure when job of ID A which is the minimum in a txn submitted, no jobs of ID < A can be inserted, so it's safe to query since min job id

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)

same case as in #54581, takes 11m24, and there is very little speed degradation now

image

  • 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

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 17, 2024
Copy link

tiprow bot commented Jul 17, 2024

Hi @D3Hunter. 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.

@D3Hunter D3Hunter mentioned this pull request Jul 17, 2024
54 tasks
Copy link

codecov bot commented Jul 17, 2024

Codecov Report

Attention: Patch coverage is 65.90909% with 45 lines in your changes missing coverage. Please review.

Project coverage is 56.1579%. Comparing base (8cd82a4) to head (af7b9e4).
Report is 36 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #54693         +/-   ##
=================================================
- Coverage   72.7411%   56.1579%   -16.5833%     
=================================================
  Files          1551       1680        +129     
  Lines        437183     617904     +180721     
=================================================
+ Hits         318012     347002      +28990     
- Misses        99532     247276     +147744     
- Partials      19639      23626       +3987     
Flag Coverage Δ
integration 37.1749% <67.0454%> (?)
unit 71.7726% <65.9090%> (+0.0181%) ⬆️

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

Components Coverage Δ
dumpling 52.9656% <ø> (ø)
parser ∅ <ø> (∅)
br 52.4734% <ø> (+6.6330%) ⬆️

@@ -411,16 +411,17 @@ func (d *ddl) addBatchDDLJobs(jobWs []*JobWrapper) error {
return nil
}

ctx := kv.WithInternalSourceType(context.Background(), kv.InternalTxnDDL)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ctx := kv.WithInternalSourceType(context.Background(), kv.InternalTxnDDL)
ctx := kv.WithInternalSourceType(d.ctx, kv.InternalTxnDDL)

schCtx: ctx,
cancel: cancelFunc,
runningJobs: newRunningJobs(),
sysTblMgr: sysTblMgr,
Copy link
Contributor

Choose a reason for hiding this comment

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

can we use ddl.sysTblMgr?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's just a wrapper around session pool, both lgtm

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jul 19, 2024
@D3Hunter
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Jul 19, 2024

@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@D3Hunter
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Jul 19, 2024

@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

Copy link

ti-chi-bot bot commented Jul 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, tangenta

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

@ti-chi-bot ti-chi-bot bot added approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 22, 2024
Copy link

ti-chi-bot bot commented Jul 22, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-19 09:18:18.12822595 +0000 UTC m=+604720.119167419: ☑️ agreed by lance6716.
  • 2024-07-22 06:43:20.962946371 +0000 UTC m=+854622.953887841: ☑️ agreed by tangenta.

@ti-chi-bot ti-chi-bot bot merged commit 0311052 into pingcap:master Jul 22, 2024
23 checks passed
@D3Hunter D3Hunter deleted the min-job-id2 branch July 22, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants