This can be done by making sure the combined weight of the OSDs on each dividing
bucket are the same.
+NVMeoF Gateway
+--------------
+
+NVMOEF_SINGLE_GATEWAY
+__________________________________
+
+One of the gateway group has only one gateway. This is not ideal because it makes
+high availability (HA) impossible with a single gatway in a group. This can lead to
+problems with failover and failback operations for the NVMeoF gateway.
+
+It's recommended to have multiple NVMeoF gateways in a group.
+
Miscellaneous
-------------
#include "NVMeofGwMon.h"
#include "NVMeofGwMap.h"
#include "OSDMonitor.h"
+#include "mon/health_check.h"
+using std::list;
using std::map;
using std::make_pair;
using std::ostream;
}
};
+void NVMeofGwMap::get_health_checks(health_check_map_t *checks) const
+{
+ list<string> detail;
+ for (const auto& created_map_pair: created_gws) {
+ const auto& group_key = created_map_pair.first;
+ auto& group = group_key.second;
+ const NvmeGwMonStates& gw_created_map = created_map_pair.second;
+ if ( gw_created_map.size() == 1) {
+ ostringstream ss;
+ ss << "NVMeoF Gateway Group '" << group << "' has 1 gateway." ;
+ detail.push_back(ss.str());
+ }
+ }
+ if (!detail.empty()) {
+ ostringstream ss;
+ ss << detail.size() << " group(s) have only 1 nvmeof gateway"
+ << "; HA is not possible with single gateway.";
+ auto& d = checks->add("NVMEOF_SINGLE_GATEWAY", HEALTH_WARN,
+ ss.str(), detail.size());
+ d.detail.swap(detail);
+ }
+}
+
int NVMeofGwMap::blocklist_gw(
const NvmeGwId &gw_id, const NvmeGroupKey& group_key,
NvmeAnaGrpId grpid, epoch_t &epoch, bool failover)
#include "NVMeofGwTypes.h"
using ceph::coarse_mono_clock;
+
+class health_check_map_t;
+
class Monitor;
/*-------------------*/
class NVMeofGwMap
decode(fsm_timers, bl);
DECODE_FINISH(bl);
}
+
+ void get_health_checks(health_check_map_t *checks) const;
};
#include "NVMeofGwSerialize.h"
<< HAVE_FEATURE(mon.get_quorum_con_features(), NVMEOFHA) << dendl;
put_version(t, pending_map.epoch, bl);
put_last_committed(t, pending_map.epoch);
+
+ //health
+ health_check_map_t checks;
+ pending_map.get_health_checks(&checks);
+ encode_health(checks, t);
}
void NVMeofGwMon::update_from_paxos(bool *need_bootstrap)
bufferlist bl;
int err = get_version(version, bl);
ceph_assert(err == 0);
+ load_health();
auto p = bl.cbegin();
map.decode(p);