Skip to contentSkip to conversation

call cls::journal tag_list and take osd loop infinite

DISCUSSION Jason Dillaman 1 participant 1 message Oct 12, 2017 7 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): CA+aFP1DmjH_gPJ37xWf7FmYvNffs8rNY6qRpVLbqR8jRda7kdg@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): CA+aFP1DMbJMJEwVzk=Y8jxBcgmhakRQ1Nu+qyX-KX1+F6_BjYQ@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): CA+aFP1B3BhteZvBMoDvUGSx_X_r1p8bi55SbZTWi_RBUr269CA@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

Thanks for the report! I've opened a PR [1] to fix the issue that was introduced when the "more" flag was added to "cls_cxx_map_get_vals" method.

[1] https://github.com/ceph/ceph/pull/18270

Quoted 47 lines · 文刘飞

Hi jason,
I test the rbd journal in our envirment, and find some osd marked down.
the log of osd which marked down is as following:

2017-10-12 18:45:35.842402 7fcc5b7ff700  1 heartbeat_map is_healthy
'OSD::osd_op_tp thread 0x7fcc383ff700' had timed out after 60
2017-10-12 18:45:35.842416 7fcc5b7ff700  1 heartbeat_map is_healthy

'OSD::osd_op_tp thread 0x7fcc407ff700' had timed out after 60

and the essential reason of osd_op_tp thread's timeout is the osd
trapped in journal_tag_list function.
the MAX_KEYS_READS is 64, If cls_cxx_map_get_vals get more than 64
values, then the more will be true,
and tag_pass cann't be changed, cls_cxx_map_get_vals will be called infinite!

int journal_tag_list(cls_method_context_t hctx, bufferlist *in,

                     bufferlist *out) {

.....

  std::string last_read = HEADER_KEY_TAG_PREFIX;
  do {
    std::map<std::string, bufferlist> vals;
    bool more;
    r = cls_cxx_map_get_vals(hctx, last_read, HEADER_KEY_TAG_PREFIX,
                             MAX_KEYS_READ, &vals, &more);
    if (r < 0 && r != -ENOENT) {
      CLS_ERR("failed to retrieve tags: %s", cpp_strerror(r).c_str());
      return r;
    }
  ....

  if (tag_pass != TAG_PASS_DONE && !more) {
      last_read = HEADER_KEY_TAG_PREFIX;
      ++tag_pass;
    } else if (!vals.empty()) {
      last_read = vals.rbegin()->first;
    }
   } while (tag_pass != TAG_PASS_DONE);

::encode(tags, *out);
return 0;
}

Signature · 1 line
Jason