[pve-devel] [RFC pve-storage 5/7] This patch will include storage asynchronous replication.

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri Apr 14 10:05:33 CEST 2017


On Thu, Apr 13, 2017 at 04:02:39PM +0200, Wolfgang Bumiller wrote:
> On Wed, Apr 12, 2017 at 12:41:24PM +0200, Wolfgang Link wrote:
> > It is possible to synchronise a volume to an other node in a defined interval.
> > So if a node fail there will be an copy of the volumes from a VM
> > on an other node.
> > With this copy it is possible to start the VM on this node.
> > ---
> [.....]
> > +
> > +	if ($now > $synctime && ($jobs->{$vmid}->{state} eq 'ok'
> > +	    || ($jobs->{$vmid}->{state} eq 'ok') && ($fail <= $MAX_FAIL)) ){
> 
> I'd prefer to see more parenthesis here.
> This is:
>   A && B || C && D
> While && binds more strongly than || I'd still perfer
>   (A && B) || (C && D)
> for clarity.

isn't this actually
  A && B || B && C
which can be reduced to
  B && (A || C)
?

all the checks are simple comparisons after all and (including the $job
helper variable feedback you gave)

if ($job->{state} eq 'ok' && ($now > $synctime || $fail <= $MAX_FAIL)) {

reads a lot better IMHO ;)




More information about the pve-devel mailing list