]> git.proxmox.com Git - ceph.git/blame - ceph/src/rgw/services/svc_sync_modules.cc
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rgw / services / svc_sync_modules.cc
CommitLineData
9f95a23c
TL
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab ft=cpp
3
11fdf7f2 4#include "svc_sync_modules.h"
9f95a23c 5#include "svc_zone.h"
11fdf7f2 6
1e59de90
TL
7#include "rgw_sync_module.h"
8#include "rgw_zone.h"
9f95a23c
TL
9
10#define dout_subsys ceph_subsys_rgw
11fdf7f2 11
9f95a23c 12void RGWSI_SyncModules::init(RGWSI_Zone *zone_svc)
11fdf7f2 13{
9f95a23c 14 svc.zone = zone_svc;
11fdf7f2
TL
15 sync_modules_manager = new RGWSyncModulesManager();
16 rgw_register_sync_modules(sync_modules_manager);
17}
18
b3b6e05e 19int RGWSI_SyncModules::do_start(optional_yield, const DoutPrefixProvider *dpp)
9f95a23c
TL
20{
21 auto& zone_public_config = svc.zone->get_zone();
22
20effc67 23 int ret = sync_modules_manager->create_instance(dpp, cct, zone_public_config.tier_type, svc.zone->get_zone_params().tier_config, &sync_module);
9f95a23c 24 if (ret < 0) {
20effc67 25 ldpp_dout(dpp, -1) << "ERROR: failed to start sync module instance, ret=" << ret << dendl;
9f95a23c 26 if (ret == -ENOENT) {
20effc67 27 ldpp_dout(dpp, -1) << "ERROR: " << zone_public_config.tier_type
9f95a23c
TL
28 << " sync module does not exist. valid sync modules: "
29 << sync_modules_manager->get_registered_module_names()
30 << dendl;
31 }
32 return ret;
33 }
34
b3b6e05e 35 ldpp_dout(dpp, 20) << "started sync module instance, tier type = " << zone_public_config.tier_type << dendl;
9f95a23c
TL
36
37 return 0;
38}
39
11fdf7f2
TL
40RGWSI_SyncModules::~RGWSI_SyncModules()
41{
42 delete sync_modules_manager;
43}
44