Skip to content

Commit

Permalink
PG: call start_flush in Active() instead of using do_pending_flush()
Browse files Browse the repository at this point in the history
This way, we don't block an OpWQ thread while waiting on the filestore.

Signed-off-by: Samuel Just <[email protected]>
  • Loading branch information
Samuel Just committed Nov 19, 2013
1 parent e657369 commit 6c1aaa4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 20 deletions.
19 changes: 4 additions & 15 deletions src/osd/PG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ PG::PG(OSDService *o, OSDMapRef curmap,
state(0),
send_notify(false),
need_up_thru(false),
need_flush(false),
last_peering_reset(0),
heartbeat_peer_lock("PG::heartbeat_peer_lock"),
backfill_target(-1),
Expand Down Expand Up @@ -1307,9 +1306,6 @@ void PG::activate(ObjectStore::Transaction& t,
publish_stats_to_osd();
}

// we need to flush this all out before doing anything else..
need_flush = true;

// waiters
if (!is_replay()) {
requeue_ops(waiting_for_active);
Expand All @@ -1318,17 +1314,6 @@ void PG::activate(ObjectStore::Transaction& t,
on_activate();
}

void PG::do_pending_flush()
{
assert(is_locked());
if (need_flush) {
dout(10) << "do_pending_flush doing pending flush" << dendl;
osr->flush();
need_flush = false;
dout(10) << "do_pending_flush done" << dendl;
}
}

bool PG::op_has_sufficient_caps(OpRequestRef op)
{
// only check MOSDOp
Expand Down Expand Up @@ -5881,6 +5866,10 @@ PG::RecoveryState::Active::Active(my_context ctx)
*context< RecoveryMachine >().get_on_safe_context_list(),
*context< RecoveryMachine >().get_query_map(),
context< RecoveryMachine >().get_info_map());
pg->start_flush(
context< RecoveryMachine >().get_cur_transaction(),
context< RecoveryMachine >().get_on_applied_context_list(),
context< RecoveryMachine >().get_on_safe_context_list());
assert(pg->is_active());
dout(10) << "Activate Finished" << dendl;
}
Expand Down
2 changes: 0 additions & 2 deletions src/osd/PG.h
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,6 @@ class PG {
// primary-only, recovery-only state
set<int> might_have_unfound; // These osds might have objects on them
// which are unfound on the primary
bool need_flush; // need to flush before any new activity

epoch_t last_peering_reset;


Expand Down
3 changes: 0 additions & 3 deletions src/osd/ReplicatedPG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -825,9 +825,6 @@ void ReplicatedPG::do_request(
OpRequestRef op,
ThreadPool::TPHandle &handle)
{
// do any pending flush
do_pending_flush();

if (!op_has_sufficient_caps(op)) {
osd->reply_op_error(op, -EPERM);
return;
Expand Down

0 comments on commit 6c1aaa4

Please sign in to comment.