From: Leonid Chernin Date: Thu, 5 Jun 2025 07:59:03 +0000 (+0300) Subject: nvmeofgw: fix sending acks during upgrade X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=3042c3695cbdbc75bad1d3564e887f1b1ad77ef6;p=ceph.git nvmeofgw: fix sending acks during upgrade fix gw-epoch during upgrade 1.fixed issue when during upgrade before feature NVMEOFHAMAP is applyed, monitor did not send acks to beacon - this cause expiration GW mon-client beacon ack timeout and assert of the GW. 2. fixed issue that during upgrade new GW epoch, generated after applying of new feature NVMEOFHAMAP was less than global epoch. So GW mon-client asserted on receiving new epoch that is less than its last received epoch Signed-off-by: Leonid Chernin --- diff --git a/src/mon/NVMeofGwMap.cc b/src/mon/NVMeofGwMap.cc index 12bd93cef7466..d5479b1ffce28 100755 --- a/src/mon/NVMeofGwMap.cc +++ b/src/mon/NVMeofGwMap.cc @@ -267,6 +267,11 @@ void NVMeofGwMap::gw_performed_startup(const NvmeGwId &gw_id, void NVMeofGwMap::increment_gw_epoch(const NvmeGroupKey& group_key) { if (HAVE_FEATURE(mon->get_quorum_con_features(), NVMEOFHAMAP)) { + if (gw_epoch.find(group_key) == gw_epoch.end()) { + gw_epoch[group_key] = epoch; + dout(4) << "recreated GW epoch of " << group_key + << " " << gw_epoch[group_key] << dendl; + } gw_epoch[group_key] ++; dout(4) << "incremented epoch of " << group_key << " " << gw_epoch[group_key] << dendl; diff --git a/src/mon/NVMeofGwMon.cc b/src/mon/NVMeofGwMon.cc index e41060084eae9..96611d08750be 100644 --- a/src/mon/NVMeofGwMon.cc +++ b/src/mon/NVMeofGwMon.cc @@ -158,7 +158,8 @@ version_t NVMeofGwMon::get_trim_to() const * function called during new paxos epochs * function called to restore in pending map all data that is not serialized * to paxos peons. Othervise it would be overriden in "pending_map = map" - * currently "allow_failovers_ts" and "last_gw_down_ts" variables restored + * currently "allow_failovers_ts", "last_gw_down_ts", + * "last_gw_map_epoch_valid" variables are restored */ void NVMeofGwMon::restore_pending_map_info(NVMeofGwMap & tmp_map) { std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); @@ -175,6 +176,8 @@ void NVMeofGwMon::restore_pending_map_info(NVMeofGwMap & tmp_map) { } pending_map.created_gws[group_key][gw_id].last_gw_down_ts = gw_created_pair.second.last_gw_down_ts; + pending_map.created_gws[group_key][gw_id].last_gw_map_epoch_valid = + gw_created_pair.second.last_gw_map_epoch_valid; } } } @@ -806,12 +809,13 @@ bool NVMeofGwMon::prepare_beacon(MonOpRequestRef op) send_ack = true; if (apply_ack_logic) { dout(20) << "ack sent: beacon index " - << pending_map.created_gws[group_key][gw_id].beacon_index - << " gw " << gw_id <