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: v16.2.7~64^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F43695%2Fhead;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 (cherry picked from commit bce34dd68634d241b451111dcf2e931837eb4bfd) --- diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index 2c576bc8e6c..b1a51ba3356 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/RWLock.h" #include "common/ceph_time.h" @@ -422,7 +423,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; @@ -563,7 +564,7 @@ public: } uint64_t get_new_req_id() { - return ++max_req_id; + return ceph::util::generate_random_number(); } librados::IoCtx* get_lc_pool_ctx() {