[pve-devel] [PATCH guest-common 2/2] ReplicationState: deterministically order replication jobs

Thomas Lamprecht t.lamprecht at proxmox.com
Fri May 27 09:22:46 CEST 2022


On 27/05/2022 08:23, Dominik Csapak wrote:
>>
>> nit, but couldn't this be
>>
>> return  $joba->{guest} <=> $jobb->{guest} || $a cmp $b;
>>
>> instead, the right side of the logical OR only gets evaluated if the left side's
>> result is 0 (well also on undef and empty string "", but that cannot happen
>> with the spaceship operator).
>>
> 
> yeah sure, i just blindly copied from the lines above. do we want
> to change that pattern for all of them? like this:
> 
> ---
> return $sa->{last_iteration} <=> $sb->{last_iteration} ||
>     $joba->{next_sync} <=> $jobb->{next_sync} ||
>     $joba->{guest} <=> $jobb->{guest} ||
>     $a cmp $b;
> ---

would be fine for me, but just for that we don't need a v2 and I'd rather like
some comment/review from Fabian (or anybody else that worked more closely with
replication) - I mean, on the other hand, this one could be applied
independently too...






More information about the pve-devel mailing list