Project

General

Profile

Actions

Bug #81340

open
SZ SZ

mgr: MgrOpRequest::mark_finish_mon_command passes flag_start_mon_command instead of flag_finish_mon_command (copy-paste bug)

Bug #81340: mgr: MgrOpRequest::mark_finish_mon_command passes flag_start_mon_command instead of flag_finish_mon_command (copy-paste bug)

Added by Steven Zuraski 2 months ago. Updated 2 months ago.

Status:
Fix Under Review
Priority:
Normal
Category:
ceph-mgr
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

MgrOpRequest::mark_finish_mon_command (src/mgr/MgrOpRequest.h:122) passes the wrong flag constant to the op-tracker infrastructure. Due to a copy-paste error, it passes flag_start_mon_command instead of flag_finish_mon_command:

void mark_finish_mon_command() {
  mark_flag_point(flag_start_mon_command);  // line 122 -- should be flag_finish_mon_command
}

Consequences: (1) the state display for a finishing mon command incorrectly shows "start" state; (2) the 0x10 finish bit is never set in the op-tracker flag word, so any code that checks flag_finish_mon_command to determine whether the command has completed will never see it set.

Failure scenario

Calling mark_finish_mon_command() advances the op-tracker through the start-of-command state a second time rather than the finish-of-command state. Operator tools (ceph mgr dump, slow-op reports) show misleading state for in-flight mon commands.

Suggested fix

void mark_finish_mon_command() {
  mark_flag_point(flag_finish_mon_command);
}

Unit test (illustrative)

TEST(MgrOpRequest, MarkFinishMonCommandSetsCorrectFlag) {
  MgrOpRequest op(...);
  op.mark_start_mon_command();
  op.mark_finish_mon_command();
  EXPECT_TRUE(op.state_flags() & MgrOpRequest::flag_finish_mon_command);
  EXPECT_FALSE(op.state_flags() & MgrOpRequest::flag_start_mon_command);  // should not be set twice
}

Related issues 2 (2 open — 0 closed)

Related to mgr - Bug #82136: mgr/DaemonServer: op-tracker marks mon command finished before the mon reply arrivesFix Under ReviewSteven Zuraski

Actions
Related to Ceph - Enhancement #83014: mgr: add sanity/smoke test scenarios covering MgrOpRequest flag-point ordering for mon commandsNew

Actions

SZ Updated by Steven Zuraski 2 months ago Actions #1

  • Status changed from New to Fix Under Review
  • Pull request ID set to 72357

SZ Updated by Steven Zuraski about 1 month ago Actions #2

  • Related to Bug #82136: mgr/DaemonServer: op-tracker marks mon command finished before the mon reply arrives added

SZ Updated by Steven Zuraski 23 days ago Actions #3

  • Related to Enhancement #83014: mgr: add sanity/smoke test scenarios covering MgrOpRequest flag-point ordering for mon commands added
Actions

Also available in: PDF Atom