Skip to content

compact_log_backup: optimize compact#18882

Merged
ti-chi-bot[bot] merged 21 commits intotikv:masterfrom
Leavrth:optimize-compact
Oct 27, 2025
Merged

compact_log_backup: optimize compact#18882
ti-chi-bot[bot] merged 21 commits intotikv:masterfrom
Leavrth:optimize-compact

Conversation

@Leavrth
Copy link
Contributor

@Leavrth Leavrth commented Aug 27, 2025

What is changed and how it works?

Issue Number: Close #18843, Close #18950

What's Changed:

1. Remove read_buf_exact_size for s3 hyper client
2. Use cloud::blob::read_to_end to read migrations from futures::io::AsyncRead
3. Use bytes::Bytes to speed up deallocating MetaFile

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

None

Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. 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 Aug 27, 2025
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 28, 2025
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 9, 2025
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 22, 2025
Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <36503113+Leavrth@users.noreply.github.com>
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Oct 22, 2025
Signed-off-by: Jianjun Liao <36503113+Leavrth@users.noreply.github.com>
let exp = self.expiring(&item);
if !exp.is_empty() {
result.push(exp);
if item.min_ts <= until_ts {
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the meaning of min_ts here? should we check max_ts too ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if min_ts of the metadata file is larger than the compaction task until_ts, no kv will be chosen to compact. Therefore, there is no need to record it into migration.

Copy link
Contributor

Choose a reason for hiding this comment

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

If so, I think we can filter metadata not only check byts but also by key range span in the expiring.

Maybe we can do it in another PR.

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Oct 27, 2025

[APPROVALNOTIFIER] This PR is APPROVED

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

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

ti-chi-bot bot commented Oct 27, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-10-22 10:03:11.803237774 +0000 UTC m=+866097.880490334: ☑️ agreed by YuJuncen.
  • 2025-10-27 04:15:41.089237469 +0000 UTC m=+1277247.166490029: ☑️ agreed by 3pointer.

Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
@Leavrth
Copy link
Contributor Author

Leavrth commented Oct 27, 2025

/retest

@Leavrth
Copy link
Contributor Author

Leavrth commented Oct 27, 2025

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Oct 27, 2025
@ti-chi-bot ti-chi-bot bot merged commit d50767d into tikv:master Oct 27, 2025
9 checks passed
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Oct 27, 2025
YuJuncen added a commit to YuJuncen/tikv that referenced this pull request Dec 5, 2025
close tikv#18843, close tikv#18950

1. Remove read_buf_exact_size for s3 hyper client
2. Use cloud::blob::read_to_end to read migrations from futures::io::AsyncRead
3. Use bytes::Bytes to speed up deallocating MetaFile

Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <36503113+Leavrth@users.noreply.github.com>
Signed-off-by: Juncen Yu <yujuncen@pingcap.com>
YuJuncen added a commit to YuJuncen/tikv that referenced this pull request Dec 5, 2025
close tikv#18843, close tikv#18950

1. Remove read_buf_exact_size for s3 hyper client
2. Use cloud::blob::read_to_end to read migrations from futures::io::AsyncRead
3. Use bytes::Bytes to speed up deallocating MetaFile

Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <36503113+Leavrth@users.noreply.github.com>
Signed-off-by: Juncen Yu <yujuncen@pingcap.com>
YuJuncen added a commit that referenced this pull request Dec 5, 2025
* compact_log_backup: optimize compact (#18882)

close #18843, close #18950

1. Remove read_buf_exact_size for s3 hyper client
2. Use cloud::blob::read_to_end to read migrations from futures::io::AsyncRead
3. Use bytes::Bytes to speed up deallocating MetaFile

Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <36503113+Leavrth@users.noreply.github.com>
Signed-off-by: Juncen Yu <yujuncen@pingcap.com>

* mute clippy

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

* make format

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

---------

Signed-off-by: Jianjun Liao <jianjun.liao@outlook.com>
Signed-off-by: Jianjun Liao <36503113+Leavrth@users.noreply.github.com>
Signed-off-by: Juncen Yu <yujuncen@pingcap.com>
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 ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

implement read_to_end trait function for external storage backup-compact: compact duplicated metadata

3 participants