]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_admin: get master's period from store's current period info
authorAbhishek Lekshmanan <abhishek@suse.com>
Thu, 12 Jan 2017 21:09:01 +0000 (22:09 +0100)
committerNathan Cutler <ncutler@suse.com>
Sun, 29 Jan 2017 09:46:29 +0000 (10:46 +0100)
This ensures that we get the current period in contrast to the admin log
which gets the master's earliest period.

Fixes: http://tracker.ceph.com/issues/18064
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit 4ca18df7198a9f0ded8b0100a70b5db7187c3de4)

src/rgw/rgw_admin.cc

index ede5781dd9095ea50071678a1319c4ccb693cb09..7da25fed670e74f3b1ea47c4a15aadde66bbe8d2 100644 (file)
@@ -1793,19 +1793,21 @@ static void get_md_sync_status(list<string>& status)
     return;
   }
 
+
   map<int, RGWMetadataLogInfo> master_shards_info;
-  string master_period;
+  string master_start_period;
 
-  ret = sync.read_master_log_shards_info(&master_period, &master_shards_info);
+  ret = sync.read_master_log_shards_info(&master_start_period, &master_shards_info);
   if (ret < 0) {
     status.push_back(string("failed to fetch master sync status: ") + cpp_strerror(-ret));
     return;
   }
 
   map<int, string> shards_behind;
-
-  if (sync_status.sync_info.period != master_period) {
-    status.push_back(string("master is on a different period: master_period=" + master_period + " local_period=" + sync_status.sync_info.period));
+  if (store->get_current_period_id() !=  sync_status.sync_info.period) {
+    status.push_back(string("master is on a different period: master_period=" +
+                            store->get_current_period_id() + " local_period=" +
+                            sync_status.sync_info.period));
   } else {
     for (auto local_iter : sync_status.sync_markers) {
       int shard_id = local_iter.first;