@@ -483,7 +483,7 @@ class RGWSyncProcessorThread : public RGWRadosThread {
483483class RGWMetaSyncProcessorThread : public RGWSyncProcessorThread
484484{
485485 RGWMetaSyncStatusManager sync;
486- rgw::sal::ConfigStore* cfgstore;
486+ rgw::sal::ConfigStore * cfgstore{ nullptr } ;
487487
488488 uint64_t interval_msec () override {
489489 return 0 ; /* no interval associated, it'll run once until stopped */
@@ -492,8 +492,9 @@ class RGWMetaSyncProcessorThread : public RGWSyncProcessorThread
492492 sync.stop ();
493493 }
494494public:
495- RGWMetaSyncProcessorThread (rgw::sal::RadosStore* _driver, RGWAsyncRadosProcessor *async_rados)
496- : RGWSyncProcessorThread(_driver->getRados (), "meta-sync"), sync(_driver, async_rados) {}
495+ RGWMetaSyncProcessorThread (rgw::sal::RadosStore* _driver, RGWAsyncRadosProcessor *async_rados,
496+ rgw::sal::ConfigStore *_cfgstore)
497+ : RGWSyncProcessorThread(_driver->getRados (), "meta-sync"), sync(_driver, async_rados), cfgstore(_cfgstore) {}
497498
498499 void wakeup_sync_shards (set<int >& shard_ids) {
499500 for (set<int >::iterator iter = shard_ids.begin (); iter != shard_ids.end (); ++iter) {
@@ -537,11 +538,11 @@ class RGWDataSyncProcessorThread : public RGWSyncProcessorThread
537538 }
538539public:
539540 RGWDataSyncProcessorThread (rgw::sal::RadosStore* _driver, RGWAsyncRadosProcessor *async_rados,
540- const RGWZone* source_zone)
541+ const RGWZone* source_zone, rgw::sal::ConfigStore *_cfgstore )
541542 : RGWSyncProcessorThread(_driver->getRados (), "data-sync"),
542543 counters(sync_counters::build(store->ctx (), std::string(" data-sync-from-" ) + source_zone->name)),
543544 sync(_driver, async_rados, source_zone->id, counters.get()),
544- initialized(false ) {}
545+ initialized(false ), cfgstore(_cfgstore) {}
545546
546547 void wakeup_sync_shards (bc::flat_map<int , bc::flat_set<rgw_data_notify_entry> >& entries) {
547548 for (bc::flat_map<int , bc::flat_set<rgw_data_notify_entry> >::iterator iter = entries.begin (); iter != entries.end (); ++iter) {
@@ -1222,7 +1223,7 @@ int RGWRados::update_service_map(const DoutPrefixProvider *dpp, std::map<std::st
12221223 * Initialize the RADOS instance and prepare to do other ops
12231224 * Returns 0 on success, -ERR# on failure.
12241225 */
1225- int RGWRados::init_complete (const DoutPrefixProvider *dpp, optional_yield y)
1226+ int RGWRados::init_complete (const DoutPrefixProvider *dpp, optional_yield y, rgw::sal::ConfigStore* cfgstore )
12261227{
12271228 int ret;
12281229
@@ -1306,7 +1307,7 @@ int RGWRados::init_complete(const DoutPrefixProvider *dpp, optional_yield y)
13061307 }
13071308 auto async_processor = svc.async_processor ;
13081309 std::lock_guard l{meta_sync_thread_lock};
1309- meta_sync_processor_thread = new RGWMetaSyncProcessorThread (this ->driver , async_processor);
1310+ meta_sync_processor_thread = new RGWMetaSyncProcessorThread (this ->driver , async_processor, cfgstore );
13101311 ret = meta_sync_processor_thread->init (dpp);
13111312 if (ret < 0 ) {
13121313 ldpp_dout (dpp, 0 ) << " ERROR: failed to initialize meta sync thread" << dendl;
@@ -1329,7 +1330,7 @@ int RGWRados::init_complete(const DoutPrefixProvider *dpp, optional_yield y)
13291330 std::lock_guard dl{data_sync_thread_lock};
13301331 for (auto source_zone : svc.zone ->get_data_sync_source_zones ()) {
13311332 ldpp_dout (dpp, 5 ) << " starting data sync thread for zone " << source_zone->name << dendl;
1332- auto *thread = new RGWDataSyncProcessorThread (this ->driver , svc.async_processor , source_zone);
1333+ auto *thread = new RGWDataSyncProcessorThread (this ->driver , svc.async_processor , source_zone, cfgstore );
13331334 ret = thread->init (dpp);
13341335 if (ret < 0 ) {
13351336 ldpp_dout (dpp, 0 ) << " ERROR: failed to initialize data sync thread" << dendl;
0 commit comments