From: Abhishek Bansal Date: Fri, 3 Apr 2026 15:42:23 +0000 (+0530) Subject: rgw: fix uninitalized fields in pubsub topic creation X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=75d62e94424f90a30e824e164049d0c14fecb565;p=ceph.git rgw: fix uninitalized fields in pubsub topic creation Signed-off-by: Abhishek Bansal --- diff --git a/src/rgw/rgw_pubsub.h b/src/rgw/rgw_pubsub.h index e2428dde78a0..e0c65d4d6c57 100644 --- a/src/rgw/rgw_pubsub.h +++ b/src/rgw/rgw_pubsub.h @@ -254,6 +254,14 @@ void set_event_id(std::string& id, const std::string& hash, const utime_t& ts); using ShardNamesView = std::ranges::transform_view, std::function>; +namespace rgw::notify { + // Denotes that the topic has not overridden the global configurations for (time_to_live / max_retries / retry_sleep_duration) + // defaults: (rgw_topic_persistency_time_to_live / rgw_topic_persistency_max_retries / rgw_topic_persistency_sleep_duration) + constexpr uint32_t DEFAULT_GLOBAL_VALUE = UINT32_MAX; + // Used in case the topic is using the default global value for dumping in a formatter + constexpr static const std::string_view DEFAULT_CONFIG{"None"}; +} // namespace rgw::notify + struct rgw_pubsub_dest { std::string push_endpoint; std::string push_endpoint_args; @@ -262,13 +270,13 @@ struct rgw_pubsub_dest { bool persistent = false; // rados object name of the persistent queue in the 'notif' pool std::string persistent_queue; - uint32_t time_to_live; - uint32_t max_retries; - uint32_t retry_sleep_duration; + uint32_t time_to_live = rgw::notify::DEFAULT_GLOBAL_VALUE; + uint32_t max_retries = rgw::notify::DEFAULT_GLOBAL_VALUE; + uint32_t retry_sleep_duration = rgw::notify::DEFAULT_GLOBAL_VALUE; // naming convention of sharded queues in the 'notif' pool -> persistent_queue, persistent_queue.1, persistent_queue.(num_shards -1)... uint64_t num_shards = 1; // Default to 1 shard for backward compatibility with pre-sharding persistent topics. - + void encode(bufferlist& bl) const { ENCODE_START(8, 1, bl); encode("", bl); @@ -608,11 +616,6 @@ public: }; namespace rgw::notify { - // Denotes that the topic has not overridden the global configurations for (time_to_live / max_retries / retry_sleep_duration) - // defaults: (rgw_topic_persistency_time_to_live / rgw_topic_persistency_max_retries / rgw_topic_persistency_sleep_duration) - constexpr uint32_t DEFAULT_GLOBAL_VALUE = UINT32_MAX; - // Used in case the topic is using the default global value for dumping in a formatter - constexpr static const std::string_view DEFAULT_CONFIG{"None"}; struct event_entry_t { rgw_pubsub_s3_event event; std::string push_endpoint;