← Back to team overview

sts-sponsors team mailing list archive

Re: [Merge] ~cgrabowski/maas:fix_glue_zones into maas:master

 

Looking good but one question wrt. to freeze thaw usage.

Diff comments:

> diff --git a/src/maasserver/dns/zonegenerator.py b/src/maasserver/dns/zonegenerator.py
> index 658147f..c165131 100644
> --- a/src/maasserver/dns/zonegenerator.py
> +++ b/src/maasserver/dns/zonegenerator.py
> @@ -494,7 +494,12 @@ class ZoneGenerator:
>                      ):
>                          glue_update = False
>                          break
> -                if glue_update:
> +                if (
> +                    glue_update
> +                    and update.answer
> +                    and update.answer_is_ip
> +                    and IPAddress(update.answer) in network

I just noticed that this fellow is instantiated quite often in the loop (for each dynamic update and for each exclude_net in each dynamic update above). But then I guess that those loops are usually very small(?)

> +                ):
>                      domain_updates.append(
>                          DynamicDNSUpdate.as_reverse_record_update(
>                              update, str(network)
> diff --git a/src/provisioningserver/dns/actions.py b/src/provisioningserver/dns/actions.py
> index bafbac9..86a4274 100644
> --- a/src/provisioningserver/dns/actions.py
> +++ b/src/provisioningserver/dns/actions.py
> @@ -50,6 +50,11 @@ def bind_reload(timeout=2):
>      :return: True if success, False otherwise.
>      """
>      try:
> +        # if first configuring a zone, we have to reload, but if already dynamically updated,
> +        # BIND can use freeze / thaw so changes don't conflict with dynamic updates so both are done
> +        # to load new zone data *and* config

I just learned that the idea is to freeze, update, thaw (https://bind9.readthedocs.io/en/v9_16_5/advanced.html). If I understand this correctly we are receiving an update, then we freeze to update the records and then immediately thaw. 
I was just wondering: Are we OK with that or are there reasons to do it "by the book" or did I entirely miss something?

> +        execute_rndc_command(("freeze",), timeout=timeout)
> +        execute_rndc_command(("thaw",), timeout=timeout)
>          execute_rndc_command(("reload",), timeout=timeout)
>          return True
>      except CalledProcessError as exc:


-- 
https://code.launchpad.net/~cgrabowski/maas/+git/maas/+merge/436005
Your team MAAS Committers is subscribed to branch maas:master.



References