Skip to content

Conversation

xzfc
Copy link
Contributor

@xzfc xzfc commented Apr 16, 2025

Related: #6323.

Consider this simplified example:

fn read_data(path: &Path) -> io::Result<Vec<u8>> {
    let file = File::open(path)?;
    let reader = BufReader::new(file);
    let data = Vec::new();
    reader.read_to_end(&mut data)?;
    data
}

The problem with this code is that after calling this function, the file contents is stored twice in the memory: once as Vec<u8> (as anonymous memory), and once implicitly as OS file cache, making it more likely to evict other files from the cache.

Particularly, after reproducing #6323, I've found that quantized vectors and id tracker files are still in the OS file cache when the mmaped index cache gets evicted. Since we are unlikely to read quantized vectors again, we'd better to avoid polluting the OS file cache.

This PR adds a new wrapper around File, OneshotFile, that calls posix_fadvise(…, POSIX_FADV_DONTNEED) when the file is closed. Not ideal, but should improve the situation a bit.

@xzfc xzfc requested review from timvisee and generall April 16, 2025 17:44
Copy link
Contributor

coderabbitai bot commented Apr 16, 2025

📝 Walkthrough

Walkthrough

This set of changes introduces a new fadvise module in the lib/common/memory crate that provides functionality for managing file access patterns and explicit cache eviction using the posix_fadvise system call on supported platforms. A new build script (build.rs) is added to conditionally enable compilation of posix_fadvise-dependent code based on the target OS and environment. The core addition is the OneshotFile struct, a wrapper around std::fs::File that applies sequential and no-reuse access hints and supports explicit cache dropping via drop_cache(). The existing clear_disk_cache function is removed from the madvise module and reimplemented in the new fadvise module. All imports and usages of clear_disk_cache across the codebase are updated to reference the fadvise module. Additionally, several components now use OneshotFile for file reading and explicitly drop file caches after operations, replacing previous uses of standard File.

Suggested reviewers

  • generall
  • timvisee

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 51e227b and 6414477.

