Skip to content

feat(secondary): Send NOTIFY messages after zone transfer#7901

Merged
yongtang merged 5 commits into
coredns:masterfrom
crliu3227:feat-secondary-notify
Mar 8, 2026
Merged

feat(secondary): Send NOTIFY messages after zone transfer#7901
yongtang merged 5 commits into
coredns:masterfrom
crliu3227:feat-secondary-notify

Conversation

@crliu3227

Copy link
Copy Markdown
Contributor

Summary

Implements DNS NOTIFY message delivery when a secondary zone successfully completes a zone transfer from primary servers. This ensures that other secondary servers are notified of zone updates, allowing them to refresh their copies of the zone.

Changes

  • Modified TransferIn() method to accept a transfer.Transfer parameter
  • Added NOTIFY message sending after successful zone transfer in secondary plugin
  • Updated Update() method to pass the transfer handler through the zone update cycle
  • Added comprehensive tests for the secondary notify functionality

Related Issues

Closes #5669

Testing

  • Added tests in test/secondary_test.go covering various secondary notify scenarios
  • Verified NOTIFY messages are sent correctly after zone transfer
  • Tested error handling for failed NOTIFY operations

- Modified TransferIn() method to accept a transfer.Transfer parameter
- Added NOTIFY message sending after successful zone transfer in secondary plugin
- Updated Update() method to pass the transfer handler through the zone update cycle
- Added comprehensive tests for the secondary notify functionality

Closes coredns#5669

Signed-off-by: liucongran <liucongran327@gmail.com>
@crliu3227 crliu3227 force-pushed the feat-secondary-notify branch from 41c1d5e to 92aa812 Compare March 5, 2026 08:52
Update test to pass nil parameter to TransferIn method after signature change

Signed-off-by: liucongran <liucongran327@gmail.com>
@crliu3227 crliu3227 force-pushed the feat-secondary-notify branch from 9d9f9a2 to 8822b52 Compare March 5, 2026 09:02
- Reorder imports for consistency
- Add hasSOA() and getSOA() helper methods to Zone
- Remove unnecessary blank lines in tests

Signed-off-by: liucongran <liucongran327@gmail.com>
@yongtang

yongtang commented Mar 6, 2026

Copy link
Copy Markdown
Member

@crliu3227 can you help take a look at the test failures above?

Change corefile variable assignment to use short declaration syntax (:=)
to fix compilation error.

Signed-off-by: liucongran <liucongran327@gmail.com>
@crliu3227

Copy link
Copy Markdown
Contributor Author

@crliu3227 can you help take a look at the test failures above?

@crliu3227 can you help take a look at the test failures above?

ok, I'm working on it

Replace direct SOA access with getSOA() helper method for consistency.

Signed-off-by: liucongran <liucongran327@gmail.com>
@yongtang yongtang merged commit 2daf48e into coredns:master Mar 8, 2026
11 checks passed
yongtang pushed a commit to yongtang/coredns that referenced this pull request Mar 18, 2026
* feat(secondary): Send NOTIFY messages after zone transfer

- Modified TransferIn() method to accept a transfer.Transfer parameter
- Added NOTIFY message sending after successful zone transfer in secondary plugin
- Updated Update() method to pass the transfer handler through the zone update cycle
- Added comprehensive tests for the secondary notify functionality

Closes coredns#5669

Signed-off-by: liucongran <liucongran327@gmail.com>

* fix(secondary): Fix TransferIn method call in test

Update test to pass nil parameter to TransferIn method after signature change

Signed-off-by: liucongran <liucongran327@gmail.com>

* refactor(secondary): Clean up imports and add helper methods

- Reorder imports for consistency
- Add hasSOA() and getSOA() helper methods to Zone
- Remove unnecessary blank lines in tests

Signed-off-by: liucongran <liucongran327@gmail.com>

* fix(test): Fix variable declaration in secondary test

Change corefile variable assignment to use short declaration syntax (:=)
to fix compilation error.

Signed-off-by: liucongran <liucongran327@gmail.com>

* refactor(secondary): Use getSOA helper method in shouldTransfer

Replace direct SOA access with getSOA() helper method for consistency.

Signed-off-by: liucongran <liucongran327@gmail.com>

---------

Signed-off-by: liucongran <liucongran327@gmail.com>
Co-authored-by: liucongran <liucongran@cestc.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement notifies for secondary plugin

2 participants