Proper comment for bad code

This commit is contained in:
Nicolae Vartolomei 2022-09-20 19:56:14 +00:00
parent 3d6fcf4ae5
commit e93a78faee

View File

@ -1471,8 +1471,14 @@ bool MutateTask::execute()
return true;
// The `new_data_part` is a shared pointer and must be moved to allow
// part deletion (happening in the destructor) in case it is needed
// in `MutateFromLogEntryTask::finalize`.
// part deletion in case it is needed in `MutateFromLogEntryTask::finalize`.
//
// `tryRemovePartImmediately` requires `std::shared_ptr::unique() == true`
// to delete the part timely. When there are multiple shared pointers,
// only the part state is changed to `Deleting`.
//
// Fetching a byte-identical part (in case of checksum mismatches) will fail with
// `Part ... should be deleted after previous attempt before fetch`.
promise.set_value(std::move(ctx->new_data_part));
return false;
}