[Pdns-users] How do you rectify zones?
Peter van Dijk
peter.van.dijk at netherlabs.nl
Tue Feb 19 10:50:25 UTC 2013
Hello Jan-Piet,
On Feb 18, 2013, at 11:04 , Jan-Piet Mens wrote:
> Thinking along the lines of lots of zones for which a lot of updates
> occur, how do you perform minimal (i.e. as little as necessary)
> rectification? I haven't investigated what it does to performance, but I
> can't imagine that a periodic `rectify-all-zones' would do a machine any
> good... Further, when acting as a master server, if rectify does modify
> something, the SOA serial number isn't increased, which renders the
> procedure a bit useless. :)
Rectify is 'pretty' cheap when you don't use NSEC3. However, it's not the kind of thing you'd want to run after every update to a big, busy zone.
> I've been thinking about database triggers to rectify, but a) it's a lot
> of work and b) would have to be implemented (differently) for all
> possible back-ends.
Yes, indeed.
> Would it be possible to have a "rectification" daemon or thread within
> PowerDNS proper which monitors a column in the `domains' table?
> Something along the lines of
>
> ALTER TABLE domains ADD COLUMN needs_rectify BOOL NOT NULL DEFAULT 0;
>
> A small database trigger could then set needs_rectify = 1 when something
> relevant happens on the `records' table, and the rectifier would then
> 'fix' whatever needs fixing, and reset the boolean.
>
> (With PostgreSQL, it could be implemented externally using NOTIFY/LISTEN.)
While not providing a direct answer, I hope this helps:
PowerDNS 3.2 comes with an experimental, undocumented JSON API (API details subject to change!). This API (currently!) allows changing record data. To facilitate this, backends can provide a replaceRRset method - gmysql currently provides this.
This replaceRRset method can, currently, destroy rectification for a zone. As part of merging Ruben d'Arco's RFC2136 work which also uses replaceRRset (see my branch based on his work at https://github.com/habbie/powerdns/tree/rfc2136), I will be working on "incremental rectification" to be run as part of such a JSON or RFC2136 call. This incremental rectify will be as cheap as possible.
However, the way I see this, a simple 'needs_rectify' bool will not allow such a cheap rectify to happen because there is no log of changes. I hope to make it such that just knowing the name of the changed (including deleted) record suffices, but I can't make promises yet.
Kind regards,
--
Peter van Dijk
Netherlabs Computer Consulting BV - http://www.netherlabs.nl/
More information about the Pdns-users
mailing list