[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] 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é <roger.pau@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 cs-adjust-flight |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/cs-adjust-flight b/cs-adjust-flight
index 85ced59..b78ea7e 100755
--- a/cs-adjust-flight
+++ b/cs-adjust-flight
@@ -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;
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.