diff options
author | Samuel Just <sam.just@inktank.com> | 2013-09-09 15:48:50 -0700 |
---|---|---|
committer | Samuel Just <sam.just@inktank.com> | 2013-09-19 20:04:18 -0700 |
commit | c6720ea88966852d00657a2797b7a83da811658f (patch) | |
tree | 9677365268734a23258f7a34daf4a93e10c534e1 | |
parent | 6de858f220f04eb4f91f352cf0ad86a88545a672 (diff) | |
download | ceph-c6720ea88966852d00657a2797b7a83da811658f.tar.gz |
ReplicatedPG/Backend: fix up recalc_subsets
Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r-- | src/osd/ReplicatedBackend.h | 4 | ||||
-rw-r--r-- | src/osd/ReplicatedPG.cc | 33 | ||||
-rw-r--r-- | src/osd/ReplicatedPG.h | 14 |
3 files changed, 16 insertions, 35 deletions
diff --git a/src/osd/ReplicatedBackend.h b/src/osd/ReplicatedBackend.h index ae33b3f5588..af8b3e291b6 100644 --- a/src/osd/ReplicatedBackend.h +++ b/src/osd/ReplicatedBackend.h @@ -300,6 +300,10 @@ private: const hobject_t &last_backfill, interval_set<uint64_t>& data_subset, map<hobject_t, interval_set<uint64_t> >& clone_subsets); + ObjectRecoveryInfo recalc_subsets( + const ObjectRecoveryInfo& recovery_info, + SnapSetContext *ssc + ); }; #endif diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index a92a5879894..9b5ea6d2cfd 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -6279,27 +6279,19 @@ void ReplicatedBackend::submit_push_complete(ObjectRecoveryInfo &recovery_info, } } -ObjectRecoveryInfo ReplicatedPG::recalc_subsets(const ObjectRecoveryInfo& recovery_info) +ObjectRecoveryInfo ReplicatedBackend::recalc_subsets( + const ObjectRecoveryInfo& recovery_info, + SnapSetContext *ssc) { if (!recovery_info.soid.snap || recovery_info.soid.snap >= CEPH_NOSNAP) return recovery_info; - - SnapSetContext *ssc = get_snapset_context(recovery_info.soid.oid, - recovery_info.soid.get_key(), - recovery_info.soid.hash, - false, - recovery_info.soid.get_namespace()); - assert(ssc); ObjectRecoveryInfo new_info = recovery_info; new_info.copy_subset.clear(); new_info.clone_subset.clear(); assert(ssc); -// TODOSAM: fix -#if 0 - calc_clone_subsets(ssc->snapset, new_info.soid, pg_log.get_missing(), info.last_backfill, + calc_clone_subsets(ssc->snapset, new_info.soid, get_parent()->get_local_missing(), + get_info().last_backfill, new_info.copy_subset, new_info.clone_subset); -#endif - put_snapset_context(ssc); return new_info; } @@ -6339,8 +6331,13 @@ bool ReplicatedBackend::handle_pull_response( pop.recovery_info.copy_subset); } - // TODOSAM: probably just kill this - //pi.recovery_info = recalc_subsets(pi.recovery_info); + bool first = pi.recovery_progress.first; + if (first) { + pi.obc = get_parent()->get_obc(pi.recovery_info.soid, pop.attrset); + pi.recovery_info.oi = pi.obc->obs.oi; + pi.recovery_info = recalc_subsets(pi.recovery_info, pi.obc->ssc); + } + interval_set<uint64_t> usable_intervals; bufferlist usable_data; @@ -6353,7 +6350,6 @@ bool ReplicatedBackend::handle_pull_response( data.claim(usable_data); - bool first = pi.recovery_progress.first; pi.recovery_progress = pop.after_progress; pi.stat.num_bytes_recovered += data.length(); @@ -6362,11 +6358,6 @@ bool ReplicatedBackend::handle_pull_response( << ", new progress " << pi.recovery_progress << dendl; - if (first) { - pi.obc = get_parent()->get_obc(pi.recovery_info.soid, pop.attrset); - pi.recovery_info.oi = pi.obc->obs.oi; - } - bool complete = pi.is_complete(); submit_push_data(pi.recovery_info, first, diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index d976337c265..8c5b4f9f046 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -503,20 +503,6 @@ protected: set<hobject_t> recovering; - ObjectRecoveryInfo recalc_subsets(const ObjectRecoveryInfo& recovery_info); - - void submit_push_data(ObjectRecoveryInfo &recovery_info, - bool first, - bool complete, - const interval_set<uint64_t> &intervals_included, - bufferlist data_included, - bufferlist omap_header, - map<string, bufferptr> &attrs, - map<string, bufferlist> &omap_entries, - ObjectStore::Transaction *t); - void submit_push_complete(ObjectRecoveryInfo &recovery_info, - ObjectStore::Transaction *t); - // Track contents of temp collection, clear on reset set<hobject_t> temp_contents; |