Conversation
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #86 +/- ##
===========================================
+ Coverage 61.68% 80.11% +18.43%
===========================================
Files 15 17 +2
Lines 462 835 +373
Branches 35 80 +45
===========================================
+ Hits 285 669 +384
+ Misses 158 125 -33
- Partials 19 41 +22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| magic_num = HOMEBLKS_MSGHEADER_MAGIC; | ||
| protocol_version = HOMEBLKS_MSGHEADER_PROTOCOL_VERSION_V1; | ||
| } | ||
| HomeBlksMsgType msg_type; |
There was a problem hiding this comment.
I fail to follow the need of the MessageHeader here.
It seems from the code walk through, the only field we need is the msg_type, I am also not quite sure we even need this, as READ seems doesn't require on_commit in its path, right? It returns a future and future thenValue can get the data when it is done, right? Do we need to do anything for read in on_commit path as well?
For unmap, it is async op, to free the blocks, caller doesn't need to wait for free blks to actually freed, it can be similar as read, that after index removed the lbas, unmap's future's thenValue can return the call, right?
There was a problem hiding this comment.
Yeah for read we dont need on_commit, but unmap needs it because if we crash, we will have leaks. Unmap will write the blkid's to free and call on_commit where it do async_free_blks. But if it crashe, recovery will find unmap type and call async_free_blks again. Right MessageHeader we can avoid since we already have CRC for write payload, its only help to find any corruption in journal entries.
There was a problem hiding this comment.
For unmap, we should call index->unmap directly and index will call free_blks (same as destory index). It shouldn't need to call on_commit. Unmap can write journal entry for crash recovery, on journal reply it should just call index->unmap.
There was a problem hiding this comment.
As discussed, unmap will do range remove of keys from index, gets the existing blkid's with filter cb, and write to journal. In on_commit we can async free the blks.
65c7989 to
e244d81
Compare
raakella1
left a comment
There was a problem hiding this comment.
The changes look good to me.
65cdec3 to
d29b845
Compare
Write flow writes data to disk, add key value to index and flush journal entry to journal. Add test case to test the normal io flow.
Write flow writes data to disk, add key value to index and flush journal entry to journal. Add test case to test the normal io flow.