Enable RAID support for FDP IO path#319
Conversation
cachelib/navy/common/Device.cpp
Outdated
| // As of now, only one FDP enabled Device is supported | ||
| static constexpr uint16_t kDefaultFdpIdx = 0u; | ||
| // Map of file descriptors to FdpNvme device objects | ||
| const std::unordered_map<int, std::shared_ptr<FdpNvme>> fdpNvmeDevs_; |
There was a problem hiding this comment.
Should this be a reference?
I thought all the AsyncIoContext would share the same map (vector before this change)? Or we actually want to make a copy here?
There was a problem hiding this comment.
Should this be a reference? I thought all the AsyncIoContext would share the same map (vector before this change)? Or we actually want to make a copy here?
yes, you are right, we can use reference here.
cachelib/navy/common/Device.cpp
Outdated
| return fdpNvmeVec_[kDefaultFdpIdx]->allocateFdpHandle(); | ||
| if (fdpNvmeDevs_.size() > 0) { | ||
| auto fdpHandle = -1; | ||
| //Ensuring that same FDP placement handle is allocated for all FdpNvme |
There was a problem hiding this comment.
Asking to learn: I thought it would be fine if one RAID write gets written to different handles in different device. But because we don't want to keep track of a vector of different handles, we just make sure we have the same handle for all devices?
There was a problem hiding this comment.
Asking to learn: I thought it would be fine if one RAID write gets written to different handles in different device. But because we don't want to keep track of a vector of different handles, we just make sure we have the same handle for all devices?
Yes, we wanted to avoid the code complexity and use a simple scheme of same handle for all the devices for a given placement handle. Having ability to write to different handles for different RAID devices could be nice but need to design carefully, and can be added later.
Summary: This enables RAID0 in fdp io path by spliting io across all devices. Signed-off-by: Vikash Kumar <vikash.k5@samsung.com>
1a07b4e to
40f1b33
Compare
This PR enables RAID in the FDP io path. RAID support was disabled in the original FDP support PR, since it involved a few more changes in the IO Path code. It also involves handling a few scenarios like one of the devices in the RAID does not support FDP etc. This PR contain the code changes for the same.