Skip to content

Commit

Permalink
osd: pglog: with config, don't assert in the presence of stale diverg…
Browse files Browse the repository at this point in the history
…ent_priors

Fixes: http://tracker.ceph.com/issues/17916

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
  • Loading branch information
gregsfortytwo committed Apr 20, 2017
1 parent 432bc8b commit 220e6bb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/common/config_opts.h
Expand Up @@ -272,6 +272,7 @@ OPTION(mon_osd_allow_primary_affinity, OPT_BOOL, false) // allow primary_affini
OPTION(mon_osd_prime_pg_temp, OPT_BOOL, true) // prime osdmap with pg mapping changes
OPTION(mon_osd_prime_pg_temp_max_time, OPT_FLOAT, .5) // max time to spend priming
OPTION(mon_osd_pool_ec_fast_read, OPT_BOOL, false) // whether turn on fast read on the pool or not
OPTION(osd_ignore_stale_divergent_priors, OPT_BOOL, false) // do not assert on divergent_prior entries which aren't in the log and whose on-disk objects are newer
OPTION(mon_stat_smooth_intervals, OPT_INT, 2) // smooth stats over last N PGMap maps
OPTION(mon_election_timeout, OPT_FLOAT, 5) // on election proposer, max waiting time for all ACKs
OPTION(mon_lease, OPT_FLOAT, 5) // lease interval
Expand Down
1 change: 1 addition & 0 deletions src/osd/PG.cc
Expand Up @@ -3251,6 +3251,7 @@ void PG::read_state(ObjectStore *store, bufferlist &bl)
ghobject_t(info_struct_v < 8 ? OSD::make_pg_log_oid(pg_id) : pgmeta_oid),
info,
oss,
cct->_conf->osd_ignore_stale_divergent_priors,
cct->_conf->osd_debug_verify_missing_on_start);
if (oss.tellp())
osd->clog->error() << oss.rdbuf();
Expand Down
16 changes: 15 additions & 1 deletion src/osd/PGLog.h
Expand Up @@ -1114,6 +1114,7 @@ struct PGLog : DoutPrefixProvider {
const pg_info_t &info,
IndexedLog &log,
missing_type &missing, ostringstream &oss,
bool tolerate_divergent_missing_log,
bool *clear_divergent_priors = NULL,
const DoutPrefixProvider *dpp = NULL,
set<string> *log_keys_debug = 0,
Expand Down Expand Up @@ -1289,7 +1290,20 @@ struct PGLog : DoutPrefixProvider {
* version would not have been recovered, and a newer version
* would show up in the log above.
*/
assert(oi.version == i->first);
/**
* Unfortunately the assessment above is incorrect because of
* http://tracker.ceph.com/issues/17916 (we were incorrectly
* not removing the divergent_priors set from disk state!),
* so let's check that.
*/
if (oi.version > i->first && tolerate_divergent_missing_log) {
ldpp_dout(dpp, 0) << "read_log divergent_priors entry (" << *i
<< ") inconsistent with disk state (" << oi
<< "), assuming it is tracker.ceph.com/issues/17916"
<< dendl;
} else {
assert(oi.version == i->first);
}
} else {
ldpp_dout(dpp, 15) << "read_log_and_missing missing " << *i << dendl;
missing.add(i->second, i->first, eversion_t());
Expand Down
3 changes: 2 additions & 1 deletion src/tools/ceph_objectstore_tool.cc
Expand Up @@ -329,7 +329,8 @@ int get_log(ObjectStore *fs, __u8 struct_ver,
PGLog::read_log_and_missing(fs, coll,
struct_ver >= 8 ? coll : coll_t::meta(),
struct_ver >= 8 ? pgid.make_pgmeta_oid() : log_oid,
info, log, missing, oss);
info, log, missing, oss,
g_ceph_context->_conf->osd_ignore_stale_divergent_priors);
if (debug && oss.str().size())
cerr << oss.str() << std::endl;
}
Expand Down

0 comments on commit 220e6bb

Please sign in to comment.