@@ -46,7 +46,7 @@ class RecoveryBackend {
4646 backend{backend} {}
4747 virtual ~RecoveryBackend () {}
4848 std::pair<WaitForObjectRecovery&, bool > add_recovering (const hobject_t & soid) {
49- auto [it, added] = recovering.emplace (soid, new WaitForObjectRecovery{} );
49+ auto [it, added] = recovering.emplace (soid, new WaitForObjectRecovery (pg) );
5050 assert (it->second );
5151 return {*(it->second ), added};
5252 }
@@ -95,8 +95,12 @@ class RecoveryBackend {
9595 std::int64_t min,
9696 std::int64_t max);
9797
98+ enum interrupt_cause_t : uint8_t {
99+ INTERVAL_CHANGE,
100+ MAX
101+ };
98102 void on_peering_interval_change (ceph::os::Transaction& t) {
99- clean_up (t, " new peering interval " );
103+ clean_up (t, interrupt_cause_t ::INTERVAL_CHANGE );
100104 }
101105
102106 seastar::future<> stop () {
@@ -141,11 +145,14 @@ class RecoveryBackend {
141145 public boost::intrusive_ref_counter<
142146 WaitForObjectRecovery, boost::thread_unsafe_counter>,
143147 public crimson::BlockerT<WaitForObjectRecovery> {
148+ crimson::osd::PG &pg;
144149 std::optional<seastar::shared_promise<>> readable, recovered, pulled;
145150 std::map<pg_shard_t , seastar::shared_promise<>> pushes;
146151 public:
147152 static constexpr const char * type_name = " WaitForObjectRecovery" ;
148153
154+ WaitForObjectRecovery (crimson::osd::PG &pg) : pg(pg) {}
155+
149156 crimson::osd::ObjectContextRef obc;
150157 std::optional<pull_info_t > pull_info;
151158 std::map<pg_shard_t , push_info_t > pushing;
@@ -221,28 +228,7 @@ class RecoveryBackend {
221228 pushes.erase (it);
222229 }
223230 }
224- void interrupt (std::string_view why) {
225- if (readable) {
226- readable->set_exception (std::system_error (
227- std::make_error_code (std::errc::interrupted), why.data ()));
228- readable.reset ();
229- }
230- if (recovered) {
231- recovered->set_exception (std::system_error (
232- std::make_error_code (std::errc::interrupted), why.data ()));
233- recovered.reset ();
234- }
235- if (pulled) {
236- pulled->set_exception (std::system_error (
237- std::make_error_code (std::errc::interrupted), why.data ()));
238- pulled.reset ();
239- }
240- for (auto & [pg_shard, pr] : pushes) {
241- pr.set_exception (std::system_error (
242- std::make_error_code (std::errc::interrupted), why.data ()));
243- }
244- pushes.clear ();
245- }
231+ void interrupt (interrupt_cause_t why);
246232 void stop ();
247233 void dump_detail (Formatter* f) const {
248234 }
@@ -262,7 +248,7 @@ class RecoveryBackend {
262248 void add_temp_obj (const hobject_t &oid);
263249 void clear_temp_obj (const hobject_t &oid);
264250
265- void clean_up (ceph::os::Transaction& t, std::string_view why);
251+ void clean_up (ceph::os::Transaction& t, interrupt_cause_t why);
266252 virtual seastar::future<> on_stop () = 0;
267253private:
268254 void handle_backfill_finish (
0 commit comments