google-nomulus/java/google/registry/dns/writer/clouddns
jianglai 1227046bcb Fix in-baliwick nameserver check bug in CloudDnsWriter
In publishDomain, we load the subordinate hosts of the domain from datastore and compare its nameservers to them. For any nameserver that is in-baliwick, we call publishSubordinateHost on it and stage the A/AAAA records of the host for publication.

This is superior to the old approach where we use hostName.endsWith(domainName) to check if a nameserver is in-baliwick because it will mistake ns.another-example.tld as a subordinate host of example.tld. It is also better than checking hostName.endsWith("." + domainName), which will catch false positives as above, but falls short in a corner case where the nameserver has been deleted before its superordinate domain's record is updated. In that case, subordinateHosts.cotains(hostName) will be false but hostName.endsWith("." + domainName) will still be true.

Note that we still use the suffix check in filterGlueRecords because it is filtering on existing records from Cloud DNS. It is even advantageous to do so because if there were (and there shouldn't be if everything is consistent) any orphaned glue records (suffix matches to the domain, but not actually in its subordinate host list), they would be retained by the filter and therefore be deleted when the staged changes are committed.

Also fixed a few tests that should have failed had we checked subrodinate hosts....

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184732005
2018-02-20 15:15:57 -05:00
..
BUILD Add MOE equivalence for sync on 2016-12-19 2017-01-09 11:59:04 -05:00
CloudDnsWriter.java Fix in-baliwick nameserver check bug in CloudDnsWriter 2018-02-20 15:15:57 -05:00
CloudDnsWriterModule.java Create a DNS writer that multiplies 10x the domains in the DNS 2018-01-19 14:19:25 -05:00
MultiplyingCloudDnsWriter.java Create a DNS writer that multiplies 10x the domains in the DNS 2018-01-19 14:19:25 -05:00