[bind10-dev] initial ideas on the "difference" design
Danny Mayer
mayer at ntp.org
Sun Oct 16 13:12:44 UTC 2011
On 10/13/2011 3:42 PM, JINMEI Tatuya / $B?@L at C#:H(B wrote:
> At Thu, 13 Oct 2011 19:13:22 +0100,
> Stephen Morris <stephen at isc.org> wrote:
>
>>> 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.
>>
>> 2) The rollover of the serial number (something I overlooked).
>
> I meant #2 in this context. We should consider and react to the case
> where the zone and the journal somehow have broken data, but that's
> beyond the scope of this initial idea, and for error handling cases it
> should be okay to do something special.
>
>> 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
>
> You're right that we can still safely use 'version = B', although your
> revised example is getting more complicated, more closer to my
> original example in complexity:-)
>
> But again, this level of details don't have to be fixed right now. We
> can start with any workable one and then upgrade it as we see the need
> for it.
>
If you add a timestamp to the diffs table then you can handle the
rollover. You can have a table that maps the SOA value to the timestamp
whenever it changes and then your diff table just needs the timestamp.
Danny
More information about the bind10-dev
mailing list