summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-10-03 22:00:46 -0700
committerSamuel Just <sam.just@inktank.com>2013-10-03 22:00:46 -0700
commiteba52dd51d52b6d8ab32726fe31fb13db5770a6a (patch)
tree6988a639825e35d9462d727d1d281abc40e2d1df
parenta6744540a9a3bc4e8d9098c3d8aa013746bcb144 (diff)
downloadceph-eba52dd51d52b6d8ab32726fe31fb13db5770a6a.tar.gz
ReplicatedPG: remove the other backfill related flushes
Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/osd/ReplicatedPG.cc34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index a35c5876454..1684fa0dc53 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -1537,11 +1537,8 @@ void ReplicatedPG::do_scan(
}
BackfillInterval bi;
- osr->flush();
bi.begin = m->begin;
- scan_range(
- cct->_conf->osd_backfill_scan_min,
- cct->_conf->osd_backfill_scan_max, &bi, handle);
+ update_range(&bi, handle);
MOSDPGScan *reply = new MOSDPGScan(MOSDPGScan::OP_SCAN_DIGEST,
get_osdmap()->get_epoch(), m->query_epoch,
info.pgid, bi.begin, bi.end);
@@ -7990,9 +7987,6 @@ int ReplicatedPG::recover_backfill(
<< " interval " << pbi.begin << "-" << pbi.end
<< " " << pbi.objects.size() << " objects" << dendl;
- int local_min = osd->store->get_ideal_list_min();
- int local_max = osd->store->get_ideal_list_max();
-
// update our local interval to cope with recent changes
backfill_info.begin = backfill_pos;
update_range(&backfill_info, handle);
@@ -8008,10 +8002,10 @@ int ReplicatedPG::recover_backfill(
while (ops < max) {
if (backfill_info.begin <= pbi.begin &&
!backfill_info.extends_to_end() && backfill_info.empty()) {
- osr->flush();
- backfill_info.begin = backfill_info.end;
- scan_range(local_min, local_max, &backfill_info,
- handle);
+ hobject_t next = backfill_info.end;
+ backfill_info.clear();
+ backfill_info.begin = next;
+ update_range(&backfill_info, handle);
backfill_info.trim();
}
backfill_pos = backfill_info.begin > pbi.begin ? pbi.begin : backfill_info.begin;
@@ -8186,8 +8180,15 @@ void ReplicatedPG::update_range(
BackfillInterval *bi,
ThreadPool::TPHandle &handle)
{
- int local_min = osd->store->get_ideal_list_min();
- int local_max = osd->store->get_ideal_list_max();
+ int local_min = cct->_conf->osd_backfill_scan_min;
+ int local_max = cct->_conf->osd_backfill_scan_max;
+
+ if (bi->version < info.log_tail) {
+ dout(10) << __func__<< ": bi is old, rescanning local backfill_info"
+ << dendl;
+ scan_range(local_min, local_max, &backfill_info, handle);
+ }
+
if (bi->version >= info.last_update) {
dout(10) << __func__<< ": bi is current " << dendl;
assert(bi->version == info.last_update);
@@ -8227,10 +8228,7 @@ void ReplicatedPG::update_range(
}
bi->version = info.last_update;
} else {
- dout(10) << __func__<< ": bi is old, rescanning local backfill_info"
- << dendl;
- osr->flush();
- scan_range(local_min, local_max, &backfill_info, handle);
+ assert(0 == "scan_range should have raised bi->version past log_tail");
}
}
@@ -8240,7 +8238,7 @@ void ReplicatedPG::scan_range(
{
assert(is_locked());
dout(10) << "scan_range from " << bi->begin << dendl;
- bi->version = info.last_update;
+ bi->version = last_update_applied;
bi->objects.clear(); // for good measure
vector<hobject_t> ls;