Support ExternalTable PinnableSlice Get#14497
Conversation
846f83a to
eacee14
Compare
|
@joshkang97 has imported this pull request. If you are a Meta employee, you can view this in D97782011. |
✅ clang-tidy: No findings on changed linesCompleted in 348.4s. |
f4c0c3f to
ea03f0b
Compare
|
@joshkang97 has imported this pull request. If you are a Meta employee, you can view this in D97782011. |
ea03f0b to
16eb74b
Compare
|
@joshkang97 has imported this pull request. If you are a Meta employee, you can view this in D97782011. |
✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit 51d4067 Now I have all the information needed. Here's the review: SummaryThis PR changes Issues Found🔴 Critical1.
Perspective 1 (Call-Chain Analysis): Specifically, the code does: PinnableSlice value;
s = reader_->Get(read_options, parsed_key.user_key, prefix_extractor, &value);
// ...
get_context->SaveValue(found_key, value, &matched, &s,
value.IsPinned() ? &value : nullptr);When the external reader pins data (e.g., from mmap or cache), Wait — on closer re-examination: The Actually this is correct. I'll remove this as a critical issue. 🟡 Suggestion1. Missing
Perspective 3 (Cross-Component): The default Suggested fix: Consider adding a 2.
Perspective 2 (Correctness): This counter is incremented in 3.
Perspective 5 (Testing): The 4.
Perspective 1 (Call-Chain): Wait — the However, the diff changes 🟢 Nitpick1. The
The assertion 2. The
This is a dangling pointer risk if the reader is destroyed before the factory. In the current test it's safe because the DB holds the reader alive, but the pattern is fragile. 3. Consider adding a forward declaration or While Cross-Component Analysis
Positive Observations
ℹ️ About this responseGenerated by Claude Code. Limitations:
Commands:
|
|
@joshkang97 has imported this pull request. If you are a Meta employee, you can view this in D97782011. |
|
@joshkang97 merged this pull request in 304ae71. |
Summary: The ExternalTableReader `Get` API has been modified to use PinnableSlice instead of std::string, this will allow implementations to utilize zero-copy Gets (e.g. reading from mmap or a cache). This is not a compatible change, but the API is marked as experimental, so should be allowed. Pull Request resolved: facebook#14497 Test Plan: - New unit tests Reviewed By: xingbowang Differential Revision: D97782011 Pulled By: joshkang97 fbshipit-source-id: 8a9e8c5bc5ff5e8dee6c0f2ee745521f09042cef
Summary: The ExternalTableReader `Get` API has been modified to use PinnableSlice instead of std::string, this will allow implementations to utilize zero-copy Gets (e.g. reading from mmap or a cache). This is not a compatible change, but the API is marked as experimental, so should be allowed. Pull Request resolved: #14497 Test Plan: - New unit tests Reviewed By: xingbowang Differential Revision: D97782011 Pulled By: joshkang97 fbshipit-source-id: 8a9e8c5bc5ff5e8dee6c0f2ee745521f09042cef
Summary
The ExternalTableReader
GetAPI has been modified to use PinnableSlice instead of std::string, this will allow implementations to utilize zero-copy Gets (e.g. reading from mmap or a cache). This is not a compatible change, but the API is marked as experimental, so should be allowed.Test Plan