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

prefetch: the prefetch buffer should be fully filled #59496

Merged
merged 3 commits into from
Feb 14, 2025

Conversation

lance6716
Copy link
Contributor

@lance6716 lance6716 commented Feb 13, 2025

What problem does this PR solve?

Issue Number: close #59495

Problem Summary:

What changed and how does it work?

use io.ReadFull to fully fill the buffer

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.

performance increased in a AWS manual test

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/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 13, 2025
Copy link

tiprow bot commented Feb 13, 2025

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

Signed-off-by: lance6716 <[email protected]>
Copy link

codecov bot commented Feb 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.3910%. Comparing base (37d3b3a) to head (62cabf0).
Report is 7 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #59496        +/-   ##
================================================
+ Coverage   72.9945%   73.3910%   +0.3965%     
================================================
  Files          1693       1693                
  Lines        468009     468842       +833     
================================================
+ Hits         341621     344088      +2467     
+ Misses       105364     103755      -1609     
+ Partials      21024      20999        -25     
Flag Coverage Δ
integration 42.9106% <0.0000%> (?)
unit 72.2021% <100.0000%> (-0.0023%) ⬇️

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

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 45.4853% <ø> (+0.0112%) ⬆️

@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 13, 2025
Copy link
Collaborator

@Benjamin2037 Benjamin2037 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented Feb 14, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Benjamin2037, D3Hunter

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 [Benjamin2037,D3Hunter]

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 Feb 14, 2025
Copy link

ti-chi-bot bot commented Feb 14, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-13 10:24:03.410966977 +0000 UTC m=+524885.807189036: ☑️ agreed by D3Hunter.
  • 2025-02-14 02:51:50.69570774 +0000 UTC m=+584153.091929802: ☑️ agreed by Benjamin2037.

@lance6716
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Feb 14, 2025

@lance6716: 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.

@@ -54,14 +55,20 @@ func (r *Reader) run() {
for {
r.bufIdx = (r.bufIdx + 1) % 2
buf := r.buf[r.bufIdx]
n, err := r.r.Read(buf)
n, err := io.ReadFull(r.r, buf)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need add comment to explain why read will not return the err?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

err is saved in r.err in line 72. And in line 89 it will be returned to user

@ti-chi-bot ti-chi-bot bot merged commit f684d41 into pingcap:master Feb 14, 2025
24 checks passed
@lance6716
Copy link
Contributor Author

/cherry-pick release-8.1

@lance6716
Copy link
Contributor Author

/cherry-pick release-8.5

@ti-chi-bot
Copy link
Member

@lance6716: new pull request created to branch release-8.1: #59537.

In response to this:

/cherry-pick release-8.1

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

@lance6716: new pull request created to branch release-8.5: #59538.

In response to this:

/cherry-pick release-8.5

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 ti-community-infra/tichi repository.

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.

performance is not expected for prefetch reader
4 participants