Repository navigation
osd: Reduce reads when rebalancing healthy Erasure Coded PGs - #64502
Conversation
ead29fc to
efad06e
Compare
|
jenkins test make check |
|
jenkins test make check |
|
jenkins test make check arm64 |
|
jenkins test make check |
1 similar comment
|
jenkins test make check |
|
@aainscow -The validation of the PR has been successfully completed. The review is currently pending. Once the review is done,feel free to merge the PR. |
| int bits_set = std::popcount(words[i]); | ||
| if (bits_set > n) { | ||
| uint64_t tmp = words[i]; | ||
| // This could be optimised with BMI _pdep_u64 |
There was a problem hiding this comment.
ACK. Probably not worth the effort - at least for the current use case. The majority of the calls to this function will be with a bitset that has <=n set bits and will never enter this if statement. When there are >n bits set we are going to save one or more read I/Os, the cost of the for loop is insignificant vs this saving
There was a problem hiding this comment.
I don't think a more detailed comment is worth it, but I have added more detail to the commit message to cover this.
| // If we support partial reads, we are making the assumption that only | ||
| // K shards need to be read to recover data. We opt here for minimising | ||
| // the number of reads over minimising the amount of parity calculations | ||
| // that are needed. |
There was a problem hiding this comment.
- If performance is limited by the drives, then less read I/Os is a clear advantage.
- If performance is limited by the network then less remote read I/Os is a clear advantage.
- If performance is limited by the CPU then the CPU cost of M unnecessary remote read I/Os (messenger+bluestore) is almost certainly more than the cost of doing an extra encode operation to calculate the coding parities.
- If performance is limited by system memory bandwidth the encode+crc generation has less overhead than the read+bluestore crc check+messenger overheads.
Longer term this logic should probably be pushed into the plugins, in particular to give LRC the opportunity to optimize for locality of the shards. Reason for not doing this now is that it would be messy because the legacy EC code cannot support this optimization and LRC isn't yet optimizing for locality
There was a problem hiding this comment.
I don't think a more detailed comment is worth it, but I have added more detail to the commit message to cover this.
| const_iterator find_nth(unsigned int n) const { | ||
| for (size_t i = 0; i < word_count; ++i) { | ||
| int bits_set = std::popcount(words[i]); | ||
| if (bits_set > n) { |
There was a problem hiding this comment.
NIT: warning: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Wsign-compare]
There was a problem hiding this comment.
Will fix. I don't think this needs a new qa
|
@aainscow - If validation is required for this PR, please add the 'needs-qa' label. |
…upports it). Plugins which support partial reads, should never need more than k shards to read the data, even if some shards have failed. However, rebalancing commonly requests k + m shards, as very frequently all shards are moved. If this occurs and all k + m shards are online, the read will be achieved by reading ALL shards rather than just reading k shards. This commit fixes that issue. The problem is that we don't want to change the API to the old EC, so we cannot update the plugin behaviour here. Instead, the EC code itself will reduce the number of shards it tells minimum_to_decode about. In a comment we note that bitset_set performance could be improved using _pdep_u64. This would require fiddly platform-specific code and would likely not show any performance improvements for most applications. The majority of the calls to this function will be with a bitset that has <=n set bits and will never enter this if statement. When there are >n bits set we are going to save one or more read I/Os, the cost of the for loop is insignificant vs this saving. I have left the comment in as a hint to future users of this function. Further notes were made in a review comment that are worth recording: - If performance is limited by the drives, then less read I/Os is a clear advantage. - If performance is limited by the network then less remote read I/Os is a clear advantage. - If performance is limited by the CPU then the CPU cost of M unnecessary remote read I/Os (messenger+bluestore) is almost certainly more than the cost of doing an extra encode operation to calculate the coding parities. - If performance is limited by system memory bandwidth the encode+crc generation has less overhead than the read+bluestore crc check+messenger overheads. Longer term this logic should probably be pushed into the plugins, in particular to give LRC the opportunity to optimize for locality of the shards. Reason for not doing this now is that it would be messy because the legacy EC code cannot support this optimization and LRC isn't yet optimizing for locality Signed-off-by: Alex Ainscow <[email protected]>
efad06e to
52915db
Compare
|
jenkins test make check arm64 |
Jerasure and ISA-L plugins (and probably other) EC plugins have the following algorithm for selecting which shards they need to read:
This is fine for most good-path IO, since it always picks the minimal set of required shards. However, it is flawed when all shards need recovery at the same time. This is common during rebalancing, where due to CRUSH, the set of OSDs will frequently all change.
These plugins should never read more than K shards. The extra challenge here is that we don't want to change this API since we don't want to change the behaviour of old EC.
To fix this, therefore we make new EC only request K shards to be recovered in the first place if read optimisations are enabled for the plugin.
https://tracker.ceph.com/issues/72371
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 test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job Definition