Skip to content

Reimplement keys to not depend on put_range_in_cache #6919

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

Merged
merged 4 commits into from
Jul 14, 2025

Conversation

HaoranYi
Copy link

@HaoranYi HaoranYi commented Jul 10, 2025

Problem

put_range_in_cache was originally introduced to support rent scanning by keeping certain key ranges in memory. However, since we no longer perform range-based rent scanning, this mechanism is now obsolete.

This PR refactors the keys() to stop relying on put_range_in_cache. With this change, there are no remaining dependencies on put_range_in_cache in the index scan path.

This lays the groundwork for a future PR (#6920) to fully remove hold_range_in_memory from the codebase.

Summary of Changes
reimplement keys to not use put_range_in_cache.

Summary of Changes

Fixes #

@HaoranYi HaoranYi marked this pull request as draft July 10, 2025 15:37
@HaoranYi HaoranYi changed the title rework keys Reimplement keys to not depend on put_range_in_cache Jul 10, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 10, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Project coverage is 83.2%. Comparing base (a056aac) to head (b536657).
Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6919   +/-   ##
=======================================
  Coverage    83.2%    83.2%           
=======================================
  Files         856      856           
  Lines      376863   376869    +6     
=======================================
+ Hits       313749   313773   +24     
+ Misses      63114    63096   -18     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HaoranYi HaoranYi force-pushed the rework_keys branch 4 times, most recently from 4fa55ec to 5c228c0 Compare July 11, 2025 18:55
@HaoranYi HaoranYi marked this pull request as ready for review July 11, 2025 20:06
if let Some(disk) = self.bucket.as_ref() {
for key in disk.keys() {
if !map.contains_key(&key) {
keys.insert(key);

Choose a reason for hiding this comment

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

just do insert. doesn't hurt to insert it again.

Copy link
Author

Choose a reason for hiding this comment

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

updated.

}
}
}
drop(map);

Choose a reason for hiding this comment

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

i'd put this drop above after we get keys from map. we don't need to hold it open. This was always a lossy operation.

Copy link
Author

Choose a reason for hiding this comment

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

updated.

@brooksprumo brooksprumo self-requested a review July 14, 2025 14:52
Copy link

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

:shipit:

@HaoranYi HaoranYi merged commit acdd38a into anza-xyz:master Jul 14, 2025
41 checks passed
@HaoranYi HaoranYi deleted the rework_keys branch July 14, 2025 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants