From 362f1231b972aaae73c3dbd03b8bf59a32651432 Mon Sep 17 00:00:00 2001 From: Vedansh Bhartia Date: Thu, 29 Jun 2023 15:48:22 +0530 Subject: [PATCH] rgw: Init res id with cls_2pc_reservation::NO_ID rgw_notify.cc did not initialize res_id for non-persistent topics. Although it was not required for non-persistent topics, it might cause an issue when a topic is changed from non-persistent to persistent between "reserve" and "commit". Signed-off-by: Vedansh Bhartia --- src/rgw/driver/rados/rgw_notify.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rgw/driver/rados/rgw_notify.cc b/src/rgw/driver/rados/rgw_notify.cc index b1835016ec0ee..dffd88e557be0 100644 --- a/src/rgw/driver/rados/rgw_notify.cc +++ b/src/rgw/driver/rados/rgw_notify.cc @@ -810,7 +810,7 @@ static inline bool notification_match(reservation_t& res, "' (unique topic: '" << topic_cfg.name << "') apply to event of type: '" << to_string(event_type) << "'" << dendl; - cls_2pc_reservation::id_t res_id; + cls_2pc_reservation::id_t res_id = cls_2pc_reservation::NO_ID; if (topic_cfg.dest.persistent) { // TODO: take default reservation size from conf constexpr auto DEFAULT_RESERVATION = 4*1024U; // 4K -- 2.39.5