~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/osdc/Objecter.cc

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
266
266
    }
267
267
 
268
268
    if (first_send) {
269
 
      op_submit(o, info->session);
 
269
      op_submit(o);
270
270
    } else {
271
 
      _op_submit(o, info->session);
 
271
      _op_submit(o);
272
272
    }
273
273
 
274
274
    OSDSession *s = o->session;
798
798
       p++) {
799
799
    LingerOp *op = p->second;
800
800
    if (op->session) {
801
 
      ldout(cct, 0) << " pinging osd that serves lingering tid " << p->first << " (osd." << op->session->osd << ")" << dendl;
 
801
      ldout(cct, 10) << " pinging osd that serves lingering tid " << p->first << " (osd." << op->session->osd << ")" << dendl;
802
802
      toping.insert(op->session);
803
803
    } else {
804
 
      ldout(cct, 0) << " lingering tid " << p->first << " does not have session" << dendl;
 
804
      ldout(cct, 10) << " lingering tid " << p->first << " does not have session" << dendl;
805
805
    }
806
806
  }
807
807
  logger->set(l_osdc_op_laggy, laggy_ops);
856
856
 
857
857
// read | write ---------------------------
858
858
 
859
 
tid_t Objecter::op_submit(Op *op, OSDSession *s)
 
859
tid_t Objecter::op_submit(Op *op)
860
860
{
861
861
  assert(client_lock.is_locked());
862
862
  assert(initialized);
869
869
  // take_op_budget() may drop our lock while it blocks.
870
870
  take_op_budget(op);
871
871
 
872
 
  return _op_submit(op, s);
 
872
  return _op_submit(op);
873
873
}
874
874
 
875
 
tid_t Objecter::_op_submit(Op *op, OSDSession *s)
 
875
tid_t Objecter::_op_submit(Op *op)
876
876
{
877
877
  // pick tid
878
878
  tid_t mytid = ++last_tid;
881
881
 
882
882
  // pick target
883
883
  bool check_for_latest_map = false;
884
 
  if (s) {
885
 
    op->session = s;
886
 
    s->ops.push_back(&op->session_item);
887
 
  } else {
888
 
    int r = recalc_op_target(op);
889
 
    check_for_latest_map = (r == RECALC_OP_TARGET_POOL_DNE);
890
 
    num_homeless_ops++;  // initially!
891
 
  }
 
884
  num_homeless_ops++;  // initially; recalc_op_target() will decrement if it finds a target
 
885
  int r = recalc_op_target(op);
 
886
  check_for_latest_map = (r == RECALC_OP_TARGET_POOL_DNE);
892
887
 
893
888
  // add to gather set(s)
894
889
  if (op->onack) {
1385
1380
  op_submit(o);
1386
1381
}
1387
1382
 
1388
 
void Objecter::_list_reply(ListContext *list_context, bufferlist *bl, Context *final_finish, epoch_t reply_epoch)
 
1383
void Objecter::_list_reply(ListContext *list_context, int r, bufferlist *bl,
 
1384
                           Context *final_finish, epoch_t reply_epoch)
1389
1385
{
1390
1386
  ldout(cct, 10) << "_list_reply" << dendl;
1391
1387
 
1410
1406
  if (response_size) {
1411
1407
    ldout(cct, 20) << "got a response with objects, proceeding" << dendl;
1412
1408
    list_context->list.merge(response.entries);
1413
 
    list_context->max_entries -= response_size;
1414
 
    ldout(cct, 20) << "cleaning up and exiting" << dendl;
1415
 
    if (!list_context->max_entries) {
 
1409
    if (response_size >= list_context->max_entries) {
1416
1410
      final_finish->finish(0);
1417
1411
      delete bl;
1418
1412
      delete final_finish;
1419
1413
      return;
1420
1414
    }
 
1415
 
 
1416
    // ask for fewer objects next time around
 
1417
    list_context->max_entries -= response_size;
 
1418
 
 
1419
    // if the osd returns 1 (newer code), or no entries, it means we
 
1420
    // hit the end of the pg.
 
1421
    if (r == 0 && response_size > 0) {
 
1422
      // not yet done with this pg
 
1423
      delete bl;
 
1424
      list_objects(list_context, final_finish);
 
1425
      return;
 
1426
    }
1421
1427
  }
1422
1428
 
1423
1429
  // if we make this this far, there are no objects left in the current pg, but we want more!
2047
2053
{
2048
2054
}
2049
2055
 
2050
 
bool Objecter::RequestStateHook::call(std::string command, bufferlist& out)
 
2056
bool Objecter::RequestStateHook::call(std::string command, std::string args, bufferlist& out)
2051
2057
{
2052
2058
  stringstream ss;
2053
2059
  JSONFormatter formatter(true);