Merge pull request #38662 from Songweibin/wip-121918

osd/ReplicatedBackend: handle tailing zeros of recovering objects nicer

Reviewed-by: Kefu Chai <kchai@redhat.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This commit is contained in:
Kefu Chai 2020-12-24 14:08:48 +08:00 committed by GitHub
commit bb22041c61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2118,7 +2118,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();