mirror of
https://github.com/ceph/ceph
synced 2025-01-18 00:43:38 +00:00
osd: fix PG::Log::copy_after wrt backlogs (again)
Commit 68fe748fc2
fixed half of this problem,
but set this->tail incorrectly. If we read olog.tail, the entry we are
on is a backlog entry, and probably not other.tail. Do not reset tail in
this case because we already set it to other.tail above.
OTOH if we hit v, we do want to set this->tail to the current record as it
is the one that precedes the first log entry.
This fixes an incorrect log.tail send to other nodes, which eventually
propagates as a log bound mismatch. For example,
2011-10-22 17:33:18.654693 7f8a2fefe700 osd.4 2788 pg[1.1f( v 1627'28 (1627'28,1627'28] n=2 ec=1 les/c 2763/2782 2788/2788/2788) [4,0] r=0 mlcod 0'0 !hml peering] merge_log log(578'5,1627'28] from osd.0 into log(1627'28,1627'28]
2011-10-22 17:33:18.654706 7f8a2fefe700 osd.4 2788 pg[1.1f( v 1627'28 (1627'28,1627'28] n=2 ec=1 les/c 2763/2782 2788/2788/2788) [4,0] r=0 mlcod 0'0 !hml peering] merge_log extending tail to 578'5
2011-10-22 17:33:18.654720 7f8a2fefe700 osd.4 2788 pg[1.1f( v 1627'28 (578'5,1627'28] n=2 ec=1 les/c 2763/2782 2788/2788/2788) [4,0] r=0 (log bound mismatch, empty) mlcod 0'0 !hml peering] merge_log result log(578'5,1627'28] missing(0) changed=1
This might fix #1526.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
This commit is contained in:
parent
1b846f43f1
commit
9323f25a6a
@ -54,7 +54,12 @@ void PG::Log::copy_after(const Log &other, eversion_t v)
|
||||
for (list<Entry>::const_reverse_iterator i = other.log.rbegin();
|
||||
i != other.log.rend();
|
||||
i++) {
|
||||
if (i->version <= v || i->version <= other.tail) {
|
||||
// stop if we reach the tail; do not copy backlog entries and keep
|
||||
// tail == other.tail.
|
||||
if (i->version <= other.tail)
|
||||
break;
|
||||
if (i->version <= v) {
|
||||
// make tail accurate.
|
||||
tail = i->version;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user