OPTION(osd_rollback_to_cluster_snap, OPT_STR, "")
OPTION(osd_default_notify_timeout, OPT_U32, 30) // default notify timeout in seconds
OPTION(osd_kill_backfill_at, OPT_INT, 0)
-OPTION(osd_min_pg_log_entries, OPT_U32, 1000) // number of entries to keep in the pg log when trimming it
+OPTION(osd_min_pg_log_entries, OPT_U32, 1000) // number of entries to keep in the pg log when trimming it
+OPTION(osd_max_pg_log_entries, OPT_U32, 10000) // max entries, say when degraded, before we trim
OPTION(osd_op_complaint_time, OPT_FLOAT, 30) // how many seconds old makes an op complaint-worthy
OPTION(osd_command_max_records, OPT_INT, 256)
OPTION(osd_op_log_threshold, OPT_INT, 5) // how many op log messages to show in one go
void ReplicatedPG::calc_trim_to()
{
- if (is_degraded() || !is_clean()) {
- dout(10) << "calc_trim_to no trim while degraded or not clean" << dendl;
+ if (state_test(PG_STATE_RECOVERING |
+ PG_STATE_RECOVERY_WAIT |
+ PG_STATE_BACKFILL |
+ PG_STATE_BACKFILL_WAIT |
+ PG_STATE_BACKFILL_TOOFULL)) {
+ dout(10) << "calc_trim_to no trim during recovery" << dendl;
pg_trim_to = eversion_t();
return;
}
}
size_t target = g_conf->osd_min_pg_log_entries;
+ if (is_degraded())
+ target = g_conf->osd_max_pg_log_entries;
+
if (min_last_complete_ondisk != eversion_t() &&
min_last_complete_ondisk != pg_trim_to &&
log.approx_size() > target) {