Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pacific: Revert mon/OSDMonitor: Added extra check before mon.go_recovery_stretch_mode() #49412

Merged
merged 2 commits into from Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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