Parcourir la source

[1372] added IXFR specific log messages

JINMEI Tatuya il y a 13 ans
Parent
commit
c3d71baca7
2 fichiers modifiés avec 46 ajouts et 8 suppressions
  1. 15 8
      src/bin/xfrout/xfrout.py.in
  2. 31 0
      src/bin/xfrout/xfrout_messages.mes

+ 15 - 8
src/bin/xfrout/xfrout.py.in

@@ -383,34 +383,41 @@ class XfroutSession():
                     auth_rrset.get_class() != zone_class:
                     auth_rrset.get_class() != zone_class:
                 continue
                 continue
             if auth_rrset.get_rdata_count() != 1:
             if auth_rrset.get_rdata_count() != 1:
-                # TBD: log it.
+                logger.info(XFROUT_IXFR_MULTIPLE_SOA,
+                            format_addrinfo(self._remote))
                 return Rcode.FORMERR()
                 return Rcode.FORMERR()
             remote_soa = auth_rrset
             remote_soa = auth_rrset
         if remote_soa is None:
         if remote_soa is None:
-            # TBD: log it.
+            logger.info(XFROUT_IXFR_NO_SOA, format_addrinfo(self._remote))
             return Rcode.FORMERR()
             return Rcode.FORMERR()
 
 
         rcode, self._soa = self._get_zone_soa(zone_name)
         rcode, self._soa = self._get_zone_soa(zone_name)
         if rcode != Rcode.NOERROR():
         if rcode != Rcode.NOERROR():
             return rcode
             return rcode
         try:
         try:
+            begin_serial = get_soa_serial(remote_soa.get_rdata()[0])
+            end_serial = get_soa_serial(self._soa.get_rdata()[0])
             code, self._jnl_reader = self._datasrc_client.get_journal_reader(
             code, self._jnl_reader = self._datasrc_client.get_journal_reader(
-                zone_name, get_soa_serial(remote_soa.get_rdata()[0]),
-                get_soa_serial(self._soa.get_rdata()[0]))
+                zone_name, begin_serial, end_serial)
         except isc.datasrc.NotImplemented as ex:
         except isc.datasrc.NotImplemented as ex:
             # The underlying data source doesn't support journaling.
             # The underlying data source doesn't support journaling.
-            # Fallback to AXFR-style IXFR.
-            # TBD: log it.
+            # Fall back to AXFR-style IXFR.
+            logger.info(XFROUT_IXFR_NO_JOURNAL_SUPPORT,
+                        format_addrinfo(self._remote),
+                        format_zone_str(zone_name, zone_class))
             return self.__axfr_setup(zone_name)
             return self.__axfr_setup(zone_name)
         if code == ZoneJournalReader.NO_SUCH_VERSION:
         if code == ZoneJournalReader.NO_SUCH_VERSION:
-            # fallback to AXFR-style IXFR
-            # TBD: log it.
+            logger.info(XFROUT_IXFR_NO_VERSION, format_addrinfo(self._remote),
+                        format_zone_str(zone_name, zone_class),
+                        begin_serial, end_serial)
             return self.__axfr_setup(zone_name)
             return self.__axfr_setup(zone_name)
         if code == ZoneJournalReader.NO_SUCH_ZONE:
         if code == ZoneJournalReader.NO_SUCH_ZONE:
             # this is quite unexpected as we know zone's SOA exists.
             # this is quite unexpected as we know zone's SOA exists.
             # It might be a bug or the data source is somehow broken,
             # It might be a bug or the data source is somehow broken,
             # but it can still happen if someone has removed the zone
             # but it can still happen if someone has removed the zone
             # between these two operations.  We treat it as NOTAUTH.
             # between these two operations.  We treat it as NOTAUTH.
+            logger.warn(XFROUT_IXFR_NO_ZONE, format_addrinfo(self._remote),
+                        format_zone_str(zone_name, zone_class))
             return Rcode.NOTAUTH()
             return Rcode.NOTAUTH()
 
 
         return Rcode.NOERROR()
         return Rcode.NOERROR()

+ 31 - 0
src/bin/xfrout/xfrout_messages.mes

@@ -178,3 +178,34 @@ on, but the file is in use. The most likely cause is that another
 xfrout daemon process is still running. This xfrout daemon (the one
 xfrout daemon process is still running. This xfrout daemon (the one
 printing this message) will not start.
 printing this message) will not start.
 
 
+% XFROUT_IXFR_MULTIPLE_SOA IXFR client %1: authority section has multiple SOAs
+An IXFR request was received with more than one SOA RRs in the authority
+section.  The xfrout daemon rejects the request with an RCODE of
+FORMERR.
+
+% XFROUT_IXFR_NO_SOA IXFR client %1: missing SOA
+An IXFR request was received with no SOA RR in the authority section.
+The xfrout daemon rejects the request with an RCODE of FORMERR.
+
+% XFROUT_IXFR_NO_JOURNAL_SUPPORT IXFR client %1, %2: journaling not supported in the data source, falling back to AXFR
+An IXFR request was received but the underlying data source did
+not support journaling.  The xfrout daemon fell back to AXFR-style
+IXFR.
+
+% XFROUT_IXFR_NO_VERSION IXFR client %1, %2: version (%3 to %4) not in journal, falling back to AXFR
+An IXFR request was received, but the requested range of differences
+were not found in the data source.  The xfrout daemon fell back to
+AXFR-style IXFR.
+
+% XFROUT_IXFR_NO_ZONE IXFR client %1, %2: zone not found with journal
+The requested zone in IXFR was not found in the data source
+even though the xfrout daemon sucessfully found the SOA RR of the zone
+in the data source.  This can happen if the administrator removed the
+zone from the data source within the small duration between these
+operations, but it's more likely to be a bug or broken data source.
+Unless you know why this message was logged, and especially if it
+happens often, it's advisable to check whether the data source is
+valid for this zone.  The xfrout daemon considers it a possible,
+though unlikely, event, and returns a response with an RCODE of
+NOTAUTH.
+