Skip to content

reef: pybind/mgr/mirroring: Fix KeyError: 'directory_count' in daemon status#57763

Merged
joscollin merged 1 commit intoceph:reeffrom
joscollin:wip-66271-reef
Jun 17, 2024
Merged

reef: pybind/mgr/mirroring: Fix KeyError: 'directory_count' in daemon status#57763
joscollin merged 1 commit intoceph:reeffrom
joscollin:wip-66271-reef

Conversation

@joscollin
Copy link
Member

@joscollin joscollin commented May 29, 2024

The directory_count key is missing in self.mgr.get_daemon_status() output json,
intermittently when there is a delay caused by m_listener.handle_mirroring_enabled() to update the
directory_count, which results in ServiceDaemon::update_status() creates a json with out 'directory_count' key/value.
But the mgr/mirroring -> daemon_status() always expects the 'directory_count' key to be present in the json returned by
self.mgr.get_daemon_status().

This issue occurs intermittently when we enable/disable mirroring and check the 'daemon status' in between.
This patch fixes this issue by setting a default value 0 for 'directory_count' in doemon_status().

Fixes: https://tracker.ceph.com/issues/66271
(cherry picked from commit b78baa2)

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

The directory_count key is missing in self.mgr.get_daemon_status() output json,
intermittently when there is a delay caused by m_listener.handle_mirroring_enabled() to update the
directory_count, which results in ServiceDaemon::update_status() creates a json with out 'directory_count' key/value.
But the mgr/mirroring -> daemon_status() always expects the 'directory_count' key to be present in the json returned by
self.mgr.get_daemon_status().

This issue occurs intermittently when we enable/disable mirroring and check the 'daemon status' in between.
This patch fixes this issue by setting a default value 0 for 'directory_count' in doemon_status().

Fixes: https://tracker.ceph.com/issues/65795
Signed-off-by: Jos Collin <jcollin@redhat.com>
(cherry picked from commit b78baa2)
@github-actions github-actions bot added this to the reef milestone May 29, 2024
@joscollin joscollin added the cephfs Ceph File System label May 30, 2024
@joscollin
Copy link
Member Author

Tested in https://tracker.ceph.com/issues/66468

@joscollin joscollin merged commit a623fb0 into ceph:reef Jun 17, 2024
@joscollin joscollin deleted the wip-66271-reef branch June 17, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cephfs Ceph File System pybind

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants