mirror of
https://github.com/ceph/ceph
synced 2025-01-19 01:21:49 +00:00
Merge remote-tracking branch 'gh/bugfix-2022'
Reviewed-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
commit
e429da34c9
@ -4984,26 +4984,18 @@ void OSDService::handle_misdirected_op(PG *pg, OpRequestRef op)
|
||||
{
|
||||
MOSDOp *m = (MOSDOp*)op->request;
|
||||
assert(m->get_header().type == CEPH_MSG_OSD_OP);
|
||||
if (pg) {
|
||||
if (m->get_map_epoch() < pg->info.history.same_primary_since) {
|
||||
dout(7) << *pg << " changed after " << m->get_map_epoch() << ", dropping" << dendl;
|
||||
return;
|
||||
} else {
|
||||
dout(7) << *pg << " misdirected op in " << m->get_map_epoch() << dendl;
|
||||
clog.warn() << m->get_source_inst() << " misdirected "
|
||||
<< m->get_reqid() << " " << pg->info.pgid << " to osd." << whoami
|
||||
<< " not " << pg->acting
|
||||
<< " in e" << m->get_map_epoch() << "/" << osdmap->get_epoch()
|
||||
<< "\n";
|
||||
}
|
||||
} else {
|
||||
dout(7) << "got misdirected op from " << m->get_source_inst()
|
||||
<< " for pgid " << m->get_pg() << dendl;
|
||||
clog.warn() << m->get_source_inst() << " misdirected "
|
||||
<< m->get_reqid() << " pg " << m->get_pg()
|
||||
<< " to osd." << whoami
|
||||
<< " in e" << m->get_map_epoch() << "\n";
|
||||
|
||||
if (m->get_map_epoch() < pg->info.history.same_primary_since) {
|
||||
dout(7) << *pg << " changed after " << m->get_map_epoch() << ", dropping" << dendl;
|
||||
return;
|
||||
}
|
||||
|
||||
dout(7) << *pg << " misdirected op in " << m->get_map_epoch() << dendl;
|
||||
clog.warn() << m->get_source_inst() << " misdirected " << m->get_reqid()
|
||||
<< " pg " << m->get_pg()
|
||||
<< " to osd." << whoami
|
||||
<< " not " << pg->acting
|
||||
<< " in e" << m->get_map_epoch() << "/" << osdmap->get_epoch() << "\n";
|
||||
reply_op_error(op, -ENXIO);
|
||||
}
|
||||
|
||||
@ -5082,7 +5074,7 @@ void OSD::handle_op(OpRequestRef op)
|
||||
if (!pg) {
|
||||
dout(7) << "hit non-existent pg " << pgid << dendl;
|
||||
|
||||
if (osdmap->get_pg_role(pgid, whoami) >= 0) {
|
||||
if (osdmap->get_pg_acting_role(pgid, whoami) >= 0) {
|
||||
dout(7) << "we are valid target for op, waiting" << dendl;
|
||||
waiting_for_pg[pgid].push_back(op);
|
||||
op->mark_delayed();
|
||||
@ -5102,11 +5094,19 @@ void OSD::handle_op(OpRequestRef op)
|
||||
send_map->have_pg_pool(pgid.pool()))
|
||||
pgid = send_map->raw_pg_to_pg(pgid);
|
||||
|
||||
if (send_map->get_pg_role(m->get_pg(), whoami) >= 0) {
|
||||
if (send_map->get_pg_acting_role(m->get_pg(), whoami) >= 0) {
|
||||
dout(7) << "dropping request; client will resend when they get new map" << dendl;
|
||||
} else {
|
||||
dout(7) << "we are invalid target" << dendl;
|
||||
service.handle_misdirected_op(NULL, op);
|
||||
clog.warn() << m->get_source_inst() << " misdirected " << m->get_reqid()
|
||||
<< " pg " << m->get_pg()
|
||||
<< " to osd." << whoami
|
||||
<< " in e" << osdmap->get_epoch()
|
||||
<< ", client e" << m->get_map_epoch()
|
||||
<< " pg " << pgid
|
||||
<< " features " << m->get_connection()->get_features()
|
||||
<< "\n";
|
||||
service.reply_op_error(op, -ENXIO);
|
||||
}
|
||||
return;
|
||||
} else if (!op_has_sufficient_caps(pg, m)) {
|
||||
|
@ -493,12 +493,6 @@ public:
|
||||
static int calc_pg_rank(int osd, vector<int>& acting, int nrep=0);
|
||||
static int calc_pg_role(int osd, vector<int>& acting, int nrep=0);
|
||||
|
||||
int get_pg_role(pg_t pg, int osd) const {
|
||||
vector<int> group;
|
||||
int nrep = pg_to_osds(pg, group);
|
||||
return calc_pg_role(osd, group, nrep);
|
||||
}
|
||||
|
||||
/* rank is -1 (stray), 0 (primary), 1,2,3,... (replica) */
|
||||
int get_pg_acting_rank(pg_t pg, int osd) const {
|
||||
vector<int> group;
|
||||
|
Loading…
Reference in New Issue
Block a user