]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge remote-tracking branch 'origin/next'
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 2 Feb 2015 17:33:03 +0000 (09:33 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 2 Feb 2015 17:33:03 +0000 (09:33 -0800)
Conflicts:
src/rgw/rgw_op.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

1  2 
src/rgw/rgw_main.cc
src/rgw/rgw_op.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h
src/rgw/rgw_rest.cc
src/rgw/rgw_rest_s3.cc

Simple merge
index e5589303b3546833231f802055ff5ad41b7d7e22,ce6a4c47d1d905d2128af56fe51e80ba76bf69fe..bd3e07bb66abbd4f1536b20add3fd31701092baf
@@@ -3099,8 -2878,11 +3099,15 @@@ void RGWAbortMultipart::execute(
    int marker = 0;
    int max_parts = 1000;
  
++
 +  RGWObjectCtx *obj_ctx = (RGWObjectCtx *)s->obj_ctx;
 +
+   meta_obj.init_ns(s->bucket, meta_oid, mp_ns);
+   meta_obj.set_in_extra_data(true);
++  meta_obj.index_hash_source = s->object.name;
+   cls_rgw_obj_chain chain;
    do {
      ret = list_multipart_parts(store, s, upload_id, meta_oid, max_parts, marker, obj_parts, &marker, &truncated);
      if (ret < 0)
      }
    } while (truncated);
  
+   /* use upload id as tag */
+   ret = store->send_chain_to_gc(chain, upload_id , false);  // do it async
+   if (ret < 0) {
+     ldout(store->ctx(), 5) << "gc->send_chain() returned " << ret << dendl;
+     return;
+   }
    // and also remove the metadata obj
-   meta_obj.init_ns(s->bucket, meta_oid, mp_ns);
-   meta_obj.set_in_extra_data(true);
-   meta_obj.index_hash_source = s->object.name;
 -  ret = store->delete_obj(s->obj_ctx, owner, meta_obj);
 +  ret = store->delete_obj(*obj_ctx, s->bucket_info, meta_obj, 0);
    if (ret == -ENOENT) {
      ret = -ERR_NO_SUCH_BUCKET;
    }
index eef205a252aae7d0cbe2d787b70d4a4611c4f1de,169b58d9d1fa2919539bfa6a18b41257cd0d6ac7..90ea927fe5d0dfb49b6c2e2d227c1c451721c885
@@@ -3905,52 -3722,41 +3905,62 @@@ int RGWRados::bucket_suspended(rgw_buck
    return 0;
  }
  
 +int RGWRados::Object::complete_atomic_modification()
 +{
 +  if (!state->has_manifest || state->keep_tail)
 +    return 0;
 +
 +  cls_rgw_obj_chain chain;
++  store->update_gc_chain(obj, state->manifest, &chain);
++
++  string tag = (state->obj_tag.c_str() ? state->obj_tag.c_str() : "");
++  int ret = store->gc->send_chain(chain, tag, false);  // do it async
++
++  return ret;
++}
++
+ void RGWRados::update_gc_chain(rgw_obj& head_obj, RGWObjManifest& manifest, cls_rgw_obj_chain *chain)
+ {
    RGWObjManifest::obj_iterator iter;
-   for (iter = state->manifest.obj_begin(); iter != state->manifest.obj_end(); ++iter) {
+   for (iter = manifest.obj_begin(); iter != manifest.obj_end(); ++iter) {
      const rgw_obj& mobj = iter.get_location();
-     if (mobj == obj)
+     if (mobj == head_obj)
        continue;
 -    string oid, key;
 +    string oid, loc;
      rgw_bucket bucket;
 -    get_obj_bucket_and_oid_key(mobj, bucket, oid, key);
 -    chain->push_obj(bucket.data_pool, oid, key);
 +    get_obj_bucket_and_oid_loc(mobj, bucket, oid, loc);
-     cls_rgw_obj_key key(obj.get_index_key_name(), obj.get_instance());
-     chain.push_obj(bucket.data_pool, key, loc);
++    cls_rgw_obj_key key(head_obj.get_index_key_name(), head_obj.get_instance());
++    chain->push_obj(bucket.data_pool, key, loc);
    }
+ }
  
-   string tag = (state->obj_tag.c_str() ? state->obj_tag.c_str() : "");
-   int ret = store->gc->send_chain(chain, tag, false);  // do it async
-   return ret;
+ int RGWRados::send_chain_to_gc(cls_rgw_obj_chain& chain, const string& tag, bool sync)
+ {
+   return gc->send_chain(chain, tag, sync);
  }
  
 -int RGWRados::complete_atomic_overwrite(RGWRadosCtx *rctx, RGWObjState *state, rgw_obj& obj)
 +int RGWRados::open_bucket_index(rgw_bucket& bucket, librados::IoCtx& index_ctx, string& bucket_oid)
  {
 -  if (!state || !state->has_manifest || state->keep_tail)
 -    return 0;
 +  if (bucket_is_system(bucket))
 +    return -EINVAL;
  
 -  cls_rgw_obj_chain chain;
 -  update_gc_chain(obj, state->manifest, &chain);
 +  int r = open_bucket_index_ctx(bucket, index_ctx);
 +  if (r < 0)
 +    return r;
  
 -  string tag = state->obj_tag.c_str();
 -  int ret = gc->send_chain(chain, tag, false);  // do it async
 +  if (bucket.marker.empty()) {
 +    ldout(cct, 0) << "ERROR: empty marker for bucket operation" << dendl;
 +    return -EIO;
 +  }
  
 -  return ret;
 +  bucket_oid = dir_oid_prefix;
 +  bucket_oid.append(bucket.marker);
 +
 +  return 0;
  }
  
 -int RGWRados::open_bucket_index(rgw_bucket& bucket, librados::IoCtx& index_ctx, string& bucket_oid)
 -{
 +int RGWRados::open_bucket_index_base(rgw_bucket& bucket, librados::IoCtx& index_ctx,
 +    string& bucket_oid_base) {
    if (bucket_is_system(bucket))
      return -EINVAL;
  
index 09a69cb3ff3a8b001494226c60f526c5a038ca60,03290f88176635b6a62806364970f3b44f00cc20..7b70fcba47731ae8b42b97d75338e90c1dc6189c
@@@ -1967,6 -1890,11 +1967,8 @@@ public
    int lock_exclusive(rgw_bucket& pool, const string& oid, utime_t& duration, string& zone_id, string& owner_id);
    int unlock(rgw_bucket& pool, const string& oid, string& zone_id, string& owner_id);
  
 -  /// clean up/process any temporary objects older than given date[/time]
 -  int remove_temp_objects(string date, string time);
 -
+   void update_gc_chain(rgw_obj& head_obj, RGWObjManifest& manifest, cls_rgw_obj_chain *chain);
+   int send_chain_to_gc(cls_rgw_obj_chain& chain, const string& tag, bool sync);
    int gc_operate(string& oid, librados::ObjectWriteOperation *op);
    int gc_aio_operate(string& oid, librados::ObjectWriteOperation *op);
    int gc_operate(string& oid, librados::ObjectReadOperation *op, bufferlist *pbl);
Simple merge
Simple merge