mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Requeue domains on wrong DnsWriter.
Currently, if for some reason publishDnsUpdates gets a request to publish domains to a DnsWriter that doesn't belong to said domain - it logs a warning but published anyway. This can happen when Writers are changed (swapped for a different writer) leaving update commands "stuck" with the wrong writer. Normally you'd expect these update commands to just publish their data and be on their way. However, if the update fails for some reason (likely - if the Writer change happened BECAUSE the updates are failing) then the same publishDnsUpdate command will continue to run forever. This CL changes the behavior for "publish to wrong DnsWriter" to instead requeue the batched domains / hosts back to the Dns-pull queue, allowing them to be re-batched (and hence published) with the correct DnsWriter(s). This re-batching will take place in ReadDnsQueueAction.java ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=177863076
This commit is contained in:
parent
440b06658d
commit
8e33bc898f
3 changed files with 67 additions and 5 deletions
|
@ -36,12 +36,17 @@ public final class DnsWriterProxy {
|
|||
this.dnsWriters = ImmutableMap.copyOf(dnsWriters);
|
||||
}
|
||||
|
||||
/** Returns the instance of {@link DnsWriter} by class name. */
|
||||
/**
|
||||
* Returns the instance of {@link DnsWriter} by class name.
|
||||
*
|
||||
* If the DnsWriter doesn't belong to this TLD, will return null.
|
||||
*/
|
||||
public DnsWriter getByClassNameForTld(String className, String tld) {
|
||||
if (!Registry.get(tld).getDnsWriters().contains(className)) {
|
||||
logger.warningfmt(
|
||||
"Loaded potentially stale DNS writer %s which is no longer active on TLD %s.",
|
||||
"Loaded potentially stale DNS writer %s which is not active on TLD %s.",
|
||||
className, tld);
|
||||
return null;
|
||||
}
|
||||
DnsWriter dnsWriter = dnsWriters.get(className);
|
||||
checkState(dnsWriter != null, "Could not load DnsWriter %s for TLD %s", className, tld);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue