]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ReplicatedBackend: handle tailing zeros of recovering objects nicer 38662/head
authorsongweibin <song.weibin@zte.com.cn>
Sat, 19 Dec 2020 10:50:31 +0000 (18:50 +0800)
committersongweibin <song.weibin@zte.com.cn>
Mon, 21 Dec 2020 09:27:20 +0000 (17:27 +0800)
E.g.,
(1) recovery_info.copy_subset = [0, 4194304]
(2) copy_subset(fiemap) = [0, 8192]
(3) out_op->data_included.span_of(copy_subset, 0, 4194304) = [0, 8192]

We'll set new_progress.data_recovered_to = 8192 as a result, and
fail to complete the push in one go.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/ReplicatedBackend.cc

index 269adf64b1191875ddf79f0094a325954ec4d143..50d185734764532d016021705fc0c173074f7cf7 100644 (file)
@@ -1961,7 +1961,9 @@ int ReplicatedBackend::build_push_op(const ObjectRecoveryInfo &recovery_info,
 
       out_op->data_included.span_of(copy_subset, progress.data_recovered_to,
                                     available);
-      if (out_op->data_included.empty()) // zero filled section, skip to end!
+      // zero filled section, skip to end!
+      if (out_op->data_included.empty() ||
+          out_op->data_included.range_end() == copy_subset.range_end())
         new_progress.data_recovered_to = recovery_info.copy_subset.range_end();
       else
         new_progress.data_recovered_to = out_op->data_included.range_end();