]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: allow getting master log shards info on specified period
authorAbhishek Lekshmanan <abhishek@suse.com>
Fri, 13 Jan 2017 15:29:47 +0000 (16:29 +0100)
committerNathan Cutler <ncutler@suse.com>
Sun, 29 Jan 2017 09:46:29 +0000 (10:46 +0100)
This is needed for rgw admin's sync status or else we end up always
publishing that we're behind since we are always checking against
master's first period to sync from

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit 063c949d4409a18a22b64791d497e20f7473bc01)

src/rgw/rgw_sync.cc
src/rgw/rgw_sync.h

index c47dd4b7997199217d266495026d8a1308a39259..d7d83eb659a7d101df67b362fa7adc4fccc0115b 100644 (file)
@@ -244,7 +244,7 @@ int RGWRemoteMetaLog::read_log_info(rgw_mdlog_info *log_info)
   return 0;
 }
 
-int RGWRemoteMetaLog::read_master_log_shards_info(string *master_period, map<int, RGWMetadataLogInfo> *shards_info)
+int RGWRemoteMetaLog::read_master_log_shards_info(const string &master_period, map<int, RGWMetadataLogInfo> *shards_info)
 {
   if (store->is_meta_master()) {
     return 0;
@@ -256,9 +256,7 @@ int RGWRemoteMetaLog::read_master_log_shards_info(string *master_period, map<int
     return ret;
   }
 
-  *master_period = log_info.period;
-
-  return run(new RGWReadRemoteMDLogInfoCR(&sync_env, log_info.period, log_info.num_shards, shards_info));
+  return run(new RGWReadRemoteMDLogInfoCR(&sync_env, master_period, log_info.num_shards, shards_info));
 }
 
 int RGWRemoteMetaLog::read_master_log_shards_next(const string& period, map<int, string> shard_markers, map<int, rgw_mdlog_shard_data> *result)
index 298cd4ed4b55fe394eb3a5bacc7a5745ea2573d9..5ae136f85ca0806cb37054ceed91072dbd09ce04 100644 (file)
@@ -212,7 +212,7 @@ public:
   void finish();
 
   int read_log_info(rgw_mdlog_info *log_info);
-  int read_master_log_shards_info(string *master_period, map<int, RGWMetadataLogInfo> *shards_info);
+  int read_master_log_shards_info(const string& master_period, map<int, RGWMetadataLogInfo> *shards_info);
   int read_master_log_shards_next(const string& period, map<int, string> shard_markers, map<int, rgw_mdlog_shard_data> *result);
   int read_sync_status();
   int init_sync_status();
@@ -268,7 +268,7 @@ public:
   int read_log_info(rgw_mdlog_info *log_info) {
     return master_log.read_log_info(log_info);
   }
-  int read_master_log_shards_info(string *master_period, map<int, RGWMetadataLogInfo> *shards_info) {
+  int read_master_log_shards_info(const string& master_period, map<int, RGWMetadataLogInfo> *shards_info) {
     return master_log.read_master_log_shards_info(master_period, shards_info);
   }
   int read_master_log_shards_next(const string& period, map<int, string> shard_markers, map<int, rgw_mdlog_shard_data> *result) {