From: Cory Snyder Date: Tue, 5 Oct 2021 19:07:11 +0000 (+0000) Subject: rgw/rgw_rados: make RGW request IDs non-deterministic X-Git-Tag: v17.1.0~665^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bce34dd68634d241b451111dcf2e931837eb4bfd;p=ceph.git rgw/rgw_rados: make RGW request IDs non-deterministic Use a random number vs. incremental counter for first component of request ID. Fixes: https://tracker.ceph.com/issues/52818 Signed-off-by: Cory Snyder --- diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 26b603b128b0..cb96b9dbb2e5 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -9,6 +9,7 @@ #include "include/rados/librados.hpp" #include "include/Context.h" +#include "include/random.h" #include "common/RefCountedObj.h" #include "common/ceph_time.h" #include "common/Timer.h" @@ -355,7 +356,7 @@ class RGWRados int open_pool_ctx(const DoutPrefixProvider *dpp, const rgw_pool& pool, librados::IoCtx& io_ctx, bool mostly_omap); - std::atomic max_req_id = { 0 }; + ceph::mutex lock = ceph::make_mutex("rados_timer_lock"); SafeTimer *timer; @@ -506,7 +507,7 @@ public: } uint64_t get_new_req_id() { - return ++max_req_id; + return ceph::util::generate_random_number(); } librados::IoCtx* get_lc_pool_ctx() {