ScrubMap::object& auth_object = auth->second->objects[*k];
set<pg_shard_t> cur_missing;
set<pg_shard_t> cur_inconsistent;
+ bool clean = true;
for (j = maps.begin(); j != maps.end(); ++j) {
if (j == auth)
continue;
j->second->objects[*k],
ss);
if (error != CLEAN) {
+ clean = false;
cur_inconsistent.insert(j->first);
if (error == SHALLOW_ERROR)
++shallow_errors;
auth_list.push_back(j->first);
}
} else {
+ clean = false;
cur_missing.insert(j->first);
++shallow_errors;
errorstream << __func__ << ": " << pgid << " shard " << j->first
if (!cur_inconsistent.empty() || !cur_missing.empty()) {
authoritative[*k] = auth_list;
}
- if (okseed &&
+ if (clean &&
+ okseed &&
parent->get_pool().is_replicated() &&
auth_object.digest_present && auth_object.omap_digest_present &&
(!auth_oi.is_data_digest() || !auth_oi.is_omap_digest() ||
++scrubber.shallow_errors;
}
- if (scrubber.shallow_errors == 0) {
- for (map<hobject_t,pair<uint32_t,uint32_t> >::const_iterator p =
- missing_digest.begin();
- p != missing_digest.end();
- ++p) {
- if (p->first.is_snapdir())
- continue;
- dout(10) << __func__ << " recording digests for " << p->first << dendl;
- ObjectContextRef obc = get_object_context(p->first, false);
- assert(obc);
- RepGather *repop = simple_repop_create(obc);
- OpContext *ctx = repop->ctx;
- ctx->at_version = get_next_version();
- ctx->mtime = utime_t(); // do not update mtime
- ctx->new_obs.oi.set_data_digest(p->second.first);
- ctx->new_obs.oi.set_omap_digest(p->second.second);
- finish_ctx(ctx, pg_log_entry_t::MODIFY, true, true);
- ctx->on_finish = new C_ScrubDigestUpdated(this);
- simple_repop_submit(repop);
- ++scrubber.num_digest_updates_pending;
- }
+ for (map<hobject_t,pair<uint32_t,uint32_t> >::const_iterator p =
+ missing_digest.begin();
+ p != missing_digest.end();
+ ++p) {
+ if (p->first.is_snapdir())
+ continue;
+ dout(10) << __func__ << " recording digests for " << p->first << dendl;
+ ObjectContextRef obc = get_object_context(p->first, false);
+ assert(obc);
+ RepGather *repop = simple_repop_create(obc);
+ OpContext *ctx = repop->ctx;
+ ctx->at_version = get_next_version();
+ ctx->mtime = utime_t(); // do not update mtime
+ ctx->new_obs.oi.set_data_digest(p->second.first);
+ ctx->new_obs.oi.set_omap_digest(p->second.second);
+ finish_ctx(ctx, pg_log_entry_t::MODIFY, true, true);
+ ctx->on_finish = new C_ScrubDigestUpdated(this);
+ simple_repop_submit(repop);
+ ++scrubber.num_digest_updates_pending;
}
dout(10) << "_scrub (" << mode << ") finish" << dendl;