mirror of
https://github.com/ceph/ceph
synced 2025-02-21 01:47:25 +00:00
Merge pull request #30163 from zhangsw/feature-rgw-opslog-transid
rgw: add transaction id to ops log. Reviewed-by: Casey Bodley <cbodley@redhat.com>
This commit is contained in:
commit
026eed47d2
@ -238,6 +238,7 @@ void rgw_log_entry::generate_test_instances(list<rgw_log_entry*>& o)
|
|||||||
e->user_agent = "user_agent";
|
e->user_agent = "user_agent";
|
||||||
e->referrer = "referrer";
|
e->referrer = "referrer";
|
||||||
e->bucket_id = "10";
|
e->bucket_id = "10";
|
||||||
|
e->trans_id = "trans_id";
|
||||||
o.push_back(e);
|
o.push_back(e);
|
||||||
o.push_back(new rgw_log_entry);
|
o.push_back(new rgw_log_entry);
|
||||||
}
|
}
|
||||||
|
@ -167,6 +167,7 @@ void rgw_log_entry::dump(Formatter *f) const
|
|||||||
f->dump_string("user_agent", user_agent);
|
f->dump_string("user_agent", user_agent);
|
||||||
f->dump_string("referrer", referrer);
|
f->dump_string("referrer", referrer);
|
||||||
f->dump_string("bucket_id", bucket_id);
|
f->dump_string("bucket_id", bucket_id);
|
||||||
|
f->dump_string("trans_id", trans_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ACLPermission::dump(Formatter *f) const
|
void ACLPermission::dump(Formatter *f) const
|
||||||
|
@ -273,6 +273,7 @@ void rgw_format_ops_log_entry(struct rgw_log_entry& entry, Formatter *formatter)
|
|||||||
}
|
}
|
||||||
formatter->close_section();
|
formatter->close_section();
|
||||||
}
|
}
|
||||||
|
formatter->dump_string("trans_id", entry.trans_id);
|
||||||
formatter->close_section();
|
formatter->close_section();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -426,6 +427,7 @@ int rgw_log_op(RGWRados *store, RGWREST* const rest, struct req_state *s,
|
|||||||
|
|
||||||
entry.error_code = s->err.err_code;
|
entry.error_code = s->err.err_code;
|
||||||
entry.bucket_id = bucket_id;
|
entry.bucket_id = bucket_id;
|
||||||
|
entry.trans_id = s->trans_id;
|
||||||
|
|
||||||
bufferlist bl;
|
bufferlist bl;
|
||||||
encode(entry, bl);
|
encode(entry, bl);
|
||||||
|
@ -34,9 +34,10 @@ struct rgw_log_entry {
|
|||||||
string referrer;
|
string referrer;
|
||||||
string bucket_id;
|
string bucket_id;
|
||||||
headers_map x_headers;
|
headers_map x_headers;
|
||||||
|
string trans_id;
|
||||||
|
|
||||||
void encode(bufferlist &bl) const {
|
void encode(bufferlist &bl) const {
|
||||||
ENCODE_START(9, 5, bl);
|
ENCODE_START(10, 5, bl);
|
||||||
encode(object_owner.id, bl);
|
encode(object_owner.id, bl);
|
||||||
encode(bucket_owner.id, bl);
|
encode(bucket_owner.id, bl);
|
||||||
encode(bucket, bl);
|
encode(bucket, bl);
|
||||||
@ -59,10 +60,11 @@ struct rgw_log_entry {
|
|||||||
encode(object_owner, bl);
|
encode(object_owner, bl);
|
||||||
encode(bucket_owner, bl);
|
encode(bucket_owner, bl);
|
||||||
encode(x_headers, bl);
|
encode(x_headers, bl);
|
||||||
|
encode(trans_id, bl);
|
||||||
ENCODE_FINISH(bl);
|
ENCODE_FINISH(bl);
|
||||||
}
|
}
|
||||||
void decode(bufferlist::const_iterator &p) {
|
void decode(bufferlist::const_iterator &p) {
|
||||||
DECODE_START_LEGACY_COMPAT_LEN(8, 5, 5, p);
|
DECODE_START_LEGACY_COMPAT_LEN(10, 5, 5, p);
|
||||||
decode(object_owner.id, p);
|
decode(object_owner.id, p);
|
||||||
if (struct_v > 3)
|
if (struct_v > 3)
|
||||||
decode(bucket_owner.id, p);
|
decode(bucket_owner.id, p);
|
||||||
@ -108,6 +110,9 @@ struct rgw_log_entry {
|
|||||||
if (struct_v >= 9) {
|
if (struct_v >= 9) {
|
||||||
decode(x_headers, p);
|
decode(x_headers, p);
|
||||||
}
|
}
|
||||||
|
if (struct_v >= 10) {
|
||||||
|
decode(trans_id, p);
|
||||||
|
}
|
||||||
DECODE_FINISH(p);
|
DECODE_FINISH(p);
|
||||||
}
|
}
|
||||||
void dump(ceph::Formatter *f) const;
|
void dump(ceph::Formatter *f) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user