rgw: allow getting master log shards info on specified period

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>
This commit is contained in:
Abhishek Lekshmanan 2017-01-13 16:29:47 +01:00
parent 4ca18df719
commit 063c949d44
2 changed files with 4 additions and 6 deletions

View 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)

View 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) {