mirror of
https://github.com/ceph/ceph
synced 2025-02-23 19:17:37 +00:00
osd/PrimarLogPG: remove jewel compat for error code logging
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
3ccc436f9f
commit
fef5fe8ba0
@ -10054,67 +10054,40 @@ void PrimaryLogPG::submit_log_entries(
|
||||
peer.osd, m, get_osdmap()->get_epoch());
|
||||
}
|
||||
}
|
||||
if (get_osdmap()->require_osd_release >= CEPH_RELEASE_JEWEL) {
|
||||
ceph_tid_t rep_tid = repop->rep_tid;
|
||||
waiting_on.insert(pg_whoami);
|
||||
log_entry_update_waiting_on.insert(
|
||||
make_pair(
|
||||
rep_tid,
|
||||
LogUpdateCtx{std::move(repop), std::move(waiting_on)}
|
||||
));
|
||||
struct OnComplete : public Context {
|
||||
PrimaryLogPGRef pg;
|
||||
ceph_tid_t rep_tid;
|
||||
epoch_t epoch;
|
||||
OnComplete(
|
||||
PrimaryLogPGRef pg,
|
||||
ceph_tid_t rep_tid,
|
||||
epoch_t epoch)
|
||||
: pg(pg), rep_tid(rep_tid), epoch(epoch) {}
|
||||
void finish(int) override {
|
||||
pg->lock();
|
||||
if (!pg->pg_has_reset_since(epoch)) {
|
||||
auto it = pg->log_entry_update_waiting_on.find(rep_tid);
|
||||
assert(it != pg->log_entry_update_waiting_on.end());
|
||||
auto it2 = it->second.waiting_on.find(pg->pg_whoami);
|
||||
assert(it2 != it->second.waiting_on.end());
|
||||
it->second.waiting_on.erase(it2);
|
||||
if (it->second.waiting_on.empty()) {
|
||||
pg->repop_all_committed(it->second.repop.get());
|
||||
pg->log_entry_update_waiting_on.erase(it);
|
||||
}
|
||||
ceph_tid_t rep_tid = repop->rep_tid;
|
||||
waiting_on.insert(pg_whoami);
|
||||
log_entry_update_waiting_on.insert(
|
||||
make_pair(
|
||||
rep_tid,
|
||||
LogUpdateCtx{std::move(repop), std::move(waiting_on)}
|
||||
));
|
||||
struct OnComplete : public Context {
|
||||
PrimaryLogPGRef pg;
|
||||
ceph_tid_t rep_tid;
|
||||
epoch_t epoch;
|
||||
OnComplete(
|
||||
PrimaryLogPGRef pg,
|
||||
ceph_tid_t rep_tid,
|
||||
epoch_t epoch)
|
||||
: pg(pg), rep_tid(rep_tid), epoch(epoch) {}
|
||||
void finish(int) override {
|
||||
pg->lock();
|
||||
if (!pg->pg_has_reset_since(epoch)) {
|
||||
auto it = pg->log_entry_update_waiting_on.find(rep_tid);
|
||||
assert(it != pg->log_entry_update_waiting_on.end());
|
||||
auto it2 = it->second.waiting_on.find(pg->pg_whoami);
|
||||
assert(it2 != it->second.waiting_on.end());
|
||||
it->second.waiting_on.erase(it2);
|
||||
if (it->second.waiting_on.empty()) {
|
||||
pg->repop_all_committed(it->second.repop.get());
|
||||
pg->log_entry_update_waiting_on.erase(it);
|
||||
}
|
||||
pg->unlock();
|
||||
}
|
||||
};
|
||||
t.register_on_commit(
|
||||
new OnComplete{this, rep_tid, get_osdmap()->get_epoch()});
|
||||
} else {
|
||||
if (on_complete) {
|
||||
struct OnComplete : public Context {
|
||||
PrimaryLogPGRef pg;
|
||||
std::function<void(void)> on_complete;
|
||||
epoch_t epoch;
|
||||
OnComplete(
|
||||
PrimaryLogPGRef pg,
|
||||
const std::function<void(void)> &on_complete,
|
||||
epoch_t epoch)
|
||||
: pg(pg),
|
||||
on_complete(std::move(on_complete)),
|
||||
epoch(epoch) {}
|
||||
void finish(int) override {
|
||||
pg->lock();
|
||||
if (!pg->pg_has_reset_since(epoch))
|
||||
on_complete();
|
||||
pg->unlock();
|
||||
}
|
||||
};
|
||||
t.register_on_complete(
|
||||
new OnComplete{
|
||||
this, *on_complete, get_osdmap()->get_epoch()
|
||||
});
|
||||
pg->unlock();
|
||||
}
|
||||
}
|
||||
};
|
||||
t.register_on_commit(
|
||||
new OnComplete{this, rep_tid, get_osdmap()->get_epoch()});
|
||||
t.register_on_applied(
|
||||
new C_OSD_OnApplied{this, get_osdmap()->get_epoch(), info.last_update});
|
||||
int r = osd->store->queue_transaction(osr.get(), std::move(t), NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user