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.
| @@ -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? | |||
2f755ce to
f2bb2b6
Compare
| 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.
should these be removed or are Master domains with masters considered slaves?
There was a problem hiding this comment.
Good question, I'd have to check what the expected behaviour is.
There was a problem hiding this comment.
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. |
ahupowerdns
left a comment
There was a problem hiding this comment.
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: