-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
osd: dissect and abstract RMWPipeline from ECBackend for sharing it with crimson #52211
osd: dissect and abstract RMWPipeline from ECBackend for sharing it with crimson #52211
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable, let's use a Op::Ref or Ref rather than explicitly using std::unique_ptr each time, though.
src/osd/ECBackend.cc
Outdated
#define dout_prefix _prefix(_dout, this) | ||
//#define DOUT_PREFIX_ARGS this | ||
//#undef dout_prefix | ||
//#define dout_prefix _prefix(_dout, this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just remove these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the overload:
static ostream& _prefix(std::ostream *_dout, ECBackend::RMWPipeline *rmw_pipeline) {
src/osd/ECBackend.cc
Outdated
&committed_to=this->committed_to, | ||
&tid_to_op_map=this->tid_to_op_map, | ||
cct=(CephContext*)nullptr | ||
] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just squash this into the prior commit? It's not particularly useful for review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will squash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Squashed.
src/osd/ECBackend.cc
Outdated
@@ -1161,30 +1161,30 @@ void ECBackend::handle_sub_write_reply( | |||
const ECSubWriteReply &op, | |||
const ZTracer::Trace &trace) | |||
{ | |||
map<ceph_tid_t, Op>::iterator i = rmw_pipeline.tid_to_op_map.find(op.tid); | |||
map<ceph_tid_t, std::unique_ptr<Op>>::iterator i = rmw_pipeline.tid_to_op_map.find(op.tid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Op::ref or Ref?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to OpRef
.
src/osd/ECBackend.cc
Outdated
@@ -1557,7 +1593,10 @@ void ECBackend::submit_transaction( | |||
) | |||
{ | |||
ceph_assert(!rmw_pipeline.tid_to_op_map.count(tid)); | |||
Op *op = &(rmw_pipeline.tid_to_op_map[tid]); | |||
auto concete_op = std::make_unique<ECClassicalOp>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
concrete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
src/osd/ECBackend.cc
Outdated
std::set<hobject_t> *temp_added, | ||
std::set<hobject_t> *temp_removed, | ||
DoutPrefixProvider *dpp, | ||
const ceph_release_t require_osd_release) override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
DoutPrefixProvider *dpp, | ||
const ceph_release_t require_osd_release) override | ||
{ | ||
if (t) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can t actually be null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, it's already dereferencec without extra checks.
src/osd/ECBackend.cc
Outdated
@@ -1572,8 +1611,23 @@ void ECBackend::submit_transaction( | |||
if (client_op) { | |||
op->trace = client_op->pg_trace; | |||
} | |||
op->plan = ECTransaction::get_write_plan( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For symmetry, seems like get_write_plan should also be a an ECBackend::Op method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a static
wrapper.
return plan; | ||
} | ||
|
||
void generate_transactions( | ||
PGTransaction* _t, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We assert non-null, probably better to pass as a reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a new commit for that.
src/osd/ECBackend.cc
Outdated
get_osdmap()->require_osd_release); | ||
} | ||
op->generate_transactions( | ||
op->plan, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can probably remove the members from the param list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
a14ca6a
to
c5fbf12
Compare
@athanatos: would you mind taking another look? |
src/osd/ECBackend.cc
Outdated
return ECTransaction::get_write_plan( | ||
sinfo, | ||
t, | ||
std::move(get_hinfo), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::forward
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
c5fbf12
to
7f44047
Compare
src/osd/ECBackend.cc
Outdated
@@ -1556,22 +1556,21 @@ struct ECClassicalOp : ECBackend::RMWPipeline::Op { | |||
DoutPrefixProvider *dpp, | |||
const ceph_release_t require_osd_release) final | |||
{ | |||
if (t) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I think I discovered where the t-empty ops are born:
bool ECBackend::RMWPipeline::try_finish_rmw()
{
// ...
if (get_osdmap()->require_osd_release >= ceph_release_t::kraken) {
if (op->version > get_parent()->get_log().get_can_rollback_to() &&
waiting_reads.empty() &&
waiting_commit.empty()) {
// submit a dummy transaction to kick the rollforward
auto tid = get_parent()->get_tid();
Op *nop = &(tid_to_op_map[tid]);
nop->hoid = op->hoid;
nop->trim_to = op->trim_to;
nop->roll_forward_to = op->version;
nop->tid = tid;
nop->reqid = op->reqid;
waiting_reads.push_back(*nop);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. Ok, add a comment to that effect so that future readers won't be confused.
1. `WritePlan` doesn't hold `PGTransactionUPtr` anymore. 2. `Op` (soon `RMWPipeline::Op`) gets dynamically polymorphic `generate_transaction()`. The classical OSD implements this interface with `ECClassicalOp` which hosts `PGTransaction`. Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
The intention behind this refactor is to emphasize that: 1. callers of `start_rmw()` are supposed to create any concrete type of `RMWPipeline::Op`. 2. `RMWPipeline` operates solely on the abstract `Op` and control its life-time. Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
7f44047
to
49db2d9
Compare
jenkins test api |
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. "pacific"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test classic perf
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test dashboard cephadm
jenkins test api
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox
jenkins test windows