Repository navigation
crimson/os/seastore: support extent checksum verification - #55449
Conversation
337808b to
05fc0c2
Compare
cyx1231st
left a comment
There was a problem hiding this comment.
Initial comments.
Other questions:
- Does this PR completely supports extent read integrity? If not, where might be missing?
- I suppose performance will be impacted, so it might be better to have rough/simple performance comparison with/without this PR.
There was a problem hiding this comment.
I suppose traversing the lba-tree (again) is expensive. Is it possible to instead leverage the lba parent-child-pointer to update the mapping of the logical extent?
There was a problem hiding this comment.
I suppose traversing the lba-tree (again) is expensive. Is it possible to instead leverage the lba parent-child-pointer to update the mapping of the logical extent?
This may be non-trivial, because the lba tree structure may be changed after the retrieval of an lba mapping, so we might not be able to update the mapping directly through the LBAMapping structure. To archieve this, we may have to expose the lba tree iterator somehow?
On the other hand, we already are updating the lba mappings for the written ool extents here. The major difference is that we update the checksum field of lba_map_val_t in addition to the paddr field, so I think there may not be so much increased costs, am I right?
There was a problem hiding this comment.
This may be non-trivial, because the lba tree structure may be changed after the retrieval of an lba mapping, so we might not be able to update the mapping directly through the LBAMapping structure. To archieve this, we may have to expose the lba tree iterator somehow?
Maybe I'm missing something. Quoted:
3. if nodes are initial_pending
a. parent points at its pending parent on this transaction (must exist)
b. prior_instance is empty or, if it's the result of rewrite, points to
its stable predecessor
...
d. copy_sources contains the set of stable nodes at the same tree-level(only
its "prior_instance" if the node is the result of a rewrite), with which
the lba range of this node overlaps.
Seems to me this design is already sufficient to find the parent node, which is always kept updated with tree split/merge, right?
Or, does the relationship between LBA leaf node and the child LogicalExtent follow the above property?
On the other hand, we already are updating the lba mappings for the written ool extents here. The major difference is that we update the checksum field of lba_map_val_t in addition to the paddr field, so I think there may not be so much increased costs, am I right?
If the above method makes sense, it should apply to the update_mapping path generally, including updating the paddr field.
There was a problem hiding this comment.
This may be non-trivial, because the lba tree structure may be changed after the retrieval of an lba mapping, so we might not be able to update the mapping directly through the LBAMapping structure. To archieve this, we may have to expose the lba tree iterator somehow?
Maybe I'm missing something. Quoted:
3. if nodes are initial_pending a. parent points at its pending parent on this transaction (must exist) b. prior_instance is empty or, if it's the result of rewrite, points to its stable predecessor ... d. copy_sources contains the set of stable nodes at the same tree-level(only its "prior_instance" if the node is the result of a rewrite), with which the lba range of this node overlaps.Seems to me this design is already sufficient to find the parent node, which is always kept updated with tree split/merge, right?
So you're suggesting that update_mapping go backward to the parent when the current leaf node doesn't contain a specific key? If so, I think it's feasible.
Or, does the relationship between LBA leaf node and the child LogicalExtent follow the above property?
It follows the property.
On the other hand, we already are updating the lba mappings for the written ool extents here. The major difference is that we update the checksum field of lba_map_val_t in addition to the paddr field, so I think there may not be so much increased costs, am I right?
If the above method makes sense, it should apply to the update_mapping path generally, including updating the paddr field.
Yeah, I think we can implement this in a dedicated lba mapping update perf optimization PR.
There was a problem hiding this comment.
Per discussion, the optimization relies on the ability for a child (LogicalCachedExtent) to identify its direct parent (LBALeafNode) within the transaction.
The missing piece is that if the parent is initial-pending and the child is stable or mutation-pending, the child cannot identify the parent because the pointers from an initial-pending extent to its stable version is currently only one-directional though its copy_sources.
Also see #55831 (comment)
The checksum of remapped extents are the missing part which I planned on implementing in follow-up PRs.
Yeah, will do. |
05fc0c2 to
cd65bc7
Compare
I think it is not trivial because under the current design, the extent buffer doesn't need to be loaded from disk under remapping @aisakaki. If the read integrity must be enforced, I can't think of a good way to make it compatible with the above feature. Another question is that if we need to check read integrity, should physical extents be considerred as well? @athanatos |
Yeah, I was think adding a configuration item for users to choose between full read integrity check and non-fully-loaded extents remapping. IIUC, the point of having data integrity check in the io path is to discover data corruption at the time of user reads, so that the upper level in OSDs can recover the data from other replicas and prevent users from getting the corrupted data, which I think is one of the major causes for having replicas. Meanwhile, there are cases in which performance is the higher priority in which data reliability may not be so important, for example, the HPC scenarios. So having a configuration to choose between the two options should be a good solution. BTW, although we are asserting the checksum verification for now, we'll change it to return |
I think it does, we can add a checksum field in lba/backref nodes' meta, and check it on successful lba/backref extents load. Will add it. |
|
It seems that the inplace rewrite function also fails the checksum verification, because we can't recalculate the checksum of the extent when doing patrial inplace rewrite on it. To fully support data integrity check, I think we might need to have a maximum data integrity check size for seastore. Specifically, say we have an extent of size 64KB, and we set BTW, this comes at the price of a larger lba tree. |
Do you mean delta-based overwrite (#50419) or inplace-rewrite (#54525)? They are different concepts. After a quick think, I suppose they are both compatible because for delta-based overwrite extent, it isn't special as a mutation-pending extent, and for inplace-rewrite, the latest content of the extent should be present in cache as a dirty extent. Also, perhaps @myoungwon wants to disable the checksum in case of RBM if the SSD has some special supports (https://github.com/ceph/ceph/blob/main/src/crimson/os/seastore/random_block_manager/nvme_block_device.h#L281-L288). |
I recall that @athanatos has mentioned about a configuration "max_allocation_size" (default to 64K), which seems to be the same concept, right? |
Oh, maybe I was wrong. Actually, I meant partial overwrite which I thought was a feature that overwrites a part of an extent without fully loading the extent. Sorry for this misunderstanding if I'm wrong. |
Not quite the same, but I think that configuration can serve both purposes. |
NP, just wanted to clarify. I'll try to point out the code where might need to be adjusted in this case. And I suppose inplace-rewrite UT should fail if the implementation isn't complete. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
I think I've found the code, |
4b0145e to
d4f373c
Compare
d4f373c to
82c4f10
Compare
Right, I suppose we just need to add it to the step of |
8d54f0b to
9383771
Compare
|
jenkins test make check |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
…list to CachedExtents Signed-off-by: Xuehan Xu <[email protected]>
Signed-off-by: Xuehan Xu <[email protected]>
logical extents Signed-off-by: Xuehan Xu <[email protected]>
Signed-off-by: Xuehan Xu <[email protected]>
…related interfaces Signed-off-by: Xuehan Xu <[email protected]>
This is necessary because continuous data may be splitted into multiple extents if the size of each data extent is constrained Signed-off-by: Xuehan Xu <[email protected]>
…size configuration Limit the max size of extents in seastore, which can avoid much read amplification in case of remapping extents when extents integrity check is mandatory Signed-off-by: Xuehan Xu <[email protected]>
…ze for remap related tests Signed-off-by: Xuehan Xu <[email protected]>
dcd314e to
e9b646f
Compare
for remap related cases Signed-off-by: Xuehan Xu <[email protected]>
remapping extents with full extent integrity check enabled Signed-off-by: Xuehan Xu <[email protected]>
8c97acf to
c4941e7
Compare
Signed-off-by: Xuehan Xu <[email protected]>
c4941e7 to
898efa7
Compare
the failure of |
|
jenkins retest this please |
|
jenkins test make check |
1 similar comment
|
jenkins test make check |
Signed-off-by: Xuehan Xu [email protected]
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e