Repository navigation
osd: EC optimizations: changes to rollback to support partial writes - #62497
Conversation
There was a problem hiding this comment.
nit: Probably my code... but I think google coding style would have you do this style, rather than break on the bracket.
ReturnType ClassName::ReallyLongFunctionName(Type par_name1, Type par_name2,
Type par_name3) {
DoSomething();
...
}
There was a problem hiding this comment.
If this is from ec_optimisations_main, then I have accidentally introduced some formatting like the above by mistake.
There was a problem hiding this comment.
nit: For loops should always have a space after the ";"
There was a problem hiding this comment.
No - the function can modify length. The offset and length here are a range within the shard to rollback. The same range is applied to each shard, however for optimized EC pools if the object is not a multiple of stripe_width in size then some of the shards will be smaller than others (because we no longer add padding). In this case it may be necessary to reduce the length to avoid the rollback clone from exceeding the length of the shard.
There was a problem hiding this comment.
No. I guess this implementation of the Visitor could have const functions because it is just dumping fields to the Formatter, however this isn't performance critical code. The two other implementations of this Vistor (one used for rollback which is also not performance critical code, and one used for trim which is) both contain an ObjectStore::Transaction t in the Vistor class which is modified by rollback_extents (and other functions in the visitor) - these cannot be const
There was a problem hiding this comment.
Fixed multiple instances of this within ObjectModDesc as this style leads to bugs when code is edited. osd_types.h in general appears to be lacking braces on many of its if's - I won't fix the whole file, only the area of code this PR is changing.
There was a problem hiding this comment.
OK, most of the members are references, so I'm less worried about introducing new problems with life-time management.
There was a problem hiding this comment.
Written, non-primary. ACK.
There was a problem hiding this comment.
nit: spaces within the ternary operator help readability IMHO.
There was a problem hiding this comment.
nit: bracing. How about
| const std::vector<shard_id_set> &shards) { | |
| const std::vector<shard_id_set> &shards) | |
| { |
?
There was a problem hiding this comment.
Disagree - while I prefer your style the rest of src/osd/osd_types.h is written with the braces on the same line as the function. I think consistency of style in a file is more important, even if this file has a different style to most of the rest of Ceph!
There was a problem hiding this comment.
Ouch, sorry for missing that. I agree the spatial consistency is more important.
f79457b to
a14d798
Compare
|
New push with fixes for the nits |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
a14d798 to
a1a136c
Compare
|
Rebased - no other changes |
|
jenkins test make check arm64 |
|
jenkins test api |
|
jenkins test make check |
|
jenkins test api |
aainscow
left a comment
There was a problem hiding this comment.
Only nits and observations. I would not be upset if they were all ignored.
| f->dump_stream("log_tail") << log_tail; | ||
| f->dump_int("last_user_version", last_user_version); | ||
| f->dump_stream("last_backfill") << last_backfill; | ||
| f->open_array_section("partial_writes_last_complete"); |
There was a problem hiding this comment.
nit/comment: Recently added "with_array_section" in Formatter.h does this slightly more concisely:
f->with_obj_array_section(
"partial_writes_last_complete"sv, partial_writes_last_complete,
[](Formatter& f, const shard_id_t& shard, const version_range_type& v) {
auto & [from, to] = versionrange;
f->dump_int("id", int(shard));
f->dump_stream("from") << from;
f->dump_stream("to") << to;
});
Maybe not worth refactoring, but its nice to know about it.
|
|
||
| interval_set<snapid_t> purged_snaps; | ||
|
|
||
| std::map<shard_id_t,std::pair<eversion_t,eversion_t>> partial_writes_last_complete; ///< last_complete for shards not modified by a partial write |
| eversion_t last_update; | ||
| eversion_t last_complete; | ||
| version_t last_user_version; | ||
| std::map<shard_id_t,std::pair<eversion_t,eversion_t>> partial_writes_last_complete; |
There was a problem hiding this comment.
.. because mini_flat_map does not have encode/decode. Worth adding? We would not see the same encode/decode gains that we did in bitset_set.
| f->dump_stream("last_update") << last_update; | ||
| f->dump_stream("last_complete") << last_complete; | ||
| f->dump_stream("last_user_version") << last_user_version; | ||
| f->open_array_section("partial_writes_last_complete"); |
There was a problem hiding this comment.
See above comment about new Formatter
|
jenkins test make check |
|
jenkins test api |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
EC Pools create an ObjectModDesc entry in each log entry that describes how to undo the modifcation. During peering if it is determined that only some of the shards completed an update then these shards are instructed to rollback the change. This ensures that each update is either applied to all or none of the shards. For EC optimized pools rollback becomes a bit more complicated. Firstly because not all shards may have been updated the rollback needs to be more selective in what is undone. Secondly optimized pools do not pad objects to be a multiple of the stripe width which means shards can be different sizes. There is a single ObjectModDesc entry that contains a set of operations applied by every shard, individial operations need to include enough information to work out what has to be undone on each shard. Signed-off-by: Bill Scales <[email protected]>
a1a136c to
5ad1aaf
Compare
|
Rebased now that 62451 has merged, no other changes |
|
jenkins test make check |
|
Crimson approved by @athanatos. Failure, unrelated, tracked by: |
Changes to rollback to support optimized EC pools.
Optimized pools do not update all shards the same way, avoiding writing data that has not changed and only storing attribute updates on a subset of shards. Rollback uses a single ObjectModDesc entry in the PG log entry to work out how to undo the changes to a shard. This entry is extended to store extra details about the update so it can work out what
needs to be undo on each shard.
The changes are designed to be backwards compatible, the legacy EC code still updates all shards the same way and needs rollback to perform the same updates to all shards. When optimizations are enabled the PG log may consist of a mixture of log entries written by the legacy and new code.
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