📒 Files selected for processing (3)
  • lib/quantization/src/encoded_storage.rs (2 hunks)
  • lib/segment/src/id_tracker/mutable_id_tracker.rs (2 hunks)
  • lib/segment/src/vector_storage/chunked_vectors.rs (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • lib/segment/src/vector_storage/chunked_vectors.rs
  • lib/quantization/src/encoded_storage.rs
  • lib/segment/src/id_tracker/mutable_id_tracker.rs
⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: test-snapshot-operations-s3-minio
  • GitHub Check: test-shard-snapshot-api-s3-minio
  • GitHub Check: test-low-resources
  • GitHub Check: test-consistency
  • GitHub Check: integration-tests-consensus
  • GitHub Check: Basic TLS/HTTPS tests
  • GitHub Check: rust-tests (macos-latest)
  • GitHub Check: integration-tests
  • GitHub Check: lint
  • GitHub Check: rust-tests (windows-latest)
  • GitHub Check: test-consensus-compose
  • GitHub Check: rust-tests (ubuntu-latest)
  • GitHub Check: storage-compat-test

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
lib/segment/src/id_tracker/mutable_id_tracker.rs (1)

659-675: Consider using OneshotFile for loading versions as well.

The load_versions function still uses a standard File while the load_mappings function was updated to use OneshotFile. For consistency and to fully implement the cache optimization strategy, consider updating this function as well.

-    let file = File::open(versions_path)?;
+    let file = OneshotFile::open(versions_path)?;

     let file_len = file.metadata()?.len();
     if file_len % VERSION_ELEMENT_SIZE != 0 {
         log::warn!(
             "Corrupted ID tracker versions storage, file size not a multiple of a version, assuming automatic recovery by WAL"
         );
     }
     let version_count = file_len / VERSION_ELEMENT_SIZE;

     let mut reader = BufReader::new(file);

-    Ok((0..version_count)
+    let result = Ok((0..version_count)
         .map(|_| reader.read_u64::<FileEndianess>())
-        .collect::<Result<_, _>>()?)
+        .collect::<Result<_, _>>()?);
+    
+    // Drop the cache after reading
+    let file = reader.into_inner();
+    file.drop_cache()?;
+    
+    result
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 751fb5a and e5c5748.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (23)
  • lib/common/memory/Cargo.toml (2 hunks)
  • lib/common/memory/build.rs (1 hunks)
  • lib/common/memory/src/fadvise.rs (1 hunks)
  • lib/common/memory/src/lib.rs (1 hunks)
  • lib/common/memory/src/madvise.rs (0 hunks)
  • lib/gridstore/src/bitmask/gaps.rs (1 hunks)
  • lib/gridstore/src/bitmask/mod.rs (1 hunks)
  • lib/gridstore/src/page.rs (1 hunks)
  • lib/quantization/src/encoded_storage.rs (2 hunks)
  • lib/segment/src/id_tracker/mutable_id_tracker.rs (3 hunks)
  • lib/segment/src/index/field_index/full_text_index/mmap_inverted_index/mod.rs (1 hunks)
  • lib/segment/src/index/field_index/geo_index/mmap_geo_index.rs (1 hunks)
  • lib/segment/src/index/field_index/map_index/mmap_map_index.rs (1 hunks)
  • lib/segment/src/index/field_index/mmap_point_to_values.rs (1 hunks)
  • lib/segment/src/index/field_index/numeric_index/mmap_numeric_index.rs (1 hunks)
  • lib/segment/src/index/hnsw_index/hnsw.rs (1 hunks)
  • lib/segment/src/vector_storage/chunked_mmap_vectors.rs (1 hunks)
  • lib/segment/src/vector_storage/chunked_vectors.rs (3 hunks)
  • lib/segment/src/vector_storage/dense/dynamic_mmap_flags.rs (1 hunks)
  • lib/segment/src/vector_storage/dense/memmap_dense_vector_storage.rs (1 hunks)
  • lib/segment/src/vector_storage/quantized/quantized_vectors.rs (1 hunks)
  • lib/sparse/src/index/inverted_index/inverted_index_compressed_mmap.rs (1 hunks)
  • lib/sparse/src/index/inverted_index/inverted_index_mmap.rs (1 hunks)
💤 Files with no reviewable changes (1)
  • lib/common/memory/src/madvise.rs
🧰 Additional context used
🧬 Code Graph Analysis (15)
lib/gridstore/src/bitmask/mod.rs (2)
lib/common/memory/src/fadvise.rs (2)
  • fadvise (11-13)
  • clear_disk_cache (18-26)
lib/common/memory/src/madvise.rs (4)
  • madvise (93-95)
  • madvise (101-101)
  • madvise (107-113)
  • madvise (131-137)
lib/segment/src/vector_storage/quantized/quantized_vectors.rs (1)
lib/common/memory/src/fadvise.rs (2)
  • fadvise (11-13)
  • clear_disk_cache (18-26)
lib/segment/src/vector_storage/dense/memmap_dense_vector_storage.rs (1)
lib/common/memory/src/fadvise.rs (2)
  • fadvise (11-13)
  • clear_disk_cache (18-26)
lib/gridstore/src/page.rs (2)
lib/common/memory/src/fadvise.rs (2)
  • fadvise (11-13)
  • clear_disk_cache (18-26)
lib/common/memory/src/madvise.rs (4)
  • madvise (93-95)
  • madvise (101-101)
  • madvise (107-113)
  • madvise (131-137)
lib/segment/src/index/hnsw_index/hnsw.rs (1)
lib/common/memory/src/fadvise.rs (2)
  • fadvise (11-13)
  • clear_disk_cache (18-26)
lib/segment/src/index/field_index/mmap_point_to_values.rs (2)
lib/common/memory/src/fadvise.rs (2)
  • fadvise (11-13)
  • clear_disk_cache (18-26)
lib/common/memory/src/madvise.rs (4)
  • madvise (93-95)
  • madvise (101-101)
  • madvise (107-113)
  • madvise (131-137)
lib/segment/src/vector_storage/chunked_mmap_vectors.rs (2)
lib/common/memory/src/fadvise.rs (2)
  • fadvise (11-13)
  • clear_disk_cache (18-26)
lib/common/memory/src/madvise.rs (4)
  • madvise (93-95)
  • madvise (101-101)
  • madvise (107-113)
  • madvise (131-137)
lib/sparse/src/index/inverted_index/inverted_index_compressed_mmap.rs (2)
lib/common/memory/src/fadvise.rs (2)
  • fadvise (11-13)
  • clear_disk_cache (18-26)
lib/common/memory/src/madvise.rs (4)
  • madvise (93-95)
  • madvise (101-101)
  • madvise (107-113)
  • madvise (131-137)
lib/segment/src/index/field_index/numeric_index/mmap_numeric_index.rs (2)
lib/common/memory/src/fadvise.rs (2)
  • fadvise (11-13)
  • clear_disk_cache (18-26)
lib/common/memory/src/madvise.rs (4)
  • madvise (93-95)
  • madvise (101-101)
  • madvise (107-113)
  • madvise (131-137)
lib/segment/src/index/field_index/map_index/mmap_map_index.rs (2)
lib/common/memory/src/fadvise.rs (2)
  • fadvise (11-13)
  • clear_disk_cache (18-26)
lib/common/memory/src/madvise.rs (4)
  • madvise (93-95)
  • madvise (101-101)
  • madvise (107-113)
  • madvise (131-137)
lib/segment/src/index/field_index/geo_index/mmap_geo_index.rs (2)
lib/common/memory/src/fadvise.rs (2)
  • fadvise (11-13)
  • clear_disk_cache (18-26)
lib/common/memory/src/madvise.rs (4)
  • madvise (93-95)
  • madvise (101-101)
  • madvise (107-113)
  • madvise (131-137)
lib/quantization/src/encoded_storage.rs (1)
lib/common/memory/src/fadvise.rs (1)
  • fadvise (11-13)
lib/gridstore/src/bitmask/gaps.rs (2)
lib/common/memory/src/fadvise.rs (2)
  • fadvise (11-13)
  • clear_disk_cache (18-26)
lib/common/memory/src/madvise.rs (4)
  • madvise (93-95)
  • madvise (101-101)
  • madvise (107-113)
  • madvise (131-137)
lib/common/memory/src/lib.rs (1)
lib/common/memory/src/fadvise.rs (1)
  • fadvise (11-13)
lib/segment/src/id_tracker/mutable_id_tracker.rs (1)
lib/common/memory/src/fadvise.rs (1)
  • fadvise (11-13)
⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: Basic TLS/HTTPS tests
  • GitHub Check: test-snapshot-operations-s3-minio
  • GitHub Check: test-shard-snapshot-api-s3-minio
  • GitHub Check: test-low-resources
  • GitHub Check: test-consistency
  • GitHub Check: rust-tests (macos-latest)
  • GitHub Check: test-consensus-compose
  • GitHub Check: rust-tests (windows-latest)
  • GitHub Check: integration-tests-consensus
  • GitHub Check: rust-tests (ubuntu-latest)
  • GitHub Check: integration-tests
  • GitHub Check: lint
  • GitHub Check: storage-compat-test
🔇 Additional comments (32)
lib/common/memory/Cargo.toml (2)

16-16: Dependency addition is appropriate.

Adding the delegate crate as a workspace dependency is justified for trait delegation in the new fadvise module.


28-28: Good formatting: newline at end of file.

Adding a newline at EOF is a standard formatting best practice.

lib/segment/src/vector_storage/dense/memmap_dense_vector_storage.rs (1)

12-12: Import update is correct.

Switching the import of clear_disk_cache to memory::fadvise is accurate and aligns with the new implementation.

lib/segment/src/index/field_index/map_index/mmap_map_index.rs (1)

16-16: Import update is correct.

Switching the import of clear_disk_cache to memory::fadvise is accurate and consistent with the new implementation.

lib/gridstore/src/page.rs (1)

4-4: Import update is correct.

Switching the import of clear_disk_cache to memory::fadvise is accurate and aligns with the new implementation.

lib/segment/src/index/field_index/geo_index/mmap_geo_index.rs (1)

9-9: Import update is correct.

Switching the import of clear_disk_cache to memory::fadvise is accurate and consistent with the new implementation.

lib/segment/src/vector_storage/chunked_mmap_vectors.rs (1)

11-11: Import path update is correct.

The import of clear_disk_cache from memory::fadvise is accurate and aligns with the refactor. No further action needed.

lib/segment/src/index/field_index/numeric_index/mmap_numeric_index.rs (1)

11-11: Import path update is correct.

The import of clear_disk_cache from memory::fadvise is correct and matches the refactor. No further action needed.

lib/gridstore/src/bitmask/gaps.rs (1)

5-5: Import path update is correct.

The import of clear_disk_cache from memory::fadvise is correct and matches the refactor. No further action needed.

lib/segment/src/index/field_index/mmap_point_to_values.rs (1)

6-6: Import path update is correct.

The import of clear_disk_cache from memory::fadvise is correct and matches the refactor. No further action needed.

lib/segment/src/vector_storage/dense/dynamic_mmap_flags.rs (1)

11-11: Import path update is correct.

The import of clear_disk_cache from memory::fadvise is correct and matches the refactor. No further action needed.

lib/sparse/src/index/inverted_index/inverted_index_mmap.rs (1)

11-12: Import source correctly changed for clear_disk_cache

The import was appropriately moved from memory::madvise to memory::fadvise, which aligns with the PR objective of providing explicit OS file cache management using posix_fadvise.

lib/segment/src/index/field_index/full_text_index/mmap_inverted_index/mod.rs (1)

8-9: Import source correctly changed for clear_disk_cache

The import was appropriately moved from memory::madvise to memory::fadvise, which aligns with the PR objective of providing explicit OS file cache management using posix_fadvise.

lib/sparse/src/index/inverted_index/inverted_index_compressed_mmap.rs (1)

13-14: Import source correctly changed for clear_disk_cache

The import was appropriately moved from memory::madvise to memory::fadvise, which aligns with the PR objective of providing explicit OS file cache management using posix_fadvise.

lib/gridstore/src/bitmask/mod.rs (1)

9-10: Import source correctly changed for clear_disk_cache

The import was appropriately moved from memory::madvise to memory::fadvise, which aligns with the PR objective of providing explicit OS file cache management using posix_fadvise.

lib/segment/src/vector_storage/quantized/quantized_vectors.rs (1)

9-9: Import updated to use the new fadvise module.

The import of clear_disk_cache has been updated to use the new location from memory::fadvise instead of memory::madvise. This is part of the refactoring described in the PR objectives, where cache management functionality has been consolidated in the new fadvise module.

lib/segment/src/index/hnsw_index/hnsw.rs (1)

18-18: Import updated to use the new fadvise module.

The import of clear_disk_cache has been updated to use the new location from memory::fadvise instead of memory::madvise. This matches the refactoring described in the PR objectives, moving the cache management functionality to the more appropriate fadvise module.

lib/common/memory/src/lib.rs (1)

2-2: Export of new fadvise module.

Adding the public export of the new fadvise module makes its functionality available to the rest of the codebase. This module houses the implementation of the OneshotFile struct and the clear_disk_cache function that were previously in the madvise module, providing more precise OS cache management through the posix_fadvise system call.

lib/segment/src/vector_storage/chunked_vectors.rs (3)

8-8: Import OneshotFile from the new fadvise module.

Added import for the OneshotFile struct from the new fadvise module. This struct will be used to optimize file access patterns and explicitly manage OS cache.


193-193: Use OneshotFile instead of standard File for improved cache management.

Replaced standard File::open with OneshotFile::open, which optimizes file access by applying posix_fadvise hints (POSIX_FADV_SEQUENTIAL and POSIX_FADV_NOREUSE) for better sequential file reading performance.


204-204: Explicitly drop OS file cache after reading.

Added call to drop_cache() after reading the file to explicitly inform the OS that the cached pages for this file are no longer needed, which helps prevent unnecessary memory usage as described in the PR objectives.

lib/quantization/src/encoded_storage.rs (2)

5-5: LGTM: Good import for the new OneshotFile struct.

The import aligns with the PR's goal of optimizing OS file cache usage after reading files.


39-42: Excellent change to improve file cache handling.

Replacing File::open with OneshotFile::open and adding drop_cache() call addresses the issue described in the PR objectives. This change helps prevent the OS file cache from being polluted with quantized vectors that are unlikely to be read again soon.

lib/segment/src/id_tracker/mutable_id_tracker.rs (3)

11-11: LGTM: Good import for the new OneshotFile struct.

The import aligns with the PR's goal of optimizing OS file cache usage.


409-417: Clean implementation of OneshotFile usage.

Using OneshotFile instead of standard File provides file access pattern hints to the OS. The change from dropping the reader to getting the underlying file with into_inner() is a necessary adjustment to preserve the file handle for truncation and cache dropping.


431-431: Good addition of cache dropping after file operation.

Explicitly dropping the file cache after truncation and syncing aligns with the PR objective of reducing OS file cache usage.

lib/common/memory/build.rs (1)

1-15: Well-designed build script for conditional compilation.

The build script correctly detects OS and environment conditions to enable posix_fadvise functionality on supported platforms. The comment referencing the actual implementation in the nix crate provides good context for maintainers.

lib/common/memory/src/fadvise.rs (5)

6-14: Well-implemented conditional wrapper for posix_fadvise.

Good use of conditional compilation with #[cfg(posix_fadvise_supported)] and clean implementation of the wrapper function. The function appropriately uses the entire file (offset 0, length 0) for the advice.


15-26: Robust implementation of public clear_disk_cache function.

This function properly handles platforms where posix_fadvise is not supported by doing nothing silently. The documentation clearly states this behavior, which is important for cross-platform code.


28-59: Excellent design for the OneshotFile struct and its public API.

The OneshotFile struct is well-designed for one-time sequential reading with appropriate file access hints. The implementation of drop_cache with explicit error handling and the Option<File> design to prevent double drops is particularly good.


62-87: Good trait implementations for file operations.

The implementations for Deref, Read, and Seek are clean and effectively delegate to the inner file. The delegate! macro usage makes the code concise and maintainable.


89-97: Robust Drop implementation for automatic cache dropping.

The Drop implementation correctly handles the case where drop_cache() has already been called explicitly. It also ignores any errors that might occur during the advisory call, which is appropriate for destructors.

@xzfc xzfc force-pushed the fadvise-after-read branch from e5c5748 to 51e227b Compare April 16, 2025 17:58
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses the file cache pollution issue by replacing the previous disk cache clearing mechanism with a new fadvise‐based implementation using an OneshotFile wrapper. Key changes include:

  • Replacing all usages of memory::madvise::clear_disk_cache with memory::fadvise::clear_disk_cache.
  • Updating file read operations to use OneshotFile::open and invoking drop_cache() to clear the OS file cache after reading.
  • Adding a new fadvise module along with necessary build script and dependency adjustments.

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/segment/src/vector_storage/dense/memmap_dense_vector_storage.rs Updated clear_disk_cache import to use fadvise module.
lib/segment/src/vector_storage/dense/dynamic_mmap_flags.rs Updated ordering of import for clear_disk_cache to fadvise.
lib/segment/src/vector_storage/chunked_vectors.rs Replaced File::open with OneshotFile::open and added drop_cache call.
lib/segment/src/vector_storage/chunked_mmap_vectors.rs Updated clear_disk_cache import to use fadvise module.
lib/segment/src/index/hnsw_index/hnsw.rs Updated clear_disk_cache import to use fadvise module.
lib/segment/src/index/field_index/numeric_index/mmap_numeric_index.rs Updated clear_disk_cache import to use fadvise module.
lib/segment/src/index/field_index/mmap_point_to_values.rs Updated clear_disk_cache import to use fadvise module.
lib/segment/src/index/field_index/map_index/mmap_map_index.rs Updated clear_disk_cache import to use fadvise module.
lib/segment/src/index/field_index/geo_index/mmap_geo_index.rs Updated clear_disk_cache import to use fadvise module.
lib/segment/src/index/field_index/full_text_index/mmap_inverted_index/mod.rs Updated clear_disk_cache import to use fadvise module.
lib/segment/src/id_tracker/mutable_id_tracker.rs Replaced File::open with OneshotFile::open and added drop_cache call.
lib/quantization/src/encoded_storage.rs Replaced File::open with OneshotFile::open and added drop_cache call.
lib/gridstore/src/page.rs Updated clear_disk_cache import to use fadvise module.
lib/gridstore/src/bitmask/mod.rs Updated clear_disk_cache import to use fadvise module.
lib/gridstore/src/bitmask/gaps.rs Updated clear_disk_cache import to use fadvise module.
lib/common/memory/src/madvise.rs Removed clear_disk_cache implementation.
lib/common/memory/src/lib.rs Added export for new fadvise module.
lib/common/memory/src/fadvise.rs New module that implements clear_disk_cache and the OneshotFile wrapper.
lib/common/memory/build.rs New build script to enable posix_fadvise support conditionally.
lib/common/memory/Cargo.toml Added new dependency on delegate.

@generall generall merged commit 9fedc65 into dev Apr 17, 2025
17 checks passed
@generall generall deleted the fadvise-after-read branch April 17, 2025 08:57
pull bot pushed a commit to kp-forks/qdrant that referenced this pull request Apr 21, 2025
* Move clear_disk_cache to memory::fadvise

* Add memory::fadvise::OneshotFile

* Use OneshotFile
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.

2 participants