cs-adjust-flight: Work properly on db transaction retry
PATCH 1/1 cs-adjust-flight: Work properly on db transaction retry
The variable @changes is eaten during processing. So on db retry, there would be changes missing. (When creating a new flight, this would often mean a flight with no jobs, which cannot be executed.)
CC Roger Pau Monné <[email protected]>
Signed-off-by Ian Jackson <[email protected]>
--- cs-adjust-flight | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
cs-adjust-flight +4 -1
@@ -85,9 +85,10 @@ while (@ARGV && $ARGV[0] =~ m/^\-/) { } die unless @ARGV >= 1; -our ($dstflightspec,@changes) = @ARGV; +our ($dstflightspec,@org_changes) = @ARGV; our $dstflight; +our @changes; sub spec_re ($) { my ($spec) = @_;
@@ -463,6 +464,8 @@ sub changes () { die "$dstflight already has steps\n".Dumper($step) if $step; } + @changes = @org_changes; + while (@changes) { my $change = shift @changes; $change =~ s/-/_/g;
Signature · 7 lines
1.7.10.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 6 lines · Ian Jackson
The variable @changes is eaten during processing. So on db retry, there would be changes missing. (When creating a new flight, this would often mean a flight with no jobs, which cannot be executed.)
CC Roger Pau Monné <[email protected]>Signed-off-by Ian Jackson <[email protected]>
Tested-by Roger Pau Monné <[email protected]>
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel