]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: try to use current period id in a few more cases 8588/head
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 13 Apr 2016 23:05:09 +0000 (16:05 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 13 Apr 2016 23:05:09 +0000 (16:05 -0700)
If missing period id, try to use the current period id. This is needed
for sync agent compatibility.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rest_log.cc

index 854da2e0d6b3321b88ce0081321d2698f31e0f79..6f8bc644418d121ceadbdf2ff9186f783e5160c6 100644 (file)
@@ -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};