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 select wrong partition for hash partition table #50430

Merged
merged 4 commits into from
Jan 16, 2024

Conversation

Defined2014
Copy link
Contributor

What problem does this PR solve?

Issue Number: close #50427

Problem Summary: Still caused by #49853, I made a mistake about mathutil.Abs and select a wrong partiton for hash partition table.

What changed and how does it work?

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 release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 15, 2024
Copy link

tiprow bot commented Jan 15, 2024

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

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

Merging #50430 (e5710ab) into master (5faf86c) will decrease coverage by 14.2794%.
Report is 11 commits behind head on master.
The diff coverage is 100.0000%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #50430         +/-   ##
=================================================
- Coverage   70.0709%   55.7916%   -14.2794%     
=================================================
  Files          1444       1551        +107     
  Lines        420010     584982     +164972     
=================================================
+ Hits         294305     326371      +32066     
- Misses       105423     235902     +130479     
- Partials      20282      22709       +2427     
Flag Coverage Δ
integration 36.4751% <100.0000%> (?)

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

Components Coverage Δ
dumpling 54.0269% <ø> (ø)
parser ∅ <ø> (∅)
br 55.1954% <ø> (+5.5222%) ⬆️

@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 15, 2024
}
}

// if range is less than the number of partitions, there will be unused partitions we can prune out.
if rangeScalar < uint64(numPartitions) && !highIsNull && !lowIsNull {
var i int64
for i = 0; i <= int64(rangeScalar); i++ {
idx := mathutil.Abs(offset+i) % int64(numPartitions)
idx := mathutil.Abs((posLow + i) % int64(numPartitions))
Copy link
Contributor Author

@Defined2014 Defined2014 Jan 15, 2024

Choose a reason for hiding this comment

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

Ref https://github.com/pingcap/tidb/pull/49853/files#diff-4990f33f249ec8823358eef763ccfccd9284b58d4942eba35b7b4e22c16b1a33L193, let it same as before.

Although I think the behaviour of hash function is strange, it already works for a long time. Just change it back.

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 15, 2024
Copy link

ti-chi-bot bot commented Jan 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tiancaiamao, xhebox

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 lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jan 16, 2024
Copy link

ti-chi-bot bot commented Jan 16, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-01-15 12:54:59.663035833 +0000 UTC m=+187741.227333538: ☑️ agreed by xhebox.
  • 2024-01-16 02:03:40.056607945 +0000 UTC m=+235061.620905673: ☑️ agreed by tiancaiamao.

@ti-chi-bot ti-chi-bot bot merged commit 9fb89b0 into pingcap:master Jan 16, 2024
22 checks passed
@Defined2014 Defined2014 deleted the fix-50427 branch March 29, 2024 06:17
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

incorrect partition location using between
3 participants