Skip to content

Commit 9513740

Browse files
committed
rgw: log request_id on start new request
The log entry for "starting new request" may display the same hexadecimal value across multiple requests, making it difficult to pinpoint the exact start time of a request. Including the request ID in this log would facilitate easier identification of individual request start times. Fixes: https://tracker.ceph.com/issues/69715 Signed-off-by: Seena Fallah <[email protected]>
1 parent 892aaba commit 9513740

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/rgw/rgw_process.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,10 @@ int process_request(const RGWProcessEnv& penv,
274274
int* http_ret)
275275
{
276276
int ret = client_io->init(g_ceph_context);
277+
rgw::sal::Driver* driver = penv.driver;
278+
auto trans_id = driver->zone_unique_trans_id(req->id);
277279
dout(1) << "====== starting new request req=" << hex << req << dec
278-
<< " =====" << dendl;
280+
<< " request_id=" << trans_id << " =====" << dendl;
279281
perfcounter->inc(l_rgw_req);
280282

281283
RGWEnv& rgw_env = client_io->get_env();
@@ -285,7 +287,6 @@ int process_request(const RGWProcessEnv& penv,
285287

286288
s->ratelimit_data = penv.ratelimiting->get_active();
287289

288-
rgw::sal::Driver* driver = penv.driver;
289290
std::unique_ptr<rgw::sal::User> u = driver->get_user(rgw_user());
290291
s->set_user(u);
291292

@@ -296,12 +297,10 @@ int process_request(const RGWProcessEnv& penv,
296297
}
297298

298299
s->req_id = driver->zone_unique_id(req->id);
299-
s->trans_id = driver->zone_unique_trans_id(req->id);
300+
s->trans_id = trans_id;
300301
s->host_id = driver->get_host_id();
301302
s->yield = yield;
302303

303-
ldpp_dout(s, 2) << "initializing for trans_id = " << s->trans_id << dendl;
304-
305304
RGWOp* op = nullptr;
306305
int init_error = 0;
307306
bool should_log = false;

0 commit comments

Comments
 (0)