#include "common/Formatter.h"
#include "common/Throttle.h"
#include "common/BackTrace.h"
+#include "common/ceph_time.h"
#include "rgw_sal.h"
#include "rgw_zone.h"
encode(trace, bl);
cb.get_attrs()[RGW_ATTR_OBJ_REPLICATION_TRACE] = std::move(bl);
}
+ {
+ // add x-amz-replicated-at
+ bufferlist bl;
+ ceph::real_time timestamp = real_clock::now();
+ encode(timestamp, bl);
+ cb.get_attrs()[RGW_ATTR_OBJ_REPLICATION_TIMESTAMP] = std::move(bl);
+ }
if (source_zone.empty()) {
set_copy_attrs(cb.get_attrs(), attrs, attrs_mod);
#define RGW_ATTR_OBJ_REPLICATION_STATUS RGW_ATTR_PREFIX "amz-replication-status"
#define RGW_ATTR_OBJ_REPLICATION_TRACE RGW_ATTR_PREFIX "replication-trace"
+#define RGW_ATTR_OBJ_REPLICATION_TIMESTAMP RGW_ATTR_PREFIX "replicated-at"
/* IAM Policy */
#define RGW_ATTR_IAM_POLICY RGW_ATTR_PREFIX "iam-policy"
}
} catch (const buffer::error&) {} // omit x-rgw-replicated-from headers
}
+ if (auto i = attrs.find(RGW_ATTR_OBJ_REPLICATION_TIMESTAMP);
+ i != attrs.end()) {
+ try {
+ ceph::real_time replicated_time;
+ decode(replicated_time, i->second);
+ dump_time(s, "x-rgw-replicated-at", replicated_time);
+ } catch (const buffer::error&) {}
+ }
+
if (multipart_parts_count) {
dump_header(s, "x-amz-mp-parts-count", *multipart_parts_count);
}