BIND 10 #1456: Create diff-normalizer utility functions

BIND 10 Development do-not-reply at isc.org
Mon May 28 12:50:33 UTC 2012


#1456: Create diff-normalizer utility functions
-------------------------------------+-------------------------------------
                   Reporter:  jelte  |                 Owner:  jelte
                       Type:  task   |                Status:  reviewing
                   Priority:         |             Milestone:
  medium                             |  Sprint-20120529
                  Component:  DDNS   |            Resolution:
                   Keywords:         |             Sensitive:  0
            Defect Severity:  N/A    |           Sub-Project:  DNS
Feature Depending on Ticket:  DDNS   |  Estimated Difficulty:  5
        Add Hours to Ticket:  0      |           Total Hours:  0
                  Internal?:  0      |
-------------------------------------+-------------------------------------
Changes (by vorner):

 * owner:  UnAssigned => jelte


Comment:

 Hello

 I noticed one thing. If the same RR is both added and deleted, the
 diff/journal will contain both the addition and deletion. While it is OK
 for DDNS, the proposed use of the single-update mode was to support IXFR
 from differences too. That one would probably work by deleting everything
 and then adding everything that comes. Most of the zone could be the same,
 so this would eliminate the changes. I think we should support this
 feature in the diff ‒ not necessarily now in this ticket, but a new one to
 keep track of it should be created.

 Also, I have few minor comments:
  * The docstring of `diff.__init__` says that „The first addition and the
 first addition still…“ ‒ the second should be deletion.
  * The docstring of `diff.get_single_update_buffers` is not true, the
 example output it shows has wrong structure.
  * This code is repetititive (the same code is twice here, effectively):
 {{{#!python
                 # First addition must be SOA
                 if len(self.__additions) == 0 and\
                    rr.get_type() != isc.dns.RRType.SOA():
                     raise ValueError("First addition in single update mode
 " +
                                      "must be of type SOA")
                 # And later additions may not
                 elif len(self.__additions) != 0 and\
                    rr.get_type() == isc.dns.RRType.SOA():
                     raise ValueError("Multiple SOA records in single " +
                                      "update mode addition")
                 self.__additions.append((operation, rr))
             elif operation == 'delete':
                 if len(self.__deletions) == 0 and\
                    rr.get_type() != isc.dns.RRType.SOA():
                     raise ValueError("First deletion in single update mode
 " +
                                      "must be of type SOA")
                 # And later deletions may not
                 elif len(self.__deletions) != 0 and\
                    rr.get_type() == isc.dns.RRType.SOA():
                     raise ValueError("Multiple SOA records in single " +
                                      "update mode deletion")
                 self.__deletions.append((operation, rr))
 }}}

 I think it should be put into a function (something like
 `addWithSoaCheck`) and called as:
 {{{#!python
 self.__addWithSoaCheck(self.__additions, "addition", operation, rr)
 }}}

-- 
Ticket URL: <http://bind10.isc.org/ticket/1456#comment:11>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list