-
Notifications
You must be signed in to change notification settings - Fork 914
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
Conversation
Before, only the last master of all the master would eb added becuase of the way DNSBackend::setMaster() is implemented in gsql backends.
modules/bindbackend/bindbackend2.cc
Outdated
@@ -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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i->d_kind
instead?
2f755ce
to
f2bb2b6
Compare
modules/bindbackend/bindbackend2.cc
Outdated
@@ -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())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should these be removed or are Master domains with masters considered slaves?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, I'd have to check what the expected behaviour is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
f2bb2b6
to
bc67ec2
Compare
Two questions:
|
Yes, this was tested and it works
The behaviour indeed differs from before (now that I re-read this code), fixing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Minor of minorest nits, string master="" is superfluous. But let's not let that stop us.
Short description
While attempting to do a migration from the BIND backend to gsqlite3, several issues arose:
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: