Skip to content

azblob: use copy to implement read_to_end#18411

Merged
ti-chi-bot[bot] merged 2 commits intotikv:masterfrom
YuJuncen:fix-azblob-upload-slow
Apr 25, 2025
Merged

azblob: use copy to implement read_to_end#18411
ti-chi-bot[bot] merged 2 commits intotikv:masterfrom
YuJuncen:fix-azblob-upload-slow

Conversation

@YuJuncen
Copy link
Contributor

@YuJuncen YuJuncen commented Apr 23, 2025

What is changed and how it works?

Issue Number: Close #18410

What's Changed:

Now `azblob` uses io::copy instead of `read_to_end` to read contents.

Diff (In the scenario of reading 2 bytes per read, about 50x faster):

Before: // 255,120,895 ns/iter (+/- 73,332,249) (futures-util 0.3.15)
After:  // 5,850,042 ns/iter (+/- 3,787,438)

For more details, check the benchmark bench[_manual]_read_to_end in components/cloud/src/blob.rs.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

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

Release note

Fixed a bug that may cause flush operation slow in azure blob storage.

Signed-off-by: Juncen Yu <yujuncen@pingcap.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has signed the dco. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 23, 2025
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Apr 23, 2025
Signed-off-by: Juncen Yu <yujuncen@pingcap.com>
@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 25, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Apr 25, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-04-23 09:56:36.629076785 +0000 UTC m=+435940.440867166: ☑️ agreed by Leavrth.
  • 2025-04-25 05:40:19.197190216 +0000 UTC m=+593363.008980595: ☑️ agreed by 3pointer.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Apr 25, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 3pointer, iosmanthus, Leavrth

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

The pull request process is described here

Details 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 Apr 25, 2025
@ti-chi-bot ti-chi-bot bot merged commit 97a8901 into tikv:master Apr 25, 2025
8 checks passed
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Apr 25, 2025
@YuJuncen YuJuncen added the needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. label Apr 27, 2025
@YuJuncen
Copy link
Contributor Author

/run-cherry-picker

ti-chi-bot pushed a commit to ti-chi-bot/tikv that referenced this pull request Apr 27, 2025
close tikv#18410

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #18419.
But this PR has conflicts, please resolve them!

@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Jul 2, 2025
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #18615.

ti-chi-bot bot pushed a commit that referenced this pull request Jul 8, 2025
close #18410

Now `azblob` uses io::copy instead of `read_to_end` to read contents.

Signed-off-by: Juncen Yu <yujuncen@pingcap.com>

Co-authored-by: Juncen Yu <yujuncen@pingcap.com>
ti-chi-bot bot pushed a commit that referenced this pull request Jul 22, 2025
close #18410

Now `azblob` uses io::copy instead of `read_to_end` to read contents.

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Juncen Yu <yujuncen@pingcap.com>

Co-authored-by: 山岚 <36239017+YuJuncen@users.noreply.github.com>
Co-authored-by: Juncen Yu <yujuncen@pingcap.com>
YuJuncen added a commit that referenced this pull request Aug 4, 2025
close #18410

Now `azblob` uses io::copy instead of `read_to_end` to read contents.

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Juncen Yu <yujuncen@pingcap.com>

Co-authored-by: 山岚 <36239017+YuJuncen@users.noreply.github.com>
Co-authored-by: Juncen Yu <yujuncen@pingcap.com>
@ti-chi-bot ti-chi-bot bot removed needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. labels Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

Azureblob upload may be slow when reading from non-memory source

5 participants