Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIND backend: Several improvements for b2b-migrate #5810

Merged
merged 4 commits into from Nov 2, 2017

Conversation

@pieterlexis
Copy link
Member

@pieterlexis pieterlexis commented Oct 11, 2017

Short description

While attempting to do a migration from the BIND backend to gsqlite3, several issues arose:

  • No masters were set in the target db (#5807)
  • Only the last master in the list of masters would be added to the target database
  • The BIND backend was not fully aware of native zones

The last issue stemmed from an incomplete implementation in #5115.

This PR aims to fix all these issues.

Note: the b2b-migrate patch for setting the masters correctly and the patch to add the masters to the DomainInfo might need to be backported to 4.0.x.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled and tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)
pieterlexis added 2 commits Oct 11, 2017
Before, only the last master of all the master would eb added becuase of
the way DNSBackend::setMaster() is implemented in gsql backends.
@pieterlexis pieterlexis added this to the auth-4.1.0 milestone Oct 11, 2017
@@ -353,6 +353,7 @@ void Bind2Backend::getAllDomains(vector<DomainInfo> *domains, bool include_disab
di.zone=i->d_name;
di.last_check=i->d_lastcheck;
di.kind=i->d_masters.empty() ? DomainInfo::Master : DomainInfo::Slave; //TODO: what about Native?

This comment has been minimized.

@cmouse

cmouse Oct 11, 2017
Contributor

i->d_kind instead?

@pieterlexis pieterlexis force-pushed the pieterlexis:b2b-migrate-bind-fixes branch from 2f755ce to f2bb2b6 Oct 11, 2017
@@ -302,7 +302,8 @@ void Bind2Backend::getUpdatedMasters(vector<DomainInfo> *changedDomains)
ReadLock rl(&s_state_lock);

for(state_t::const_iterator i = s_state.begin(); i != s_state.end() ; ++i) {
if(!i->d_masters.empty() && this->alsoNotify.empty() && i->d_also_notify.empty())
if(i->d_kind != DomainInfo::Slave ||
(!i->d_masters.empty() && this->alsoNotify.empty() && i->d_also_notify.empty()))

This comment has been minimized.

@cmouse

cmouse Oct 11, 2017
Contributor

should these be removed or are Master domains with masters considered slaves?

This comment has been minimized.

@pieterlexis

pieterlexis Oct 11, 2017
Author Member

Good question, I'd have to check what the expected behaviour is.

This comment has been minimized.

@pieterlexis

pieterlexis Oct 16, 2017
Author Member

In the gsqlite3 backend, we SELECT ... where type='MASTER'. This also means that alsoNotify and d_masters don't even matter. We should not use NATIVE or SLAVE zones here to make the BIND backend behave consistent with the gsql backends. I'll make that so.

@pieterlexis pieterlexis requested a review from ahupowerdns Oct 11, 2017
@pieterlexis
Copy link
Member Author

@pieterlexis pieterlexis commented Oct 11, 2017

paging @mind04 for a review

And use this in all places where this makes sense. This change will use
a size_t number of bytes more per loaded zone.

This change is mostly for `b2b-migrate` to be 1:1.
@pieterlexis pieterlexis force-pushed the pieterlexis:b2b-migrate-bind-fixes branch from f2bb2b6 to bc67ec2 Oct 16, 2017
@mind04
Copy link
Contributor

@mind04 mind04 commented Oct 23, 2017

Two questions:

  1. Was the interaction between master and slave checked? (notifies and freshness (soa) checks still working)
  2. Is the behaviour of bind backed still compatible with real bind after this change for master/slave zones and also-notify?
@pieterlexis
Copy link
Member Author

@pieterlexis pieterlexis commented Oct 24, 2017

Was the interaction between master and slave checked? (notifies and freshness (soa) checks still working)

Yes, this was tested and it works

Is the behaviour of bind backed still compatible with real bind after this change for master/slave zones and also-notify?

The behaviour indeed differs from before (now that I re-read this code), fixing.

@mind04 noticed the behaviour introduced in bc67ec2 was not the same as
before.
Copy link
Member

@ahupowerdns ahupowerdns left a comment

Looks good! Minor of minorest nits, string master="" is superfluous. But let's not let that stop us.

@aerique aerique merged commit da0b87e into PowerDNS:master Nov 2, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@pieterlexis pieterlexis deleted the pieterlexis:b2b-migrate-bind-fixes branch Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.