Append data to an object. You must have write permissions on the bucket to perform this operation.
It is used to upload files in appending mode. The type of the objects created by the Append Object
operation is Appendable Object, and the type of the objects uploaded with the Put Object operation is Normal Object.
-**Append Object can't be used if bucket versioning is enabled.**
+**Append Object can't be used if bucket versioning is enabled or suspende.**
+**Synced object will become normal in multisite, but you can still append to the original object.**
Syntax
| **409** | PositionNotEqualToLength | Specified position does not match object length |
+---------------+----------------------------+---------------------------------------------------+
| **409** | ObjectNotAppendable | Specified object can not be appended |
-+---------------+----------------------------+---------------------------------------------------+
\ No newline at end of file
++---------------+----------------------------+---------------------------------------------------+
+| **409** | InvalidBucketstate | Bucket versioning is enabled or suspended |
++---------------+----------------------------+---------------------------------------------------+
+
{ ERR_DELETE_CONFLICT, {409, "DeleteConflict"}},
{ ERR_POSITION_NOT_EQUAL_TO_LENGTH, {409, "PositionNotEqualToLength"}},
{ ERR_OBJECT_NOT_APPENDABLE, {409, "ObjectNotAppendable"}},
+ { ERR_INVALID_BUCKET_STATE, {409, "InvalidBucketState"}},
{ ERR_INVALID_SECRET_KEY, {400, "InvalidSecretKey"}},
{ ERR_INVALID_KEY_TYPE, {400, "InvalidKeyType"}},
{ ERR_INVALID_CAP, {400, "InvalidCapability"}},
#define ERR_RATE_LIMITED 2218
#define ERR_POSITION_NOT_EQUAL_TO_LENGTH 2219
#define ERR_OBJECT_NOT_APPENDABLE 2220
+#define ERR_INVALID_BUCKET_STATE 2221
#define ERR_BUSY_RESHARDING 2300
#define ERR_NO_SUCH_ENTITY 2301
// create the object processor
rgw::AioThrottle aio(store->ctx()->_conf->rgw_put_obj_min_window_size);
using namespace rgw::putobj;
- constexpr auto max_processor_size = std::max(sizeof(MultipartObjectProcessor),
+ constexpr auto max_processor_size = std::max({sizeof(MultipartObjectProcessor),
sizeof(AtomicObjectProcessor),
- sizeof(AppendObjectProcessor));
+ sizeof(AppendObjectProcessor)});
ceph::static_ptr<ObjectProcessor, max_processor_size> processor;
rgw_placement_rule *pdest_placement;
s->owner.get_id(), obj_ctx, obj,
multipart_upload_id, multipart_part_num, multipart_part_str);
} else if(append) {
+ if (s->bucket_info.versioned()) {
+ op_ret = -ERR_INVALID_BUCKET_STATE;
+ return;
+ }
+ pdest_placement = &s->dest_placement;
processor.emplace<AppendObjectProcessor>(
- &aio, store, s->bucket_info, s->bucket_owner.get_id(),obj_ctx, obj,
+ &aio, store, s->bucket_info, pdest_placement, s->bucket_owner.get_id(),obj_ctx, obj,
s->req_id, position, &cur_accounted_size);
} else {
if (s->bucket_info.versioning_enabled()) {
}
manifest.set_multipart_part_rule(store->ctx()->_conf->rgw_obj_stripe_size, cur_part_num);
- r = manifest_gen.create_begin(store->ctx(), &manifest, bucket_info.placement_rule, head_obj.bucket, head_obj);
+ r = manifest_gen.create_begin(store->ctx(), &manifest, bucket_info.placement_rule, &tail_placement_rule, head_obj.bucket, head_obj);
if (r < 0) {
return r;
}
const char *if_match, const char *if_nomatch,
const std::string *user_data,
rgw_zone_set *zones_trace, bool *canceled) override;
+
};
public:
AppendObjectProcessor(Aio *aio, RGWRados *store, const RGWBucketInfo& bucket_info,
+ const rgw_placement_rule *ptail_placement_rule,
const rgw_user& owner, RGWObjectCtx& obj_ctx,const rgw_obj& head_obj,
const std::string& unique_tag, uint64_t position, uint64_t *cur_accounted_size)
- : ManifestObjectProcessor(aio, store, bucket_info, owner, obj_ctx, head_obj),
+ : ManifestObjectProcessor(aio, store, bucket_info, ptail_placement_rule, owner, obj_ctx, head_obj),
position(position), cur_size(0), cur_accounted_size(cur_accounted_size),
unique_tag(unique_tag), cur_manifest(nullptr)
{}
}
}
+ //erase the append attr
+ cb.get_attrs().erase(RGW_ATTR_APPEND_PART_NUM);
+
if (source_zone.empty()) {
set_copy_attrs(cb.get_attrs(), attrs, attrs_mod);
} else {