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

Add compaction prefetching internal stats #13302

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

archang19
Copy link
Contributor

@archang19 archang19 commented Jan 16, 2025

Summary

(Work in progress)

I searched for all the places with new FilePrefetchBuffer.

GetOrCreatePrefetchBuffer inside PrefetchBufferCollection is used for blob files only.

BlockBasedTableReader has a CreateFilePrefetchBuffer method which is used in PartitionedFilterBlockReader and PartitionedIndexReader.

CreateFilePrefetchBufferIfNotExists however is used by BlockPrefetcher inside PrefetchIfNeeded, which is called by BlockBasedtableIterator and PartitionedIndexIterator.

I did not enable InternalStats for all use cases because there are many, many places in the codebase, and for what we are interested in, I don't think all the usages are relevant.

Right now, we care about the compaction prefetching buffer memory usage.

Test Plan

Work in progress

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68224419

@facebook-github-bot
Copy link
Contributor

@archang19 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68224419

archang19 added a commit to archang19/rocksdb that referenced this pull request Jan 16, 2025
Summary: Pull Request resolved: facebook#13302

Differential Revision: D68224419

Pulled By: archang19
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68224419

archang19 added a commit to archang19/rocksdb that referenced this pull request Jan 16, 2025
Summary: Pull Request resolved: facebook#13302

Differential Revision: D68224419

Pulled By: archang19
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68224419

archang19 added a commit to archang19/rocksdb that referenced this pull request Jan 16, 2025
Summary: Pull Request resolved: facebook#13302

Differential Revision: D68224419

Pulled By: archang19
archang19 added a commit to archang19/rocksdb that referenced this pull request Jan 16, 2025
Summary: Pull Request resolved: facebook#13302

Differential Revision: D68224419

Pulled By: archang19
@facebook-github-bot
Copy link
Contributor

@archang19 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68224419

archang19 added a commit to archang19/rocksdb that referenced this pull request Jan 16, 2025
Summary: Pull Request resolved: facebook#13302

Differential Revision: D68224419

Pulled By: archang19
archang19 added a commit to archang19/rocksdb that referenced this pull request Jan 16, 2025
Summary: Pull Request resolved: facebook#13302

Differential Revision: D68224419

Pulled By: archang19
@facebook-github-bot
Copy link
Contributor

@archang19 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68224419

archang19 added a commit to archang19/rocksdb that referenced this pull request Jan 16, 2025
Summary: Pull Request resolved: facebook#13302

Differential Revision: D68224419

Pulled By: archang19
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68224419

archang19 added a commit to archang19/rocksdb that referenced this pull request Jan 17, 2025
Summary: Pull Request resolved: facebook#13302

Differential Revision: D68224419

Pulled By: archang19
@facebook-github-bot
Copy link
Contributor

@archang19 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@@ -781,7 +781,7 @@ Status CompactionJob::Run() {
cfd->internal_comparator(), files_output[file_idx]->meta,
/*range_del_agg=*/nullptr,
compact_->compaction->mutable_cf_options(),
/*table_reader_ptr=*/nullptr,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the part that we care about the most IMO. We want to have internal_stats passed in from CompactionJob::Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants