return snapset && curclone != snapset.get().clones.rend();
}
-void ReplicatedPG::log_missing(const boost::optional<hobject_t> &head,
+void ReplicatedPG::log_missing(unsigned missing,
+ const boost::optional<hobject_t> &head,
LogChannelRef clog,
const spg_t &pgid,
const char *func,
assert(head);
if (allow_incomplete_clones) {
dout(20) << func << " " << mode << " " << pgid << " " << head.get()
- << " skipped some clones in cache tier" << dendl;
+ << " skipped " << missing << " clone(s) in cache tier" << dendl;
} else {
clog->info() << mode << " " << pgid << " " << head.get()
- << " missing clones";
+ << " " << missing << " missing clone(s)";
}
}
-void ReplicatedPG::process_clones_to(const boost::optional<hobject_t> &head,
+unsigned ReplicatedPG::process_clones_to(const boost::optional<hobject_t> &head,
const boost::optional<SnapSet> &snapset,
LogChannelRef clog,
const spg_t &pgid,
const char *mode,
- bool &missing,
bool allow_incomplete_clones,
snapid_t target,
vector<snapid_t>::reverse_iterator *curclone)
{
assert(head);
assert(snapset);
+ unsigned missing = 0;
// NOTE: clones are in descending order, thus **curclone > target test here
hobject_t next_clone(head.get());
while(doing_clones(snapset, *curclone) && **curclone > target) {
- missing = true;
+ ++missing;
// it is okay to be missing one or more clones in a cache tier.
// skip higher-numbered clones in the list.
if (!allow_incomplete_clones) {
// Clones are descending
++(*curclone);
}
+ return missing;
}
/*
// Log any clones we were expecting to be there up to target
// This will set missing, but will be a no-op if snap.soid == *curclone.
- process_clones_to(head, snapset, osd->clog, info.pgid, mode,
- missing, pool.info.allow_incomplete_clones(), target, &curclone);
+ missing += process_clones_to(head, snapset, osd->clog, info.pgid, mode,
+ pool.info.allow_incomplete_clones(), target, &curclone);
}
bool expected;
// Check doing_clones() again in case we ran process_clones_to()
if (soid.has_snapset()) {
if (missing) {
- log_missing(head, osd->clog, info.pgid, __func__, mode,
+ log_missing(missing, head, osd->clog, info.pgid, __func__, mode,
pool.info.allow_incomplete_clones());
}
dout(10) << __func__ << " " << mode << " " << info.pgid
<< " No more objects while processing " << head.get() << dendl;
- process_clones_to(head, snapset, osd->clog, info.pgid, mode,
- missing, pool.info.allow_incomplete_clones(), all_clones, &curclone);
+ missing += process_clones_to(head, snapset, osd->clog, info.pgid, mode,
+ pool.info.allow_incomplete_clones(), all_clones, &curclone);
}
// There could be missing found by the test above or even
// before dropping out of the loop for the last head.
if (missing) {
- log_missing(head, osd->clog, info.pgid, __func__,
+ log_missing(missing, head, osd->clog, info.pgid, __func__,
mode, pool.info.allow_incomplete_clones());
}
hobject_t generate_temp_object(); ///< generate a new temp object name
/// generate a new temp object name (for recovery)
hobject_t get_temp_recovery_object(eversion_t version, snapid_t snap);
- void log_missing(const boost::optional<hobject_t> &head,
+ void log_missing(unsigned missing,
+ const boost::optional<hobject_t> &head,
LogChannelRef clog,
const spg_t &pgid,
const char *func,
const char *mode,
bool allow_incomplete_clones);
- void process_clones_to(const boost::optional<hobject_t> &head,
+ unsigned process_clones_to(const boost::optional<hobject_t> &head,
const boost::optional<SnapSet> &snapset,
LogChannelRef clog,
const spg_t &pgid,
const char *mode,
- bool &missing,
bool allow_incomplete_clones,
snapid_t target,
vector<snapid_t>::reverse_iterator *curclone);
err_strings[3]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/666934a3/obj5/4 on disk size [(]4608[)] does not match object info size [(]512[)] adjusted for ondisk to [(]512[)]"
err_strings[4]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/666934a3/obj5/head expected clone 1/666934a3/obj5/2"
err_strings[5]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/666934a3/obj5/head expected clone 1/666934a3/obj5/1"
-err_strings[6]="log_channel[(]cluster[)] log [[]INF[]] : scrub 1.0 1/666934a3/obj5/head missing clones"
+err_strings[6]="log_channel[(]cluster[)] log [[]INF[]] : scrub 1.0 1/666934a3/obj5/head 1 missing clone[(]s[)]"
err_strings[7]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/d3a9faf5/obj12/head snapset.head_exists=false, but head exists"
err_strings[8]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/8df7eaa5/obj8/head snaps.seq not set"
err_strings[9]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/5c889059/obj7/head snapset.head_exists=false, but head exists"
err_strings[14]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/3f1ee208/obj2/7 is an unexpected clone"
err_strings[15]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/3f1ee208/obj2/4 is an unexpected clone"
err_strings[16]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/a8759770/obj4/snapdir expected clone 1/a8759770/obj4/7"
-err_strings[17]="log_channel[(]cluster[)] log [[]INF[]] : scrub 1.0 1/a8759770/obj4/snapdir missing clones"
+err_strings[17]="log_channel[(]cluster[)] log [[]INF[]] : scrub 1.0 1/a8759770/obj4/snapdir 1 missing clone[(]s[)]"
err_strings[18]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/6cf8deff/obj1/1 is an unexpected clone"
err_strings[19]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/e478ac7f/obj9/1 is missing in clone_size"
err_strings[20]="log_channel[(]cluster[)] log [[]ERR[]] : scrub 1.0 1/29547577/obj11/1 is an unexpected clone"