@@ -229,28 +229,20 @@ void ECBackend::handle_recovery_push(
229229
230230 recovery_backend.handle_recovery_push (op, m, is_repair);
231231
232- if (op.after_progress .data_complete ) {
233- if ((get_parent ()->pgb_is_primary ())) {
234- if (get_parent ()->pg_is_repair () || is_repair)
235- get_parent ()->inc_osd_stat_repaired ();
236- } else {
237- // If primary told us this is a repair, bump osd_stat_t::num_objects_repaired
238- if (is_repair)
239- get_parent ()->inc_osd_stat_repaired ();
240- if (get_parent ()->pg_is_remote_backfilling ()) {
241- struct stat st;
242- int r = store->stat (ch, ghobject_t (op.soid , ghobject_t ::NO_GEN,
243- get_parent ()->whoami_shard ().shard ), &st);
244- if (r == 0 ) {
245- get_parent ()->pg_sub_local_num_bytes (st.st_size );
246- // XXX: This can be way overestimated for small objects
247- get_parent ()->pg_sub_num_bytes (st.st_size * get_ec_data_chunk_count ());
248- dout (10 ) << __func__ << " " << op.soid
249- << " sub actual data by " << st.st_size
250- << " sub num_bytes by " << st.st_size * get_ec_data_chunk_count ()
251- << dendl;
252- }
253- }
232+ if (op.after_progress .data_complete &&
233+ !(get_parent ()->pgb_is_primary ()) &&
234+ get_parent ()->pg_is_remote_backfilling ()) {
235+ struct stat st;
236+ int r = store->stat (ch, ghobject_t (op.soid , ghobject_t ::NO_GEN,
237+ get_parent ()->whoami_shard ().shard ), &st);
238+ if (r == 0 ) {
239+ get_parent ()->pg_sub_local_num_bytes (st.st_size );
240+ // XXX: This can be way overestimated for small objects
241+ get_parent ()->pg_sub_num_bytes (st.st_size * get_ec_data_chunk_count ());
242+ dout (10 ) << __func__ << " " << op.soid
243+ << " sub actual data by " << st.st_size
244+ << " sub num_bytes by " << st.st_size * get_ec_data_chunk_count ()
245+ << dendl;
254246 }
255247 }
256248}
0 commit comments