BIND 10 #2915: update CacheConfig to support diff mode

BIND 10 Development do-not-reply at isc.org
Thu Apr 11 22:17:57 UTC 2013


#2915: update CacheConfig to support diff mode
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:
  jinmei                             |                Status:  new
                       Type:  task   |             Milestone:  Next-Sprint-
                   Priority:         |  Proposed
  medium                             |              Keywords:
                  Component:  data   |             Sensitive:  0
  source                             |           Sub-Project:  DNS
               CVSS Scoring:         |  Estimated Difficulty:  0
            Defect Severity:  N/A    |           Total Hours:  0
Feature Depending on Ticket:         |
  shared memory data source          |
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
 Continuation of #2912, depend on #2913 and #2914.

 This task completes the sub feature of "loading diffs".

 We update `CacheConfig::createZoneDataLoader()` further:

 - define a few options: at least FORCE_FULL_LOAD and DIFF_OK.  The
   default is DIFF_OK, not FORCE_FULL_LOAD.
 - if the zone is to be loaded from file, it'll always result in full
   load
 - otherwise, the logic would look like this:
 {{{#!cpp
     if (cache_client && (options & (FORCE_FULL_LOAD|DIFF_OK)) == DIFF_OK)
 {
         // get it from zone SOA in cache_client
         const dns::Serial cache_serial;

         // get it from zone SOA in datasrc_client
         const dns::Serial latest_serial;
         if (cache_serial == latest_serial) {
             return (/* return a factory that would create a special no-op
                        loader, see below */);
         } else if (cache_serial < latest_serial) {
             jnl_reader = datasrc_client.getJournalReader(cache_serial,
                                                          latest_serial);
             return (/* factory using the journal reader */);
         } else {
             // maybe throw as it shouldn't happen, or maybe fall back to
             // full load
         }
     }
     return (/* factory for full load from iterator */);
 }}}

 For the special no-op loader mentioned above, we'll make a slight
 update to `ZoneDataLoader`:
 {{{#!cpp
 class ZoneDataLoader {
 public:
     // A special no-op mode.  load() variants return given ZoneData
 intact,
     // commit() is no-op.
     ZoneDataLoader(ZoneData*);
 }}}

 `ZoneWriter` won't need to be updated.

-- 
Ticket URL: <http://bind10.isc.org/ticket/2915>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list