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

PGLog: store extra duplicate ops beyond the normal log entries #16172

Merged
merged 2 commits into from
Jul 27, 2017
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/common/legacy_config_opts.h
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,7 @@ OPTION(osd_pg_epoch_persisted_max_stale, OPT_U32) // make this < map_cache_size!

OPTION(osd_min_pg_log_entries, OPT_U32) // number of entries to keep in the pg log when trimming it
OPTION(osd_max_pg_log_entries, OPT_U32) // max entries, say when degraded, before we trim
OPTION(osd_pg_log_dups_tracked, OPT_U32) // how many versions back to track combined in both pglog's regular + dup logs
OPTION(osd_force_recovery_pg_log_entries_factor, OPT_FLOAT) // max entries factor before force recovery
OPTION(osd_pg_log_trim_min, OPT_U32)
OPTION(osd_op_complaint_time, OPT_FLOAT) // how many seconds old makes an op complaint-worthy
Expand Down
19 changes: 16 additions & 3 deletions src/common/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2248,12 +2248,25 @@ std::vector<Option> global_options = {
.set_description(""),

Option("osd_min_pg_log_entries", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(3000)
.set_description(""),
.set_default(1500)
.set_description("minimum number of entries to maintain in the PG log")
.add_service("osd")
.add_see_also("osd_max_pg_log_entries")
.add_see_also("osd_pg_log_dups_tracked"),

Option("osd_max_pg_log_entries", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(10000)
.set_description(""),
.set_description("maximum number of entries to maintain in the PG log when degraded before we trim")
.add_service("osd")
.add_see_also("osd_min_pg_log_entries")
.add_see_also("osd_pg_log_dups_tracked"),

Option("osd_pg_log_dups_tracked", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
.set_default(3000)
.set_description("how many versions back to track in order to detect duplicate ops; this is combined with both the regular pg log entries and additional minimal dup detection entries")
.add_service("osd")
.add_see_also("osd_min_pg_log_entries")
.add_see_also("osd_max_pg_log_entries"),

Option("osd_force_recovery_pg_log_entries_factor", Option::TYPE_FLOAT, Option::LEVEL_ADVANCED)
.set_default(1.3)
Expand Down
6 changes: 4 additions & 2 deletions src/osd/PG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ void PG::dump_live_ids()
}
#endif


void PGPool::update(OSDMapRef map)
{
const pg_pool_t *pi = map->get_pg_pool(id);
Expand Down Expand Up @@ -296,7 +297,8 @@ PG::PG(OSDService *o, OSDMapRef curmap,
dirty_info(false), dirty_big_info(false),
info(p),
info_struct_v(0),
coll(p), pg_log(cct),
coll(p),
pg_log(cct),
pgmeta_oid(p.make_pgmeta_oid()),
missing_loc(this),
past_intervals(
Expand Down Expand Up @@ -3186,7 +3188,7 @@ void PG::append_log(
auto last = logv.rbegin();
if (is_primary() && last != logv.rend()) {
projected_log.skip_can_rollback_to_to_head();
projected_log.trim(cct, last->version, nullptr);
projected_log.trim(cct, last->version, nullptr, nullptr, nullptr);
}

if (transaction_applied && roll_forward_to > pg_log.get_can_rollback_to()) {
Expand Down
Loading