On Thu, May 21, 2015 at 11:24:20AM +0200, 'BSRK Aditya' via ganeti-devel wrote:
> Config modifications are now done using
> wconfd RPCs. However, offline cluster
> updates are still allowed.
> 
> Added wrappers CommitTemporaryIps, and VerifyConfigAndLog
> to perform read only config operations with lock.
> 
> Add a mock for Update function, and use
> the mock config object in two config tests.
> 
> Remove config tests on Update
> 
> Signed-off-by: BSRK Aditya <[email protected]>
> ---
>  lib/config/__init__.py            |   76 
> ++++++++++++++++++++-----------------
>  test/py/ganeti.config_unittest.py |   58 +---------------------------
>  test/py/testutils/config_mock.py  |   26 +++++++++++++
>  3 files changed, 69 insertions(+), 91 deletions(-)

> +    def WithRetry():
> +      result = update_function(target.ToDict())
> +      self.OutDate()
>  
> -    if isinstance(target, objects.Disk):
> -      self._UnlockedReleaseDRBDMinors(target.uuid)
> +      if result is None:
> +        raise utils.RetryAgain()
> +      else:
> +        return float(result)
> +    mtime = utils.Retry(WithRetry, 0.1, 30)
> +    self.OutDate()
> +    target.serial_no += 1
> +    target.mtime = mtime

Since we know the local change any way, can we avoid refetching the configuratio
after the change (which will happen due to the OutDate, if we access it again)?
Or does that not happen for the typical cluster operations?

This can, of course, be done in a follow-up patch series.

LGTM

-- 
Klaus Aehlig
Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores

Reply via email to