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

ticdc: fix update calls to runtime.fastrand to use cheaprand for compatibility with Go 1.22 #10755

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Aoang
Copy link

@Aoang Aoang commented Mar 11, 2024

fix update calls to runtime.fastrand to use cheaprand for compatibility with Go 1.22

In Golang 1.22, the runtime.fastrand method was renamed to cheaprand. This commit updates all occurrences of runtime.fastrand in the project to use the new cheaprand method to maintain compatibility with the latest Golang version and address performance concerns.

Refer: https://gist.github.com/Aoang/3dc06f127f3f54507b7e06b7b6550c28

What problem does this PR solve?

Issue Number: close #xxx

What is changed and how it works?

Check List

Tests

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

Questions

None

Will it cause performance regression or break compatibility?

None

Do you need to update user documentation, design documentation or monitoring documentation?

None

Release note

None

Please refer to [Release Notes Language Style Guide](https://pingcap.github.io/tidb-dev-guide/contribute-to-tidb/release-notes-style-guide.html) to write a quality release note.

If you don't think this PR needs a release note then fill it with `None`.

…atibility with Go 1.22

In Golang 1.22, the `runtime.fastrand` method was renamed to `cheaprand`.
This commit updates all occurrences of `runtime.fastrand` in the project
to use the new `cheaprand` method to maintain compatibility with the latest
Golang version and address performance concerns.

Refer: https://gist.github.com/Aoang/3dc06f127f3f54507b7e06b7b6550c28
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Mar 11, 2024
Copy link
Contributor

ti-chi-bot bot commented Mar 11, 2024

[FORMAT CHECKER NOTIFICATION]

Notice: To remove the do-not-merge/needs-linked-issue label, please provide the linked issue number on one line in the PR body, for example: Issue Number: close #123 or Issue Number: ref #456.

📖 For more info, you can check the "Contribute Code" section in the development guide.

@sre-bot
Copy link

sre-bot commented Mar 11, 2024

CLA assistant check
All committers have signed the CLA.

@ti-chi-bot ti-chi-bot bot added contribution This PR is from a community contributor. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. labels Mar 11, 2024
Copy link
Contributor

ti-chi-bot bot commented Mar 11, 2024

Welcome @Aoang!

It looks like this is your first PR to pingcap/tiflow 🎉.

I'm the bot to help you request reviewers, add labels and more, See available commands.

We want to make sure your contribution gets all the attention it needs!



Thank you, and welcome to pingcap/tiflow. 😃

Copy link
Contributor

ti-chi-bot bot commented Mar 11, 2024

Hi @Aoang. Thanks for your PR.

I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@ti-chi-bot ti-chi-bot bot added needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 11, 2024
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Mar 13, 2024
@CharlesCheung96 CharlesCheung96 self-requested a review March 13, 2024 15:32
@CharlesCheung96 CharlesCheung96 removed approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 13, 2024
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 13, 2024
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Mar 18, 2024
Copy link
Contributor

ti-chi-bot bot commented Mar 18, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-03-13 15:31:36.78843135 +0000 UTC m=+872323.810677738: ☑️ agreed by CharlesCheung96.
  • 2024-03-18 07:12:51.964612889 +0000 UTC m=+1274398.986859277: ☑️ agreed by 3AceShowHand.

Copy link

codecov bot commented Mar 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.5311%. Comparing base (0424aba) to head (fd5bdc5).
Report is 269 commits behind head on master.

Additional details and impacted files
Components Coverage Δ
cdc 61.8560% <ø> (-0.0674%) ⬇️
dm 51.2151% <ø> (+0.0302%) ⬆️
engine 63.4148% <ø> (+0.0423%) ⬆️
Flag Coverage Δ
unit 57.5311% <ø> (-0.0138%) ⬇️

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

@@               Coverage Diff                @@
##             master     #10755        +/-   ##
================================================
- Coverage   57.5449%   57.5311%   -0.0138%     
================================================
  Files           853        853                
  Lines        126807     126886        +79     
================================================
+ Hits          72971      72999        +28     
- Misses        48393      48448        +55     
+ Partials       5443       5439         -4     

Copy link
Contributor

ti-chi-bot bot commented Mar 18, 2024

@Aoang: 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-cdc-integration-kafka-test fd5bdc5 link true /test cdc-integration-kafka-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.

Copy link
Contributor

ti-chi-bot bot commented Mar 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3AceShowHand, CharlesCheung96

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:
  • OWNERS [3AceShowHand,CharlesCheung96]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved contribution This PR is from a community contributor. do-not-merge/needs-linked-issue first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. lgtm needs-ok-to-test Indicates a PR created by contributors and need ORG member send '/ok-to-test' to start testing. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

4 participants