OSD,PG: pass through EC messages

Signed-off-by: Samuel Just <sam.just@inktank.com>
This commit is contained in:
Samuel Just 2014-01-31 20:06:58 -08:00
parent 6cd64a507d
commit 7772014a4a
2 changed files with 50 additions and 1 deletions

View File

@ -82,6 +82,10 @@
#include "messages/MOSDPGMissing.h"
#include "messages/MBackfillReserve.h"
#include "messages/MRecoveryReserve.h"
#include "messages/MOSDECSubOpWrite.h"
#include "messages/MOSDECSubOpWriteReply.h"
#include "messages/MOSDECSubOpRead.h"
#include "messages/MOSDECSubOpReadReply.h"
#include "messages/MOSDAlive.h"
@ -4767,6 +4771,18 @@ void OSD::dispatch_op(OpRequestRef op)
case MSG_OSD_PG_PUSH_REPLY:
handle_replica_op<MOSDPGPushReply, MSG_OSD_PG_PUSH_REPLY>(op);
break;
case MSG_OSD_EC_WRITE:
handle_replica_op<MOSDECSubOpWrite, MSG_OSD_EC_WRITE>(op);
break;
case MSG_OSD_EC_WRITE_REPLY:
handle_replica_op<MOSDECSubOpWriteReply, MSG_OSD_EC_WRITE_REPLY>(op);
break;
case MSG_OSD_EC_READ:
handle_replica_op<MOSDECSubOpRead, MSG_OSD_EC_READ>(op);
break;
case MSG_OSD_EC_READ_REPLY:
handle_replica_op<MOSDECSubOpReadReply, MSG_OSD_EC_READ_REPLY>(op);
break;
}
}

View File

@ -33,6 +33,10 @@
#include "messages/MOSDPGPush.h"
#include "messages/MOSDPGPushReply.h"
#include "messages/MOSDPGPull.h"
#include "messages/MOSDECSubOpWrite.h"
#include "messages/MOSDECSubOpWriteReply.h"
#include "messages/MOSDECSubOpRead.h"
#include "messages/MOSDECSubOpReadReply.h"
#include "messages/MOSDSubOp.h"
#include "messages/MOSDSubOpReply.h"
@ -4979,9 +4983,18 @@ bool PG::can_discard_request(OpRequestRef op)
return can_discard_replica_op<MOSDPGPushReply, MSG_OSD_PG_PUSH_REPLY>(op);
case MSG_OSD_SUBOPREPLY:
return false;
case MSG_OSD_EC_WRITE:
return can_discard_replica_op<MOSDECSubOpWrite, MSG_OSD_EC_WRITE>(op);
case MSG_OSD_EC_WRITE_REPLY:
return can_discard_replica_op<MOSDECSubOpWriteReply, MSG_OSD_EC_WRITE_REPLY>(op);
case MSG_OSD_EC_READ:
return can_discard_replica_op<MOSDECSubOpRead, MSG_OSD_EC_READ>(op);
case MSG_OSD_EC_READ_REPLY:
return can_discard_replica_op<MOSDECSubOpReadReply, MSG_OSD_EC_READ_REPLY>(op);
case MSG_OSD_PG_SCAN:
return can_discard_scan(op);
case MSG_OSD_PG_BACKFILL:
return can_discard_backfill(op);
}
@ -5040,6 +5053,26 @@ bool PG::op_must_wait_for_map(OSDMapRef curmap, OpRequestRef op)
return !have_same_or_newer_map(
curmap,
static_cast<MOSDPGPushReply*>(op->get_req())->map_epoch);
case MSG_OSD_EC_WRITE:
return !have_same_or_newer_map(
curmap,
static_cast<MOSDECSubOpWrite*>(op->get_req())->map_epoch);
case MSG_OSD_EC_WRITE_REPLY:
return !have_same_or_newer_map(
curmap,
static_cast<MOSDECSubOpWriteReply*>(op->get_req())->map_epoch);
case MSG_OSD_EC_READ:
return !have_same_or_newer_map(
curmap,
static_cast<MOSDECSubOpRead*>(op->get_req())->map_epoch);
case MSG_OSD_EC_READ_REPLY:
return !have_same_or_newer_map(
curmap,
static_cast<MOSDECSubOpReadReply*>(op->get_req())->map_epoch);
}
assert(0);
return false;