MOSDPGLog *m = new MOSDPGLog(osdmap->get_epoch(), pg->info);
m->missing = pg->missing;
+ // primary -> other, when building master log
if (it->second.type == PG::Query::LOG) {
- dout(10) << *pg << " sending info+missing+log since split " << it->second.split
- << " from floor " << it->second.floor
+ dout(10) << *pg << " sending info+missing+log since " << it->second.floor
<< dendl;
+ /*
if (!m->log.copy_after_unless_divergent(pg->log, it->second.split, it->second.floor)) {
dout(10) << *pg << " divergent, sending backlog" << dendl;
it->second.type = PG::Query::BACKLOG;
}
+ */
+ m->log.copy_after(pg->log, it->second.floor);
}
if (it->second.type == PG::Query::BACKLOG) {
void PG::Log::copy_after(const Log &other, eversion_t v)
{
assert(v >= other.bottom);
- top = bottom = other.top;
+ top = other.top;
+ bottom = other.bottom;
for (list<Entry>::const_reverse_iterator i = other.log.rbegin();
i != other.log.rend();
i++) {
- if (i->version == v) break;
+ if (i->version <= v) {
+ bottom = i->version;
+ break;
+ }
assert(i->version > v);
log.push_front(*i);
}
- bottom = v;
}
bool PG::Log::copy_after_unless_divergent(const Log &other, eversion_t split, eversion_t floor)
<< " v " << newest_update
<< ", querying since " << since
<< dendl;
- query_map[newest_update_osd][info.pgid] = Query(Query::LOG, log.top, since, info.history);
+ query_map[newest_update_osd][info.pgid] = Query(Query::LOG, since, info.history);
+ //Query(Query::LOG, log.top, since, info.history);
peer_log_requested.insert(newest_update_osd);
}
} else {
const static int LOG = 1;
const static int BACKLOG = 2;
const static int FULLLOG = 3;
+ const static int LOGFROM = 4;
__s32 type;
- eversion_t split, floor;
+ //eversion_t split;
+ eversion_t floor;
Info::History history;
Query() : type(-1) {}
Query(int t, Info::History& h) :
type(t), history(h) { assert(t != LOG); }
- Query(int t, eversion_t s, eversion_t f, Info::History& h) :
- type(t), split(s), floor(f), history(h) { assert(t == LOG); }
+ Query(int t, eversion_t f, Info::History& h) :
+ type(t),
+ //split(s),
+ floor(f), history(h) { assert(t == LOG); }
void encode(bufferlist &bl) const {
::encode(type, bl);
- ::encode(split, bl);
+ //::encode(split, bl);
::encode(floor, bl);
history.encode(bl);
}
void decode(bufferlist::iterator &bl) {
::decode(type, bl);
- ::decode(split, bl);
+ //::decode(split, bl);
::decode(floor, bl);
history.decode(bl);
}