Changeset 792


Ignore:
Timestamp:
10/21/20 13:49:40 (4 years ago)
Author:
Kris Deugau
Message:

/trunk

Refine and lightly reorder logic for automatically bumpering the serial
and forcing fresh data to be exported

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r790 r792  
    62936293
    62946294      # write fresh records if:
     6295      #  - the zone contains ALIAS pseudorecords, which need to cascade changes from the upstream CNAME farm at every opportunity
     6296      if ( ($dbh->selectrow_array("SELECT count(*) FROM records WHERE domain_id = ? AND type=65300", undef, $domid))[0] ) {
     6297        $changed = 1;  # abuse this flag for zones with ALIAS records
     6298        # also update the serial number, because while it shouldn't matter purely for serving
     6299        # records, it WILL matter if AXFR becomes part of the publishing infrastructure
     6300        $self->_updateserial(domain_id => $domid);
     6301      }
     6302      #  - the zone contains records which expire in less than 10 minutes or became valid less than 10 minutes ago
     6303      # note, no need to multi-bump the serial
     6304      elsif ( ($dbh->selectrow_array("SELECT COUNT(*) FROM records WHERE domain_id = ? AND ".
     6305              "stampactive='t' AND @(extract(epoch from stamp-now())) < 600", undef, $domid))[0] ) {
     6306        $changed = 1;
     6307        $self->_updateserial(domain_id => $domid);
     6308      }
    62956309      #  - we are not using the cache
    62966310      #  - force_refresh is set
     
    62986312      #  - the cache file does not exist
    62996313      #  - the cache file is empty
    6300       #  - the zone contains ALIAS pseudorecords, which need to cascade changes from the upstream CNAME farm at every opportunity
    6301       if ( ($dbh->selectrow_array("SELECT count(*) FROM records WHERE domain_id = ? AND type=65300", undef, $domid))[0] ) {
    6302         $changed = 1;  # abuse this flag for zones with ALIAS records
    6303       }
    63046314      if (!$self->{usecache} || $self->{force_refresh} || $changed || !-e $cachefile || -z $cachefile) {
    63056315        if ($self->{usecache}) {
Note: See TracChangeset for help on using the changeset viewer.