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

*: Update hasSysDB using check ID instead of Name, and support all other types. #43823

Closed
wants to merge 4 commits into from

Conversation

zimulala
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #43818

Problem Summary:

What is changed and how it works?

  • Update hasSysDB using check ID instead of Name, and support all other types.
  • Clean up the log(get global state and global state change) when the TiDB is notOwner.
  • Replace IsPausedBySystem with IsPauseBySystem.

Check List

Tests

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

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
Copy link

ti-chi-bot bot commented May 15, 2023

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot bot added release-note-none do-not-merge/needs-triage-completed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 15, 2023
Comment on lines 111 to 116
// Make test faster.
if intest.InTest {
time.Sleep(5 * time.Millisecond)
} else {
time.Sleep(30 * time.Millisecond)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the whole function mockUpgradeToVerLatest is only used in tests?

Copy link
Contributor Author

@zimulala zimulala May 15, 2023

Choose a reason for hiding this comment

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

No,we also use it in IT

Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please update the comment to indicate that the new one is for unit test?

@@ -369,32 +369,41 @@ func (d *ddl) addBatchDDLJobs2Table(tasks []*limitJobTask) error {
startTS = txn.StartTS()
return nil
})
if err == nil {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file only update two place.
One is here, make meet err != nil return directly.

setJobStateToQueueing(job)

if d.stateSyncer.IsUpgradingState() {
hasSysDB, err := util.HasSysDB(job)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another is check the HasSysDB's error.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe wrap this block into a separate function trySetJobToPausing() or setJobPausingForUpgrade()?

@pingcap pingcap deleted a comment from ti-chi-bot bot May 15, 2023
@pingcap pingcap deleted a comment from ti-chi-bot bot May 15, 2023
// HasSysDB checks if it has a system database.
func HasSysDB(job *model.Job) (bool, error) {
// TODO: Handle for the schema ID is 0, like ActionCreatePlacementPolicy.
switch job.Type {
Copy link
Contributor

@tangenta tangenta May 15, 2023

Choose a reason for hiding this comment

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

I wonder if it's really necessary to enumerate all the possible job types. Can't we determine this by the job.SchemaID or job.SchemaName?

@ti-chi-bot
Copy link

ti-chi-bot bot commented May 16, 2023

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

@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 16, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jul 6, 2023

@zimulala: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-br-integration-test f45c26c link true /test pull-br-integration-test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@ti-chi-bot
Copy link
Member

@zimulala: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-br-integration-test f45c26c link true /test pull-br-integration-test

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. I understand the commands that are listed here.

@zimulala zimulala closed this Sep 11, 2023
@zimulala zimulala deleted the zimuxia/check-sys branch September 11, 2023 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-7.1 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none 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.

Update hasSysDB using check ID instead of name or get all related DBs
3 participants