If you call copy_after(..., 0) on a log with a backlog, you get all the
backlog entries, but no backlog flag. That's invalid. You either need
the _complete_ backlog + the flag, or no backlog entries; getting only
some of them is useless information.
Make copy_after stop when it hits the tail. Callers who need the backlog
are already checking for that and copying the whole log as appropriate.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
for (list<Entry>::const_reverse_iterator i = other.log.rbegin();
i != other.log.rend();
i++) {
- if (i->version <= v) {
+ if (i->version <= v || i->version <= other.tail) {
tail = i->version;
break;
}
} else
mlog->log.copy_after(log, query.since);
}
-
- if (query.type == PG::Query::BACKLOG) {
+ else if (query.type == PG::Query::BACKLOG) {
dout(10) << "sending info+missing+backlog" << dendl;
assert(log.backlog);
mlog->log = log;