From 77566a55747cefedccc5862df38188cb9bb2cc02 Mon Sep 17 00:00:00 2001 From: Daniel Gryniewicz Date: Thu, 12 May 2022 13:48:44 -0400 Subject: [PATCH] RGW - Zipper - Provide default get_new_req_id() Now that RadorStore's get_new_req_id() just returns a random number, use that as the default implementation for SAL. Signed-off-by: Daniel Gryniewicz --- src/rgw/rgw_rados.cc | 2 +- src/rgw/rgw_rados.h | 4 ---- src/rgw/rgw_sal.h | 5 ++++- src/rgw/rgw_sal_dbstore.h | 1 - src/rgw/rgw_sal_motr.h | 1 - src/rgw/rgw_sal_rados.h | 1 - 6 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index ffeea0d0fc31f..6bc7d18b0f6eb 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -3068,7 +3068,7 @@ int RGWRados::Object::Write::_do_write_meta(const DoutPrefixProvider *dpp, string req_id; if (!s) { // fake req_id - req_id = store->svc.zone_utils->unique_id(store->get_new_req_id()); + req_id = store->svc.zone_utils->unique_id(store->store->get_new_req_id()); } else { req_id = s->req_id; } diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index d56a34472342a..0955e237daa39 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -514,10 +514,6 @@ public: return *this; } - uint64_t get_new_req_id() { - return ceph::util::generate_random_number(); - } - librados::IoCtx* get_lc_pool_ctx() { return &lc_pool_ctx; } diff --git a/src/rgw/rgw_sal.h b/src/rgw/rgw_sal.h index 736237ae86fda..f963a329314c6 100644 --- a/src/rgw/rgw_sal.h +++ b/src/rgw/rgw_sal.h @@ -19,6 +19,7 @@ #include "rgw_notify_event_type.h" #include "common/tracer.h" #include "rgw_datalog_notify.h" +#include "include/random.h" class RGWGetDataCB; class RGWAccessListFilter; @@ -363,7 +364,9 @@ class Store { /** Enable or disable a set of bucket. e.g. if a User is suspended */ virtual int set_buckets_enabled(const DoutPrefixProvider* dpp, std::vector& buckets, bool enabled) = 0; /** Get a new request ID */ - virtual uint64_t get_new_req_id() = 0; + virtual uint64_t get_new_req_id() { + return ceph::util::generate_random_number(); + } /** Get a handler for bucket sync policy. */ virtual int get_sync_policy_handler(const DoutPrefixProvider* dpp, std::optional zone, diff --git a/src/rgw/rgw_sal_dbstore.h b/src/rgw/rgw_sal_dbstore.h index 5320cf9440588..37e042f76db69 100644 --- a/src/rgw/rgw_sal_dbstore.h +++ b/src/rgw/rgw_sal_dbstore.h @@ -793,7 +793,6 @@ public: virtual void get_ratelimit(RGWRateLimitInfo& bucket_ratelimit, RGWRateLimitInfo& user_ratelimit, RGWRateLimitInfo& anon_ratelimit) override; virtual void get_quota(RGWQuota& quota) override; virtual int set_buckets_enabled(const DoutPrefixProvider *dpp, std::vector& buckets, bool enabled) override; - virtual uint64_t get_new_req_id() override { return 0; } virtual int get_sync_policy_handler(const DoutPrefixProvider *dpp, std::optional zone, std::optional bucket, diff --git a/src/rgw/rgw_sal_motr.h b/src/rgw/rgw_sal_motr.h index 7eea784962a86..16978bf65799a 100644 --- a/src/rgw/rgw_sal_motr.h +++ b/src/rgw/rgw_sal_motr.h @@ -935,7 +935,6 @@ class MotrStore : public Store { virtual void get_ratelimit(RGWRateLimitInfo& bucket_ratelimit, RGWRateLimitInfo& user_ratelimit, RGWRateLimitInfo& anon_ratelimit) override; virtual void get_quota(RGWQuota& quota) override; virtual int set_buckets_enabled(const DoutPrefixProvider *dpp, std::vector& buckets, bool enabled) override; - virtual uint64_t get_new_req_id() override { return 0; } virtual int get_sync_policy_handler(const DoutPrefixProvider *dpp, std::optional zone, std::optional bucket, diff --git a/src/rgw/rgw_sal_rados.h b/src/rgw/rgw_sal_rados.h index 2640fd5cbfe28..74748931ffda7 100644 --- a/src/rgw/rgw_sal_rados.h +++ b/src/rgw/rgw_sal_rados.h @@ -162,7 +162,6 @@ class RadosStore : public Store { virtual void get_quota(RGWQuota& quota) override; virtual void get_ratelimit(RGWRateLimitInfo& bucket_ratelimit, RGWRateLimitInfo& user_ratelimit, RGWRateLimitInfo& anon_ratelimit) override; virtual int set_buckets_enabled(const DoutPrefixProvider* dpp, std::vector& buckets, bool enabled) override; - virtual uint64_t get_new_req_id() override { return rados->get_new_req_id(); } virtual int get_sync_policy_handler(const DoutPrefixProvider* dpp, std::optional zone, std::optional bucket, -- 2.39.5