Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crimson/osd/osd_operation: fix dump_historic_slow_ops command works #56994

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

guojidan
Copy link
Contributor

@guojidan guojidan commented Apr 19, 2024

Fixes: https://tracker.ceph.com/issues/65531

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@guojidan guojidan requested a review from a team as a code owner April 19, 2024 02:58
@guojidan
Copy link
Contributor Author

jenkins test make check

@guojidan
Copy link
Contributor Author

jenkins test windows

@guojidan
Copy link
Contributor Author

jenkins test make check arm64

@athanatos
Copy link
Contributor

The commit message "crimson/osd/osd_operation.cc: optimize the calculation and output of slow_ops" suggests that this is a performance optimization. In fact, from the linked bug, this actually fixes a few bugs in how the command works. Please update the commit message to explain what this commit changes and how it fixes the bugs.

@athanatos
Copy link
Contributor

As a guideline, "optimize ..." is basically never an acceptable commit message as it really doesn't tell a future reader what the commit is changing.

* The first 'local_conf()->osd_op_history_slow_op_size' elements
  in the history_cliend_registry list store the slow ops log,
  while the last 'local_conf()->osd_op_history_size' elements
  store the normal history ops log
* dump_historic_slow_ops command will output real slow ops log
  and slow ops numbers

Fixes: https://tracker.ceph.com/issues/65531
Signed-off-by: junxiang Mu <1948535941@qq.com>
@guojidan guojidan changed the title crimson/osd/osd_operation.cc: optimize the calculation and output of slow_ops crimson/osd/osd_operation: fix dump_historic_slow_ops command works May 21, 2024
@@ -63,7 +63,7 @@ void OSDOperationRegistry::put_historic(const ClientRequest& op)
static_cast<size_t>(OperationTypeCode::historic_client_request);
auto& client_registry = get_registry<client_reg_index>();
auto& historic_registry = get_registry<historic_reg_index>();
historic_registry.splice(std::end(historic_registry),
historic_registry.splice(last_of_recents,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we always want to insert at the end of historic_registry?

++num_slow_ops;
} else {
++num_recent_ops;
--last_of_recents;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused as to what last_of_recents is supposed to indicate. Is it the case that for all ops in the interval [last_of_recents, std::end(historic_registry)), get_duration(op) <= local_conf()->osd_op_complaint_time? If so, I'm not sure this patch actually maintains that invariant.

@@ -100,6 +100,10 @@ void OSDOperationRegistry::put_historic(const ClientRequest& op)
ClientRequest::ICRef(&fastest_historic_op, /* add_ref= */false);
--num_slow_ops;
}
if (num_recent_ops > local_conf()->osd_op_history_size) {
historic_registry.pop_back();
--num_recent_ops;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last op may not be recent.

@athanatos athanatos self-requested a review May 21, 2024 16:49
Copy link
Contributor

@athanatos athanatos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my other comments -- I might just be misunderstanding the patch, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants