]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: update data log even if canceling index operation
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 21 Mar 2016 23:49:20 +0000 (16:49 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 23 Mar 2016 17:35:28 +0000 (10:35 -0700)
Need to update the data log anyway, so that it reflects that there were
changes in the bucket index log.

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

index 7d9228dd619384534fdda39689ffde1395597dd2..dc9728e79c72bd9cf352f4480f7fdd3e229ab344 100644 (file)
@@ -8587,7 +8587,20 @@ int RGWRados::Bucket::UpdateIndex::cancel()
     ldout(store->ctx(), 5) << "failed to get BucketShard object: ret=" << ret << dendl;
     return ret;
   }
-  return store->cls_obj_complete_cancel(*bs, optag, obj, bilog_flags);
+
+  ret = store->cls_obj_complete_cancel(*bs, optag, obj, bilog_flags);
+
+  /*
+   * need to update data log anyhow, so that whoever follows needs to update its internal markers
+   * for following the specific bucket shard log. Otherwise they end up staying behind, and users
+   * have no way to tell that they're all caught up
+   */
+  int r = store->data_log->add_entry(bs->bucket, bs->shard_id);
+  if (r < 0) {
+    lderr(store->ctx()) << "ERROR: failed writing data log" << dendl;
+  }
+
+  return ret;
 }
 
 int RGWRados::Object::Read::read(int64_t ofs, int64_t end, bufferlist& bl)