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

types: use flags in types package to handle clip zero case #47543

Merged
merged 6 commits into from
Oct 19, 2023

Conversation

lcwangchao
Copy link
Collaborator

What problem does this PR solve?

Issue Number: close #47518

What is changed and how it works?

This is one of the PR for code refactor, see: #47355

We use FlagClipNegativeToZero to indicate whether to clip the negative value to zero when casting the negative number to be unsigned.

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

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 11, 2023
@lcwangchao
Copy link
Collaborator Author

/run-check-issue-triage-complete

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Merging #47543 (5590475) into master (90bd2dd) will increase coverage by 0.9374%.
Report is 1 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #47543        +/-   ##
================================================
+ Coverage   71.8537%   72.7911%   +0.9374%     
================================================
  Files          1398       1421        +23     
  Lines        405209     411591      +6382     
================================================
+ Hits         291158     299602      +8444     
+ Misses        94396      93143      -1253     
+ Partials      19655      18846       -809     
Flag Coverage Δ
integration 41.4618% <90.9090%> (?)
unit 71.8552% <88.6363%> (+0.0014%) ⬆️

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

Components Coverage Δ
dumpling 53.9913% <ø> (ø)
parser ∅ <ø> (∅)
br 48.7105% <100.0000%> (-4.2406%) ⬇️

@lcwangchao lcwangchao changed the title types: use flags in types package to handle clip zero case WIP: types: use flags in types package to handle clip zero case Oct 11, 2023
@ti-chi-bot ti-chi-bot bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 11, 2023
@lcwangchao lcwangchao changed the title WIP: types: use flags in types package to handle clip zero case types: use flags in types package to handle clip zero case Oct 12, 2023
@ti-chi-bot ti-chi-bot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 12, 2023
@lcwangchao
Copy link
Collaborator Author

/retest tiprow_fast_test

@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 16, 2023

@lcwangchao: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

  • /test build
  • /test canary-scan-security
  • /test check-dev
  • /test check-dev2
  • /test mysql-test
  • /test pingcap/tidb/canary_ghpr_unit_test
  • /test pull-br-integration-test
  • /test pull-common-test
  • /test pull-e2e-test
  • /test pull-integration-common-test
  • /test pull-integration-copr-test
  • /test pull-integration-ddl-test
  • /test pull-integration-jdbc-test
  • /test pull-integration-mysql-test
  • /test pull-integration-nodejs-test
  • /test pull-mysql-client-test
  • /test pull-sqllogic-test
  • /test pull-tiflash-test
  • /test unit-test

The following commands are available to trigger optional jobs:

  • /test pull-notify-when-compatibility-sections-changed

Use /test all to run the following jobs that were automatically triggered:

  • pingcap/tidb/ghpr_build
  • pingcap/tidb/ghpr_check
  • pingcap/tidb/ghpr_check2
  • pingcap/tidb/ghpr_mysql_test
  • pingcap/tidb/ghpr_unit_test

In response to this:

/retest tiprow_fast_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.

@tiprow
Copy link

tiprow bot commented Oct 16, 2023

@lcwangchao: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/retest tiprow_fast_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.

@lcwangchao lcwangchao force-pushed the typectx_clip_zero branch 2 times, most recently from f1bd2c8 to 19d0bef Compare October 16, 2023 06:40
@lcwangchao
Copy link
Collaborator Author

/retest

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Oct 17, 2023
Copy link
Member

@YangKeao YangKeao left a comment

Choose a reason for hiding this comment

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

Rest LGTM

tz := *time.UTC
sessCtx.GetSessionVars().StmtCtx.SetTimeZone(&tz)
}
sessCtx.GetSessionVars().StmtCtx.IsDDLJobInQueue = true
Copy link
Member

Choose a reason for hiding this comment

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

Is this change expected? Though it seems that it's only used in pkg/executor/ddl.go 🤔 .

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think IsDDLJobInQueue is used to make ShouldClipToZeror in the previous code. The verify CI passed after removing it.. @tangenta PTAL

Copy link
Member

Choose a reason for hiding this comment

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

IIUC, pkg/executor/ddl.go is not related with pkg/ddl/backfilling_scheduler.go 🤔 , so it seems fine for this case.

@lcwangchao
Copy link
Collaborator Author

/test check-dev2

@tiprow
Copy link

tiprow bot commented Oct 18, 2023

@lcwangchao: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test tiprow_fast_test

Use /test all to run all jobs.

In response to this:

/test check-dev2

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.

Copy link
Member

@YangKeao YangKeao 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-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Oct 18, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 18, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-10-17 04:10:15.518836038 +0000 UTC m=+1716613.105946183: ☑️ agreed by lance6716.
  • 2023-10-18 06:43:04.301501956 +0000 UTC m=+1812181.888612101: ☑️ agreed by YangKeao.

@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lance6716, XuHuaiyu, YangKeao

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 the approved label Oct 19, 2023
@ti-chi-bot ti-chi-bot bot merged commit 987663f into pingcap:master Oct 19, 2023
15 of 16 checks passed
@lcwangchao lcwangchao deleted the typectx_clip_zero branch October 19, 2023 08:16
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use FlagClipNegativeToZero to handle clip to zero case in types package
4 participants