]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Init res id with cls_2pc_reservation::NO_ID 52253/head
authorVedansh Bhartia <vedanshbhartia@gmail.com>
Thu, 29 Jun 2023 10:18:22 +0000 (15:48 +0530)
committerVedansh Bhartia <vedanshbhartia@gmail.com>
Thu, 29 Jun 2023 10:18:22 +0000 (15:48 +0530)
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 <vedanshbhartia@gmail.com>
src/rgw/driver/rados/rgw_notify.cc

index b1835016ec0eef21b9adc01ace1e43c67f74fc50..dffd88e557be034d65ca1f4e5de8f14badc37169 100644 (file)
@@ -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