commit 449e3e0e8a916e70ea32c9e82e106c2f1fdd7106
Merge: f4ce0ac 0fdd185
Author: Hrvoje Ribicic <[email protected]>
Date:   Tue Mar 3 19:38:44 2015 +0000

    Merge branch 'stable-2.13' into stable-2.14

    * stable-2.13
      Document hbal's additional levels of verbosity

    * stable-2.12
      (no changes)

    * stable-2.11
      (no changes)

    * stable-2.10
      Relax expectation of accuracy
      Improve rounding accuracty in updateStatistics
      Update gnt-backup manual to reflect real behavior
      Finalize local export only if successful

    * stable-2.9
      Stop MonD when removing a node from a cluster

    Conflicts:
    lib/masterd/instance.py
    man/gnt-backup.rst
    test/hs/Test/Ganeti/Utils/Statistics.hs
    Resolution:
            instance.py: Take new variable name from 2.14, rest from 2.10
            gnt-backup.rst: Replace 2.14 paragraph with 2.10 one
            Statistics.hs: Use new test function

diff --cc lib/masterd/instance.py
index 3d04169,6999656..9abbc69
--- a/lib/masterd/instance.py
+++ b/lib/masterd/instance.py
@@@ -1329,14 -1287,22 +1329,22 @@@ class ExportInstanceHelper(object)

      assert len(dresults) == len(instance.disks)

-     self._feedback_fn("Finalizing export on %s" % dest_node.name)
-     result = self._lu.rpc.call_finalize_export(dest_node.uuid, instance,
-                                                disks_to_transfer)
-     msg = result.fail_msg
-     fin_resu = not msg
-     if msg:
-       self._lu.LogWarning("Could not finalize export for instance %s"
-                           " on node %s: %s", instance.name, dest_node.name,
msg)
+     # Finalize only if all the disks have been exported successfully
+     if all(dresults):
+       self._feedback_fn("Finalizing export on %s" % dest_node.name)
+       result = self._lu.rpc.call_finalize_export(dest_node.uuid, instance,
 -                                                 self._snap_disks)
++                                                 disks_to_transfer)
+       msg = result.fail_msg
+       fin_resu = not msg
+       if msg:
+         self._lu.LogWarning("Could not finalize export for instance %s"
+                             " on node %s: %s", instance.name,
dest_node.name,
+                             msg)
+     else:
+       fin_resu = False
+       self._lu.LogWarning("Some disk exports have failed; there may be "
+                           "leftover data for instance %s on node %s",
+                           instance.name, dest_node.name)

      return (fin_resu, dresults)

diff --cc man/gnt-backup.rst
index 366b06c,f9a9359..29c506a
--- a/man/gnt-backup.rst
+++ b/man/gnt-backup.rst
@@@ -62,19 -62,12 +62,18 @@@ is used. The ``--zeroing-timeout-fixed`
  determining the minimum time to wait, and the latter how much longer
  to wait per MiB of data the instance has.

 +The ``--long-sleep`` option allows Ganeti to keep the instance shut
 +down for the entire duration of the export if necessary. This is
 +needed if snapshots are not supported by the underlying storage type,
 +or if the creation of snapshots fails for some reason - e.g. lack of
 +space.
 +
- The exit code of the command is 0 if all disks were backed up
- successfully, 1 if no data was backed up or if the configuration
- export failed, and 2 if just some of the disks failed to backup.
- The exact details of the failures will be shown during the command
- execution (and will be stored in the job log). It is recommended
- that for any non-zero exit code, the backup is considered invalid,
- and retried.
+ Should the snapshotting or transfer of any of the instance disks
+ fail, the backup will not complete and any previous backups will be
+ preserved. The exact details of the failures will be shown during the
+ command execution (and will be stored in the job log). It is
+ recommended that for any non-zero exit code, the backup is considered
+ invalid, and retried.

  See **ganeti**\(7) for a description of ``--submit`` and other common
  options.
diff --cc test/hs/Test/Ganeti/Utils/Statistics.hs
index 03ad017,764ebc8..a74d6e4
--- a/test/hs/Test/Ganeti/Utils/Statistics.hs
+++ b/test/hs/Test/Ganeti/Utils/Statistics.hs
@@@ -57,9 -56,9 +57,9 @@@ prop_stddev_update
        with_update = getStatisticValue
                      $ updateStatistics (getStdDevStatistics original)
(a,b)
        direct = stdDev modified
 -  in printTestCase ("Value computed by update " ++ show with_update
 -                    ++ " differs too much from correct value " ++ show
direct)
 -                   (abs (with_update - direct) < 1e-10)
 +  in counterexample ("Value computed by update " ++ show with_update
 +                     ++ " differs too much from correct value " ++ show
direct)
-                     (abs (with_update - direct) < 1e-12)
++                    (abs (with_update - direct) < 1e-10)

  testSuite "Utils/Statistics"
    [ 'prop_stddev_update


Hrvoje Ribicic
Ganeti Engineering
Google Germany GmbH
Dienerstr. 12, 80331, München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores
Steuernummer: 48/725/00206
Umsatzsteueridentifikationsnummer: DE813741370

Reply via email to