Guest User

Untitled

a guest
Oct 20th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.18 KB | None | 0 0
  1. diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc
  2. index 050c762..01a5c50 100644
  3. --- a/src/osdc/Objecter.cc
  4. +++ b/src/osdc/Objecter.cc
  5. @@ -2317,6 +2317,10 @@ void Objecter::_op_submit(Op *op, shunique_lock& sul, ceph_tid_t *ptid)
  6. bool check_for_latest_map = _calc_target(&op->target, nullptr)
  7. == RECALC_OP_TARGET_POOL_DNE;
  8.  
  9. + op_target_t *t = &op->target;
  10. + ldout(cct, 20) << "test oid val:" << t->base_oid << dendl;
  11. + ldout(cct, 20) << "test oid val display:" << op->target.base_oid << dendl;
  12. +
  13. // Try to get a session, including a retry if we need to take write lock
  14. int r = _get_session(op->target.osd, &s, sul);
  15. if (r == -EAGAIN ||
  16. @@ -3115,6 +3119,29 @@ void Objecter::_send_op(Op *op, MOSDOp *m)
  17. // op->session->lock is locked
  18.  
  19. // backoff?
  20. +
  21. + ldout(cct, 20) << "in send_op: test" << dendl;
  22. + ldout(cct, 20) << op->ops << dendl;
  23. + for (vector<OSDOp>::iterator p = op->ops.begin(); p != op->ops.end(); ++p) {
  24. + ldout(cct, 20) << p->op.op << dendl;
  25. + if (p->op.op == CEPH_OSD_OP_SPARSE_READ) {
  26. + ldout(cct, 20) << "OP_SPARSE_READ" << dendl;
  27. + return handle_alt_osd_reply(op);
  28. + }
  29. + if (p->op.op == CEPH_OSD_OP_WRITE) {
  30. + ldout(cct, 20) << "OP_WRITE" << dendl;
  31. + ldout(cct, 20) << p->op.flags << dendl;
  32. + }
  33. + if (p->op.op == CEPH_OSD_OP_WRITEFULL) {
  34. + ldout(cct, 20) << "OP_WRITEFULL" << dendl;
  35. + ldout(cct, 20) << p->op.flags << dendl;
  36. + }
  37. + if (p->op.op == CEPH_OSD_OP_WRITESAME) {
  38. + ldout(cct, 20) << "OP_WRITESAME" << dendl;
  39. + ldout(cct, 20) << p->op.flags << dendl;
  40. + }
  41. + }
  42. + // ldout(cct, 20) << "found sparse read in op" << dendl;
  43. hobject_t hoid = op->target.get_hobj();
  44. auto p = op->session->backoffs.find(op->target.actual_pgid);
  45. if (p != op->session->backoffs.end()) {
  46. @@ -3238,6 +3265,33 @@ void Objecter::unregister_op(Op *op)
  47. inflight_ops.dec();
  48. }
  49.  
  50. +void Objecter::handle_alt_osd_reply(Op *op)
  51. +{
  52. + ldout(cct, 10) << "in handle_alt_reply" << dendl;
  53. +
  54. + /*unsigned len = 20;
  55. + std::string str(len, 'c');
  56. + (op->out_bl[0])->append(str.c_str(), 20);*/
  57. +
  58. + //Context* handler = op->out_handler[0];
  59. + //handler->complete(0);
  60. +
  61. + Context *onfinish = 0;
  62. +
  63. + if (op->onfinish) {
  64. + num_in_flight.dec();
  65. + onfinish = op->onfinish;
  66. + op->onfinish = NULL;
  67. + }
  68. +
  69. + _finish_op(op, 0);
  70. +
  71. + // do callbacks
  72. + if (onfinish) {
  73. + onfinish->complete(0);
  74. + }
  75. +}
  76. +
  77. /* This function DOES put the passed message before returning */
  78. void Objecter::handle_osd_op_reply(MOSDOpReply *m)
  79. {
  80. @@ -3285,6 +3339,7 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m)
  81. << " attempt " << m->get_retry_attempt()
  82. << dendl;
  83. Op *op = iter->second;
  84. + ldout(cct, 7) << "handle_osd: check what op is:" << iter->second << dendl;
  85.  
  86. if (retry_writes_after_first_reply && op->attempts == 1 &&
  87. (op->target.flags & CEPH_OSD_FLAG_WRITE)) {
  88. @@ -3366,6 +3421,7 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m)
  89. *op->data_offset = m->get_header().data_off;
  90.  
  91. // got data?
  92. + ldout(cct, 7) << "handle_osd: check outbl:" << op->outbl << dendl;
  93. if (op->outbl) {
  94. if (op->con)
  95. op->con->revoke_rx_buffer(op->tid);
  96. @@ -3383,6 +3439,8 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m)
  97. << " from " << m->get_source_inst() << dendl;
  98.  
  99. vector<bufferlist*>::iterator pb = op->out_bl.begin();
  100. + ldout(cct, 7) << "handle_osd: check op->out_bl:-" << pb[0] << dendl;
  101. +
  102. vector<int*>::iterator pr = op->out_rval.begin();
  103. vector<Context*>::iterator ph = op->out_handler.begin();
  104. assert(op->out_bl.size() == op->out_rval.size());
  105. @@ -3393,8 +3451,13 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m)
  106. ++i, ++p, ++pb, ++pr, ++ph) {
  107. ldout(cct, 10) << " op " << i << " rval " << p->rval
  108. << " len " << p->outdata.length() << dendl;
  109. + ldout(cct, 10) << "handle_osd: pb datatype:- " << *pb << dendl;
  110. if (*pb)
  111. **pb = p->outdata;
  112. + ldout(cct, 10) << "handle_osd: p datatype:- " << *p << dendl;
  113. + ldout(cct, 10) << "handle_osd: check pbdata:- " << (p->outdata).buffers().back().get_raw() << dendl;
  114. + //ldout(cct, 10) << "handle_osd: check pbdata:-" << **pb << dendl;
  115. +
  116. // set rval before running handlers so that handlers
  117. // can change it if e.g. decoding fails
  118. if (*pr)
Add Comment
Please, Sign In to add comment