x-amz-meta-rgwx-source-mtime: 1608546349.757100363
x-amz-meta-rgwx-versioned-epoch: 0
+In order to allow some cloud services detect the source and map the user-defined 'x-amz-meta-' attributes, below two additional new attributes are added to the objects being transitioned
+
+::
+
+ x-rgw-cloud : true/false
+ (set to "true", by default, if the object is being transitioned from RGW)
+
+ x-rgw-cloud-keep-attrs : true/false
+ (if set to default value "true", the cloud service should map and store all the x-amz-meta-* attributes. If it cannot, then the operation should fail.
+ if set to "false", the cloud service can ignore such attributes and just store the object data being sent.)
+
+
By default, post transition, the source object gets deleted. But it is possible to retain its metadata but with updated values (like storage-class and object-size) by setting config option 'retain_head_object' to true. However GET on those objects shall still fail with 'InvalidObjectState' error.
For example,
}
bool RGWLCCloudStreamPut::keep_attr(const string& h) {
- return (keep_headers.find(h) != keep_headers.end() ||
- boost::algorithm::starts_with(h, "X_AMZ_"));
+ return (keep_headers.find(h) != keep_headers.end());
}
void RGWLCCloudStreamPut::init_send_attrs(const DoutPrefixProvider *dpp,
for (auto& hi : rest_obj.attrs) {
if (keep_attr(hi.first)) {
attrs.insert(hi);
+ } else {
+ std::string s1 = boost::algorithm::to_lower_copy(hi.first);
+ const char* k = std::strstr(s1.c_str(), "x-amz");
+ if (k) {
+ attrs[k] = hi.second;
+ }
}
}
/* New attribute to specify its transitioned from RGW */
attrs["x-amz-meta-rgwx-source"] = "rgw";
+ attrs["x-rgw-cloud"] = "true";
+ attrs["x-rgw-cloud-keep-attrs"] = "true";
char buf[32];
snprintf(buf, sizeof(buf), "%llu", (long long)obj_properties.versioned_epoch);