[bind10-dev] initial ideas on the "difference" design
Stephen Morris
stephen at isc.org
Thu Oct 13 18:13:22 UTC 2011
On 13/10/2011 07:19, JINMEI Tatuya / 神明達哉 wrote:
>> In general, the statement will be simpler in most cases the
>> versions required will not be "B to E" but "B to latest". In
>> that case, something like:
>>
>> select * from (select * from diffs where zone_id = Z and version
>> >= B except select * from diffs where zone id = Z and version = B
>> and operation = 1) order by id asc
>>
>> That is not quite complete in itself as an additional access will
>> be required as we need to check that there is difference
>> information for version B in the table. If there isn't, we have
>> to fall back to AXFR.
>
> Cool, but note that we still cannot directly use the versions for
> comparison unless we internally convert SOA serials to
> monotonically increase numbers.
I suppose there are two cases here:
1) For whatever reason, a server capable of IXFR-out is loaded with a
copy of the zone that has a lower-serial number than the current
version. This is incorrect operational behaviour, but it could
happen. Unless we allow some form of editing of the difference
sequences stored, I would argue that the simplest thing would be for
the server to drop all previous difference information if that were to
happen.
2) The rollover of the serial number (something I overlooked). You
are right that we can't then compare serial numbers for greater/less
than, but we can do equality checks. Assuming that we are just
wanting the differences for version B through to the latest version of
the zone, we would have something like:
select * from diffs where
zone_id = Z and
id >= (select id from diffs where
zone_id = Z and version = B and operation = 0
order by id asc limit 1)
order by id asc
Of course, there is the corner case where the serial starts at B and
is rolled through intermediate versions back to B. If that were to
happen, again I think that the simplest thing would be to drop all
difference sequences for the first instance of B and earlier.
Stephen
More information about the bind10-dev
mailing list