]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rgw_rados: make RGW request IDs non-deterministic 43428/head
authorCory Snyder <csnyder@iland.com>
Tue, 5 Oct 2021 19:07:11 +0000 (19:07 +0000)
committerCory Snyder <csnyder@iland.com>
Thu, 7 Oct 2021 11:53:12 +0000 (11:53 +0000)
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 <csnyder@iland.com>
src/rgw/rgw_rados.h

index 26b603b128b0120835700976862d1c6aa72412a5..cb96b9dbb2e5937eef7754646d7aff5c1f1d9a2d 100644 (file)
@@ -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<int64_t> 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<uint64_t>();
   }
 
   librados::IoCtx* get_lc_pool_ctx() {