Skip to content

Commit

Permalink
Merge pull request #49412 from kamoltat/wip-ksirivad-revert-47340
Browse files Browse the repository at this point in the history
  • Loading branch information
ljflores committed Dec 14, 2022
2 parents 9d14d28 + 0c7e59d commit 48e909c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 163 deletions.
149 changes: 0 additions & 149 deletions qa/standalone/mon/mon-stretched-cluster.sh

This file was deleted.

8 changes: 1 addition & 7 deletions src/mon/Monitor.cc
Expand Up @@ -6582,7 +6582,6 @@ void Monitor::notify_new_monmap(bool can_change_external_state)

if (is_stretch_mode()) {
if (!monmap->stretch_marked_down_mons.empty()) {
dout(20) << __func__ << " stretch_marked_down_mons: " << monmap->stretch_marked_down_mons << dendl;
set_degraded_stretch_mode();
}
}
Expand Down Expand Up @@ -6688,14 +6687,10 @@ struct CMonGoRecovery : public Context {
void Monitor::go_recovery_stretch_mode()
{
dout(20) << __func__ << dendl;
dout(20) << "is_leader(): " << is_leader() << dendl;
if (!is_leader()) return;
dout(20) << "is_degraded_stretch_mode(): " << is_degraded_stretch_mode() << dendl;
if (!is_degraded_stretch_mode()) return;
dout(20) << "is_recovering_stretch_mode(): " << is_recovering_stretch_mode() << dendl;
if (is_recovering_stretch_mode()) return;
dout(20) << "dead_mon_buckets.size(): " << dead_mon_buckets.size() << dendl;
dout(20) << "dead_mon_buckets: " << dead_mon_buckets << dendl;

if (dead_mon_buckets.size()) {
ceph_assert( 0 == "how did we try and do stretch recovery while we have dead monitor buckets?");
// we can't recover if we are missing monitors in a zone!
Expand Down Expand Up @@ -6776,7 +6771,6 @@ void Monitor::trigger_degraded_stretch_mode(const set<string>& dead_mons,

void Monitor::set_degraded_stretch_mode()
{
dout(20) << __func__ << dendl;
degraded_stretch_mode = true;
recovering_stretch_mode = false;
osdmon()->set_degraded_stretch_mode();
Expand Down
8 changes: 1 addition & 7 deletions src/mon/OSDMonitor.cc
Expand Up @@ -954,18 +954,12 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
dout(20) << "Degraded stretch mode set in this map" << dendl;
if (!osdmap.recovering_stretch_mode) {
mon.set_degraded_stretch_mode();
dout(20) << "prev_num_up_osd: " << prev_num_up_osd << dendl;
dout(20) << "osdmap.num_up_osd: " << osdmap.num_up_osd << dendl;
dout(20) << "osdmap.num_osd: " << osdmap.num_osd << dendl;
dout(20) << "mon_stretch_cluster_recovery_ratio: " << cct->_conf.get_val<double>("mon_stretch_cluster_recovery_ratio") << dendl;
if (prev_num_up_osd < osdmap.num_up_osd &&
(osdmap.num_up_osd / (double)osdmap.num_osd) >
cct->_conf.get_val<double>("mon_stretch_cluster_recovery_ratio") &&
mon.dead_mon_buckets.size() == 0) {
cct->_conf.get_val<double>("mon_stretch_cluster_recovery_ratio")) {
// TODO: This works for 2-site clusters when the OSD maps are appropriately
// trimmed and everything is "normal" but not if you have a lot of out OSDs
// you're ignoring or in some really degenerate failure cases

dout(10) << "Enabling recovery stretch mode in this map" << dendl;
mon.go_recovery_stretch_mode();
}
Expand Down

0 comments on commit 48e909c

Please sign in to comment.