mirror of
https://github.com/ceph/ceph
synced 2025-01-01 08:32:24 +00:00
Merge pull request #43428 from cfsnyder/wip-52818-random-rgw-req-id
rgw/rgw_rados: make RGW request IDs non-deterministic Reviewed-by: Matt Benjamin <mbenjami@redhat.com> Reviewed-by: Adam C. Emerson <aemerson@redhat.com>
This commit is contained in:
commit
fff75ecc01
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "include/rados/librados.hpp"
|
#include "include/rados/librados.hpp"
|
||||||
#include "include/Context.h"
|
#include "include/Context.h"
|
||||||
|
#include "include/random.h"
|
||||||
#include "common/RefCountedObj.h"
|
#include "common/RefCountedObj.h"
|
||||||
#include "common/ceph_time.h"
|
#include "common/ceph_time.h"
|
||||||
#include "common/Timer.h"
|
#include "common/Timer.h"
|
||||||
@ -356,7 +357,7 @@ class RGWRados
|
|||||||
int open_pool_ctx(const DoutPrefixProvider *dpp, const rgw_pool& pool, librados::IoCtx& io_ctx,
|
int open_pool_ctx(const DoutPrefixProvider *dpp, const rgw_pool& pool, librados::IoCtx& io_ctx,
|
||||||
bool mostly_omap);
|
bool mostly_omap);
|
||||||
|
|
||||||
std::atomic<int64_t> max_req_id = { 0 };
|
|
||||||
ceph::mutex lock = ceph::make_mutex("rados_timer_lock");
|
ceph::mutex lock = ceph::make_mutex("rados_timer_lock");
|
||||||
SafeTimer *timer;
|
SafeTimer *timer;
|
||||||
|
|
||||||
@ -507,7 +508,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint64_t get_new_req_id() {
|
uint64_t get_new_req_id() {
|
||||||
return ++max_req_id;
|
return ceph::util::generate_random_number<uint64_t>();
|
||||||
}
|
}
|
||||||
|
|
||||||
librados::IoCtx* get_lc_pool_ctx() {
|
librados::IoCtx* get_lc_pool_ctx() {
|
||||||
|
Loading…
Reference in New Issue
Block a user