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

osd/PG: revert approx size #18755

Merged
merged 3 commits into from Jan 15, 2018
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
7 changes: 3 additions & 4 deletions src/osd/PrimaryLogPG.cc
Expand Up @@ -711,7 +711,7 @@ void PrimaryLogPG::maybe_force_recovery()
PG_STATE_BACKFILL_TOOFULL))
return;

if (pg_log.get_log().log.size() <
if (pg_log.get_log().approx_size() <
cct->_conf->osd_max_pg_log_entries *
cct->_conf->osd_force_recovery_pg_log_entries_factor)
return;
Expand Down Expand Up @@ -1547,11 +1547,10 @@ void PrimaryLogPG::calc_trim_to()
eversion_t limit = MIN(
min_last_complete_ondisk,
pg_log.get_can_rollback_to());
size_t log_size = pg_log.get_log().log.size();
if (limit != eversion_t() &&
limit != pg_trim_to &&
log_size > target) {
size_t num_to_trim = log_size - target;
pg_log.get_log().approx_size() > target) {
size_t num_to_trim = pg_log.get_log().approx_size() - target;
if (num_to_trim < cct->_conf->osd_pg_log_trim_min) {
return;
}
Expand Down
4 changes: 4 additions & 0 deletions src/osd/osd_types.h
Expand Up @@ -3597,6 +3597,10 @@ struct pg_log_t {
return head.version == 0 && head.epoch == 0;
}

size_t approx_size() const {
return head.version - tail.version;
}

static void filter_log(spg_t import_pgid, const OSDMap &curmap,
const string &hit_set_namespace, const pg_log_t &in,
pg_log_t &out, pg_log_t &reject);
Expand Down