From e6918187568dbd01842d8d1d2c808ce16a894239 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 21 Apr 2024 13:54:28 +0200 Subject: Adding upstream version 18.2.2. Signed-off-by: Daniel Baumann --- src/mgr/MgrStandby.h | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 src/mgr/MgrStandby.h (limited to 'src/mgr/MgrStandby.h') diff --git a/src/mgr/MgrStandby.h b/src/mgr/MgrStandby.h new file mode 100644 index 000000000..0f06e3074 --- /dev/null +++ b/src/mgr/MgrStandby.h @@ -0,0 +1,89 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +/* + * Ceph - scalable distributed file system + * + * Copyright (C) 2016 John Spray + * + * This is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software + * Foundation. See file COPYING. + */ + + +#ifndef MGR_STANDBY_H_ +#define MGR_STANDBY_H_ + +#include "auth/Auth.h" +#include "common/async/context_pool.h" +#include "common/Finisher.h" +#include "common/Timer.h" +#include "common/LogClient.h" + +#include "client/Client.h" +#include "mon/MonClient.h" +#include "osdc/Objecter.h" +#include "PyModuleRegistry.h" +#include "MgrClient.h" + +class MMgrMap; +class Mgr; +class PyModuleConfig; + +class MgrStandby : public Dispatcher, + public md_config_obs_t { +public: + // config observer bits + const char** get_tracked_conf_keys() const override; + void handle_conf_change(const ConfigProxy& conf, + const std::set &changed) override; + +protected: + ceph::async::io_context_pool poolctx; + MonClient monc; + std::unique_ptr client_messenger; + Objecter objecter; + Client client; + + MgrClient mgrc; + + LogClient log_client; + LogChannelRef clog, audit_clog; + + ceph::mutex lock = ceph::make_mutex("MgrStandby::lock"); + Finisher finisher; + SafeTimer timer; + + PyModuleRegistry py_module_registry; + std::shared_ptr active_mgr; + + int orig_argc; + const char **orig_argv; + + std::string state_str(); + + void handle_mgr_map(ceph::ref_t m); + void _update_log_config(); + void send_beacon(); + + bool available_in_map; + +public: + MgrStandby(int argc, const char **argv); + ~MgrStandby() override; + + bool ms_dispatch2(const ceph::ref_t& m) override; + bool ms_handle_reset(Connection *con) override { return false; } + void ms_handle_remote_reset(Connection *con) override {} + bool ms_handle_refused(Connection *con) override; + + int init(); + void shutdown(); + void respawn(); + int main(std::vector args); + void tick(); +}; + +#endif + -- cgit v1.2.3