mirror of
https://github.com/google/nomulus.git
synced 2025-07-24 19:48:32 +02:00
Skip RRS update if existing records are equal to desired records
This is done first and formost to stop "empty" commits that cause errors in publishDnsUpdates. The reason being that the Cloud DNS api fails when there are no updates at all in a change. Allowing this is a requirement for the writer to be idempotent - if we delete a domain, then run the writer to delete it again - we'll get 0 additions and 0 deletions which fails. This isn't theoretical either - we've seen it happen, causing a publishDnsUpdates to fail over and over again. While fixing this, we also remove all RRS that are common between additions and deletions. This is just an optimization and shouldn't affect behavior. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=179525218
This commit is contained in:
parent
42795074a8
commit
633eb3179a
2 changed files with 24 additions and 1 deletions
|
@ -490,4 +490,10 @@ public class CloudDnsWriterTest {
|
|||
writer.commit();
|
||||
assertThat(zoneNameCaptor.getValue()).isEqualTo("triple-secret-tld");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyCommit() {
|
||||
writer.commit();
|
||||
verify(dnsConnection, times(0)).changes();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue