Browse Source

[2020] updated comments about zonemgr config updates re. zone class and errors.

JINMEI Tatuya 13 years ago
parent
commit
f5abe6318c
3 changed files with 26 additions and 18 deletions
  1. 9 8
      src/bin/ddns/ddns.py.in
  2. 15 9
      src/bin/ddns/ddns_messages.mes
  3. 2 1
      src/bin/ddns/tests/ddns_test.py

+ 9 - 8
src/bin/ddns/ddns.py.in

@@ -309,16 +309,17 @@ class DDNSServer:
         new_secondary_zones = set()
         new_secondary_zones = set()
         try:
         try:
             # Parse the new config and build a new list of secondary zones.
             # Parse the new config and build a new list of secondary zones.
-            # Note that validation should have been done by zonemgr, so
+            # Unforutnately, in the current implementation, even an observer
-            # the following shouldn't fail in theory.  But the configuration
+            # module needs to perform full validation.  This should be changed
-            # interface is quite complicated and there may be a hole, so
+            # so that only post-validation (done by the main module) config is
-            # we'll perform minimal defense ourselves.
+            # delevered to observer modules, but until it's supported we need
+            # to protect ourselves.
             for zone_spec in sec_zones:
             for zone_spec in sec_zones:
                 zname = Name(zone_spec['name'])
                 zname = Name(zone_spec['name'])
-                # class is optional per spec.  ideally this should be merged
+                # class has the default value in case it's unspecified.
-                # within the config module, but it's not really clear if we
+                # ideally this should be merged within the config module, but
-                # can assume that due to its complexity - so we don't rely on
+                # the current implementation doesn't esnure that, so we need to
-                # it.
+                # subsitute it ourselves.
                 if 'class' in zone_spec:
                 if 'class' in zone_spec:
                     zclass = RRClass(zone_spec['class'])
                     zclass = RRClass(zone_spec['class'])
                 else:
                 else:

+ 15 - 9
src/bin/ddns/ddns_messages.mes

@@ -162,15 +162,21 @@ zones is logged.
 % DDNS_SECONDARY_ZONES_UPDATE_FAIL failed to update secondary zone list: %1
 % DDNS_SECONDARY_ZONES_UPDATE_FAIL failed to update secondary zone list: %1
 An error message.  b10-ddns was notified of updates to a list of
 An error message.  b10-ddns was notified of updates to a list of
 secondary zones from b10-zonemgr and tried to update its own internal
 secondary zones from b10-zonemgr and tried to update its own internal
-copy of the list, but it failed.  This can happen only if the
+copy of the list, but it failed.  This can happen if the configuration
-configuration contains an error, but such a configuration should have
+contains an error, and b10-zonemgr should also reject that update.
-been rejected by b10-zonemgr first and shouldn't be delivered to
+Unfortunately, in the current implementation there is no way to ensure
-b10-ddns, so this should basically be an internal bug.  It's advisable
+that both zonemgr and ddns have consistent information when an update
-to submit a bug report if you ever see this message.  Also, while
+contains an error; further, as of this writing zonemgr has a bug that
-b10-ddns still keeps running with the previous configuration when this
+it could partially update the list of secondary zones if part of the
-error happens, it's possible that the entire system is in an
+list has an error (see Trac ticket #2038).  b10-ddns still keeps
-inconsistent state.  So it's probably better to restart bind10, or at
+running with the previous configuration, but it's strongly advisable
-least restart b10-ddns.
+to check log messages from zonemgr, and if it indicates there can be
+inconsistent state, it's better to restart the entire BIND 10 system
+(just restarting b10-ddns wouldn't be enough, because zonemgr can have
+partially updated configuration due to bug #2038).  The log message
+contains an error description, but it's intentionally kept simple as
+it's primarily a matter of zonemgr.  To know the details of the error,
+log messages of zonemgr should be consulted.
 
 
 % DDNS_SESSION session arrived on file descriptor %1
 % DDNS_SESSION session arrived on file descriptor %1
 A debug message, informing there's some activity on the given file descriptor.
 A debug message, informing there's some activity on the given file descriptor.

+ 2 - 1
src/bin/ddns/tests/ddns_test.py

@@ -499,7 +499,8 @@ class TestDDNSServer(unittest.TestCase):
         self.assertEqual({(TEST_ZONE_NAME, TEST_RRCLASS)},
         self.assertEqual({(TEST_ZONE_NAME, TEST_RRCLASS)},
                          self.ddns_server._secondary_zones)
                          self.ddns_server._secondary_zones)
 
 
-        # Similar to the above, but the optional 'class' is missing.
+        # Similar to the above, but 'class' is unspecified.  The default value
+        # should be used.
         self.__cc_session._zonemgr_config = {'secondary_zones': [
         self.__cc_session._zonemgr_config = {'secondary_zones': [
                 {'name': TEST_ZONE_NAME_STR}]}
                 {'name': TEST_ZONE_NAME_STR}]}
         self.__cc_session.add_remote_config_by_name('Zonemgr')
         self.__cc_session.add_remote_config_by_name('Zonemgr')