Introduce native fs connector#2779
Conversation
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances LMCache's storage capabilities by introducing a high-performance native C++ filesystem connector. This new connector allows for efficient direct file system access, supporting features like O_DIRECT and read-ahead for optimized I/O. It also improves the robustness of batch operations by enabling per-key error handling for data retrieval and standardizing the way results are reported for both existence checks and data loads. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a native C++ filesystem connector, which is a significant and well-implemented feature. The C++ implementation is robust, using modern features like std::filesystem and employing best practices such as atomic writes via temporary files and rename. The error handling, especially the per-key error tolerance for batch get operations, is a great addition. The Python bindings and integration into the L2 adapter framework are also clean and follow existing patterns. I have one minor suggestion to remove some unused code. Overall, this is an excellent contribution.
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
| // Per-key error tolerance: record failure | ||
| // but continue processing remaining keys | ||
| req.batch->per_key_results[req.start_idx + i] = 0; | ||
| fprintf(stderr, "[LMCache FS GET] key %s failed: %s\n", |
There was a problem hiding this comment.
there should not be FS specific stuff in teh connector base
There was a problem hiding this comment.
Do you mean to remove the FS here?
I have removed it maobaolong@95e1ce4
| try { | ||
| do_single_get(conn, req.keys[i], req.buf_ptrs[i], | ||
| req.buf_lens[i], req.batch_chunk_num_bytes); | ||
| req.batch->per_key_results[req.start_idx + i] = 1; |
There was a problem hiding this comment.
1 is false or true, leave comment here?
Signed-off-by: baoloongmao <baoloongmao@tencent.com>
There was a problem hiding this comment.
LGTM! @maobaolong Please address the comment in teh connector base
* Add native FS L2 connector for MP mode * Introduce native fs connector Signed-off-by: baoloongmao <baoloongmao@tencent.com> * Remove the unused path_buf Signed-off-by: baoloongmao <baoloongmao@tencent.com> * Add comment and fix output Signed-off-by: baoloongmao <baoloongmao@tencent.com> --------- Signed-off-by: baoloongmao <baoloongmao@tencent.com> Co-authored-by: Samuel Shen <slshen@tensormesh.ai>
* Add native FS L2 connector for MP mode * Introduce native fs connector Signed-off-by: baoloongmao <baoloongmao@tencent.com> * Remove the unused path_buf Signed-off-by: baoloongmao <baoloongmao@tencent.com> * Add comment and fix output Signed-off-by: baoloongmao <baoloongmao@tencent.com> --------- Signed-off-by: baoloongmao <baoloongmao@tencent.com> Co-authored-by: Samuel Shen <slshen@tensormesh.ai>
* Add native FS L2 connector for MP mode * Introduce native fs connector Signed-off-by: baoloongmao <baoloongmao@tencent.com> * Remove the unused path_buf Signed-off-by: baoloongmao <baoloongmao@tencent.com> * Add comment and fix output Signed-off-by: baoloongmao <baoloongmao@tencent.com> --------- Signed-off-by: baoloongmao <baoloongmao@tencent.com> Co-authored-by: Samuel Shen <slshen@tensormesh.ai>
* Add native FS L2 connector for MP mode * Introduce native fs connector Signed-off-by: baoloongmao <baoloongmao@tencent.com> * Remove the unused path_buf Signed-off-by: baoloongmao <baoloongmao@tencent.com> * Add comment and fix output Signed-off-by: baoloongmao <baoloongmao@tencent.com> --------- Signed-off-by: baoloongmao <baoloongmao@tencent.com> Co-authored-by: Samuel Shen <slshen@tensormesh.ai>
* Add native FS L2 connector for MP mode * Introduce native fs connector Signed-off-by: baoloongmao <baoloongmao@tencent.com> * Remove the unused path_buf Signed-off-by: baoloongmao <baoloongmao@tencent.com> * Add comment and fix output Signed-off-by: baoloongmao <baoloongmao@tencent.com> --------- Signed-off-by: baoloongmao <baoloongmao@tencent.com> Co-authored-by: Samuel Shen <slshen@tensormesh.ai>
What this PR does / why we need it:
This PR is c++ implementation for
FS connector.Special notes for your reviewers:
If applicable: