I'm hitting a case where the primary is compensating for a replica's
last_complete < log.tail by sending a log+backlog, but the replica
isn't smart enough to take advantage. In this case,
replica: log(781'26629,781'26631]
from primary: log(781'26629,781'26631]+backlog
result: log(781'26629,781'26631]
Doh!
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
bool changed = false;
if (log.empty() ||
- (olog.tail > log.head && olog.backlog)) { // e.g. log=(0,20] olog=(40,50]+backlog)
+ (olog.tail > log.head && olog.backlog) || // e.g. log=(0,20] olog=(40,50]+backlog)
+ (log.head <= olog.head &&
+ log.tail >= olog.tail &&
+ !log.backlog && olog.backlog)) { // olog is clearly superior in every way
if (is_primary()) {
// we should have our own backlog already; see peer() code where