Skip to content

Commit 3042c36

Browse files
committed
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 <[email protected]>
1 parent 3e2687d commit 3042c36

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/mon/NVMeofGwMap.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ void NVMeofGwMap::gw_performed_startup(const NvmeGwId &gw_id,
267267
void NVMeofGwMap::increment_gw_epoch(const NvmeGroupKey& group_key)
268268
{
269269
if (HAVE_FEATURE(mon->get_quorum_con_features(), NVMEOFHAMAP)) {
270+
if (gw_epoch.find(group_key) == gw_epoch.end()) {
271+
gw_epoch[group_key] = epoch;
272+
dout(4) << "recreated GW epoch of " << group_key
273+
<< " " << gw_epoch[group_key] << dendl;
274+
}
270275
gw_epoch[group_key] ++;
271276
dout(4) << "incremented epoch of " << group_key
272277
<< " " << gw_epoch[group_key] << dendl;

src/mon/NVMeofGwMon.cc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ version_t NVMeofGwMon::get_trim_to() const
158158
* function called during new paxos epochs
159159
* function called to restore in pending map all data that is not serialized
160160
* to paxos peons. Othervise it would be overriden in "pending_map = map"
161-
* currently "allow_failovers_ts" and "last_gw_down_ts" variables restored
161+
* currently "allow_failovers_ts", "last_gw_down_ts",
162+
* "last_gw_map_epoch_valid" variables are restored
162163
*/
163164
void NVMeofGwMon::restore_pending_map_info(NVMeofGwMap & tmp_map) {
164165
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) {
175176
}
176177
pending_map.created_gws[group_key][gw_id].last_gw_down_ts =
177178
gw_created_pair.second.last_gw_down_ts;
179+
pending_map.created_gws[group_key][gw_id].last_gw_map_epoch_valid =
180+
gw_created_pair.second.last_gw_map_epoch_valid;
178181
}
179182
}
180183
}
@@ -806,12 +809,13 @@ bool NVMeofGwMon::prepare_beacon(MonOpRequestRef op)
806809
send_ack = true;
807810
if (apply_ack_logic) {
808811
dout(20) << "ack sent: beacon index "
809-
<< pending_map.created_gws[group_key][gw_id].beacon_index
810-
<< " gw " << gw_id <<dendl;
812+
<< pending_map.created_gws[group_key][gw_id].beacon_index
813+
<< " gw " << gw_id << " epoch-filter " << epoch_filter_enabled
814+
<< " propose " << propose << " gw-propose " << gw_propose << dendl;
811815
}
812816
}
813817
if (send_ack && ((!gw_propose && epoch_filter_enabled) ||
814-
(propose && !epoch_filter_enabled) ||
818+
(!propose && !epoch_filter_enabled) ||
815819
(avail == gw_availability_t::GW_CREATED)) ) {
816820
/* always send beacon ack to gw in Created state,
817821
* it should be temporary state

0 commit comments

Comments
 (0)