]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/rgw_rados: make RGW request IDs non-deterministic 43696/head
authorCory Snyder <csnyder@iland.com>
Tue, 5 Oct 2021 19:07:11 +0000 (19:07 +0000)
committerCory Snyder <csnyder@iland.com>
Wed, 3 Nov 2021 13:40:55 +0000 (09:40 -0400)
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>
(cherry picked from commit bce34dd68634d241b451111dcf2e931837eb4bfd)

src/rgw/rgw_rados.h

index 99e7cbbfd39051833b3a4dccdc57810a0bb95b9b..8a5ee7cfeefe5c1f0c664cfcec73b9ab4022df98 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/RWLock.h"
 #include "common/ceph_time.h"
@@ -422,7 +423,7 @@ class RGWRados
   int open_pool_ctx(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;
 
@@ -555,7 +556,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() {