From 0cc58de5c79fd65c490276449731400bf037abec Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Thu, 26 Nov 2020 11:03:00 +0100 Subject: [PATCH] mgr/cephadm: add docstring describing the HostCache Signed-off-by: Sebastian Wagner --- src/pybind/mgr/cephadm/inventory.py | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/pybind/mgr/cephadm/inventory.py b/src/pybind/mgr/cephadm/inventory.py index 9d8816aa60ff..eb0c42faf96e 100644 --- a/src/pybind/mgr/cephadm/inventory.py +++ b/src/pybind/mgr/cephadm/inventory.py @@ -21,6 +21,10 @@ SPEC_STORE_PREFIX = "spec." class Inventory: + """ + The inventory stores a HostSpec for all hosts persistently. + """ + def __init__(self, mgr: 'CephadmOrchestrator'): self.mgr = mgr # load inventory @@ -164,6 +168,36 @@ class SpecStore(): class HostCache(): + """ + HostCache stores different things: + + 1. `daemons`: Deployed daemons O(daemons) + + They're part of the configuration nowadays and need to be + persistent. The name "daemon cache" is unfortunately a bit misleading. + Like for example we really need to know where daemons are deployed on + hosts that are offline. + + 2. `devices`: ceph-volume inventory cache O(hosts) + + As soon as this is populated, it becomes more or less read-only. + + 3. `networks`: network interfaces for each host. O(hosts) + + This is needed in order to deploy MONs. As this is mostly read-only. + + 4. `last_etc_ceph_ceph_conf` O(hosts) + + Stores the last refresh time for the /etc/ceph/ceph.conf. Used + to avoid deploying new configs when failing over to a new mgr. + + 5. `scheduled_daemon_actions`: O(daemons) + + Used to run daemon actions after deploying a daemon. We need to + store it persistently, in order to stay consistent across + MGR failovers. + """ + def __init__(self, mgr): # type: (CephadmOrchestrator) -> None self.mgr: CephadmOrchestrator = mgr -- 2.47.3