]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/PG: introduce all_missing_unfound helper
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 26 Mar 2019 12:04:15 +0000 (20:04 +0800)
committerPrashant D <pdhange@redhat.com>
Mon, 29 Apr 2019 23:22:58 +0000 (19:22 -0400)
commit2fad7d77721c91a32697c958f65cbbbe75766dbc
tree8dc274120df987800eace4a3877338909238ad72
parent1436006594665279fe734b4c15d7e08c13ebd777
osd/PG: introduce all_missing_unfound helper

We use pg_log.missing to track each peer's missing objects separately,
whereas missing_loc records the location of all (probably existing) good copies
for both primary and replicas' missing objects. Hence an item from
pg_log.missing or missing_loc is of different meaning and is not comparable.

During recovery, we can skip recovering primary only if
- primary is good, e.g., has no missing at all
- or all of the primary's missing objects do exist in missing_loc and are
  currently unfound

Obviously, the current "all missing objects are unfound" checker is broken.
Fix by introducing an independent all_missing_unfound helper to make the
count of missing objects that are currently unfound correct.

Fixes: http://tracker.ceph.com/issues/38784
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit d9497139a6f516ce015bb43a2e7f8958638cf8f8)
src/osd/PG.h
src/osd/PrimaryLogPG.cc