From bf299dce471ec69b8ef0d2832cbdcf91092611a4 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Wed, 13 Apr 2016 16:05:09 -0700 Subject: [PATCH] rgw: try to use current period id in a few more cases If missing period id, try to use the current period id. This is needed for sync agent compatibility. Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_rest_log.cc | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/rgw/rgw_rest_log.cc b/src/rgw/rgw_rest_log.cc index 854da2e0d6b..6f8bc644418 100644 --- a/src/rgw/rgw_rest_log.cc +++ b/src/rgw/rgw_rest_log.cc @@ -163,9 +163,14 @@ void RGWOp_MDLog_ShardInfo::execute() { } if (period.empty()) { - ldout(s->cct, 5) << "Missing period id" << dendl; - http_ret = -EINVAL; - return; + ldout(s->cct, 5) << "Missing period id trying to use current" << dendl; + period = store->get_current_period_id(); + + if (period.empty()) { + ldout(s->cct, 5) << "Missing period id" << dendl; + http_ret = -EINVAL; + return; + } } RGWMetadataLog meta_log{s->cct, store, period}; @@ -217,9 +222,14 @@ void RGWOp_MDLog_Delete::execute() { } if (period.empty()) { - ldout(s->cct, 5) << "Missing period id" << dendl; - http_ret = -EINVAL; - return; + ldout(s->cct, 5) << "Missing period id trying to use current" << dendl; + period = store->get_current_period_id(); + + if (period.empty()) { + ldout(s->cct, 5) << "Missing period id" << dendl; + http_ret = -EINVAL; + return; + } } RGWMetadataLog meta_log{s->cct, store, period}; -- 2.47.3