]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
pybind/mgr/status: drop asserts that fight the defaultdict defaults 68743/head
authorKefu Chai <k.chai@proxmox.com>
Tue, 5 May 2026 01:36:01 +0000 (09:36 +0800)
committerKefu Chai <k.chai@proxmox.com>
Wed, 13 May 2026 07:55:43 +0000 (15:55 +0800)
commit1c5a7395776d77a5ea7677c31c7040dcd66ff5ed
tree3bf2aab6a56b7dafc1b0186fc78cfa9fda4716be
parent5722e489f8fbacb865eabca5f94221c36d7eea00
pybind/mgr/status: drop asserts that fight the defaultdict defaults

The 'assert metadata' checks in the status module were actually fighting
against our own defaults. Since an empty defaultdict is falsy, these
asserts would blow up the whole command if a single daemon was down
after a mgr restart.

This drops those four grumpy asserts. Now, instead of a traceback,
`ceph osd status` and `ceph fs status` will just show a blank hostname
 or "unknown" version as intended.

The trigger is common in practice: any mgr restart leaves daemons
that are currently down without metadata in daemon_state, since
they never reconnect via MMgrOpen to repopulate it. After such a
restart, `ceph osd status` and `ceph fs status` blow up:
```
  Error EINVAL: Traceback (most recent call last):
    ...
    File ".../status/module.py", line 340, in handle_osd_status
      assert metadata
  AssertionError
```

The bug was introduced in 5ac2901f54ff

Fixes: https://tracker.ceph.com/issues/76416
Reported-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/pybind/mgr/status/module.py