OPTION(osd_map_share_max_epochs, OPT_INT, 100) // cap on # of inc maps we send to peers, clients
OPTION(osd_inject_bad_map_crc_probability, OPT_FLOAT, 0)
OPTION(osd_inject_failure_on_pg_removal, OPT_BOOL, false)
+// shutdown the OSD if stuatus flipping more than max_markdown_count times in recent max_markdown_period seconds
+OPTION(osd_max_markdown_period , OPT_INT, 600)
+OPTION(osd_max_markdown_count, OPT_INT, 5)
+
OPTION(osd_op_threads, OPT_INT, 2) // 0 == no threading
OPTION(osd_peering_wq_batch_size, OPT_U64, 20)
OPTION(osd_op_pq_max_tokens_per_priority, OPT_U64, 4194304)
service.set_epochs(NULL,&up_epoch, &bind_epoch);
do_restart = true;
+ //add markdown log
+ utime_t now = ceph_clock_now(g_ceph_context);
+ utime_t grace = utime_t(g_conf->osd_max_markdown_period, 0);
+ osd_markdown_log.push_back(now);
+ //clear all out-of-date log
+ while (!osd_markdown_log.empty() && osd_markdown_log.front() + grace < now)
+ osd_markdown_log.pop_front();
+ if ((int)osd_markdown_log.size() > g_conf->osd_max_markdown_count) {
+ do_restart = false;
+ do_shutdown = true;
+ }
+
start_waiting_for_healthy();
set<int> avoid_ports;
utime_t had_map_since;
RWLock map_lock;
list<OpRequestRef> waiting_for_osdmap;
+ deque<utime_t> osd_markdown_log;
friend struct send_map_on_destruct;