From 8cccaeaee13993c49009d3915806c1d0bd03743b Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Sat, 8 Sep 2001 00:21:49 +0000 Subject: [PATCH] New named.conf option "ixfr-from-differences" [RT #1727] --- bin/named/config.c | 3 +- bin/named/zoneconf.c | 8 ++- doc/arm/Bv9ARM-book.xml | 29 ++++++++- doc/arm/Bv9ARM.ch06.html | 121 +++++++++++++++++++++++++------------ doc/arm/Bv9ARM.ch07.html | 8 +-- doc/arm/Bv9ARM.ch08.html | 14 ++--- doc/arm/Bv9ARM.ch09.html | 120 ++++++++++++++++++------------------ doc/arm/Bv9ARM.html | 42 ++++++------- doc/misc/options | 6 +- lib/dns/include/dns/zone.h | 14 +++-- lib/dns/zone.c | 8 +-- lib/isccfg/parser.c | 3 +- 12 files changed, 230 insertions(+), 146 deletions(-) diff --git a/bin/named/config.c b/bin/named/config.c index 55e39c0a22..851b8bca03 100644 --- a/bin/named/config.c +++ b/bin/named/config.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: config.c,v 1.13 2001/09/01 01:43:23 gson Exp $ */ +/* $Id: config.c,v 1.14 2001/09/08 00:21:35 gson Exp $ */ #include @@ -144,6 +144,7 @@ options {\n\ sig-validity-interval 30; /* days */\n\ zone-statistics false;\n\ max-journal-size unlimited;\n\ + ixfr-from-differences false;\n\ };"; isc_result_t diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c index 46fff180b3..799fda0842 100644 --- a/bin/named/zoneconf.c +++ b/bin/named/zoneconf.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zoneconf.c,v 1.91 2001/09/04 19:20:54 gson Exp $ */ +/* $Id: zoneconf.c,v 1.92 2001/09/08 00:21:36 gson Exp $ */ #include @@ -500,6 +500,12 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig, journal_size = (isc_uint32_t)value; } dns_zone_setjournalsize(zone, journal_size); + + obj = NULL; + result = ns_config_get(maps, "ixfr-from-differences", &obj); + INSIST(result == ISC_R_SUCCESS); + dns_zone_setoption(zone, DNS_ZONEOPT_IXFRFROMDIFFS, + cfg_obj_asboolean(obj)); } /* diff --git a/doc/arm/Bv9ARM-book.xml b/doc/arm/Bv9ARM-book.xml index b1df7fd669..5858e00798 100644 --- a/doc/arm/Bv9ARM-book.xml +++ b/doc/arm/Bv9ARM-book.xml @@ -2,7 +2,7 @@ - + BIND 9 Administrator Reference Manual @@ -3173,6 +3173,28 @@ address match lists designed for IPv4 to fail to match. The use of this option for any other purpose is discouraged. +ixfr-from-differences + + +When 'yes' and the server loads a new version of a master +zone from its zone file or receives a new version of a slave +file by a non-incremental zone transfer, it will compare +the new version to the previous one and calculate a set +of differences. The differences are then logged in the +zone's journal file such that the changes can be transmitted +to downstream slaves as an incremental zone transfer. + +By allowing incremental zone transfers to be used for +non-dynamic zones, this option saves bandwidth at the +expense of increased CPU and memory consumption at the master. +In particular, if the new version of a zone is completely +different from the previous one, the set of differences +will be of a size comparable to the combined size of the +old and new zone version, and the server will need to +temporarily allocate memory to hold this complete +difference set. + + @@ -4500,6 +4522,11 @@ information for this zone, which can be dumped to the See the description in . +ixfr-from-differences +See the description of +ixfr-from-differences in . + + diff --git a/doc/arm/Bv9ARM.ch06.html b/doc/arm/Bv9ARM.ch06.html index 72006e1282..c5ccc2f274 100644 --- a/doc/arm/Bv9ARM.ch06.html +++ b/doc/arm/Bv9ARM.ch06.html @@ -91,7 +91,7 @@ HREF="Bv9ARM.ch06.html#Configuration_File_Grammar" >
6.3. Zone File
ixfr-from-differences

When 'yes' and the server loads a new version of a master +zone from its zone file or receives a new version of a slave +file by a non-incremental zone transfer, it will compare +the new version to the previous one and calculate a set +of differences. The differences are then logged in the +zone's journal file such that the changes can be transmitted +to downstream slaves as an incremental zone transfer. +

By allowing incremental zone transfers to be used for +non-dynamic zones, this option saves bandwidth at the +expense of increased CPU and memory consumption at the master. +In particular, if the new version of a zone is completely +different from the previous one, the set of differences +will be of a size comparable to the combined size of the +old and new zone version, and the server will need to +temporarily allocate memory to hold this complete +difference set. +

6.2.14.2. Forwarding

6.2.14.4. Interfaces

6.2.14.5. Query Address

6.2.14.7. Operating System Resource Limits

6.2.14.8. Server Resource Limits

6.2.14.9. Periodic Task Intervals

6.3. Zone File

6.3.1.1. Resource Records

6.3.1.2. Textual expression of RRs

6.3.2. Discussion of MX Records

6.3.4. Inverse Mapping in IPv4

6.3.5. Other Zone File Directives

6.3.5.1. The $ORIGIN

6.3.5.2. The $INCLUDE

6.3.5.3. The $TTL

6.3.6. BIND

7.2. chroot

7.2. chroot

7.2.1. The chroot

7.2.2. Using the setuid

8.1. Common Problems
8.2. Incrementing and Changing the Serial Number
8.3. Where Can I Get Help?

8.1. Common Problems

8.1.1. It's not working; how can I figure out what's wrong?

8.2. Incrementing and Changing the Serial Number

8.3. Where Can I Get Help?

A.1. Acknowledgements
A.3. General DNS

A.1. Acknowledgements

A.1.1. A Brief History of the DNS

A.2.1.1. HS = hesiod

A.2.1.2. CH = chaos

A.3. General DNS

Bibliography

Standards

[RFC974] 

[RFC1034] 

[RFC1035] 

[RFC2181] 

[RFC2308] 

[RFC1995] 

[RFC1996] 

[RFC2136] 

[RFC2845] 

Proposed Standards Still Under Development

[RFC1886] 

[RFC2065] 

[RFC2137] 

Other Important RFCs About DNS

[RFC1535] 

[RFC1536] 

[RFC1982] 

Resource Record Types

[RFC1183] 

[RFC1706] 

[RFC2168] 

[RFC1876] 

[RFC2052] 

[RFC2163] 

[RFC2230] 

DNS

[RFC1101] 

[RFC1123] 

[RFC1591] 

[RFC2317] 

DNS

[RFC1537] 

[RFC1912] 

[RFC1912] 

[RFC2010] 

[RFC2219] 

Other DNS

[RFC1464] 

[RFC1713] 

6.2.17. trusted-keys
6.2.18. trusted-keys
6.2.19. view
6.2.20. view
6.2.22. zone
6.3. Zone File
6.3.2. Discussion of MX Records
6.3.4. Inverse Mapping in IPv4
6.3.5. Other Zone File Directives
6.3.6. BIND
7.2. chroot
7.2.1. The chroot
7.2.2. Using the setuid
8.1. Common Problems
8.1.1. It's not working; how can I figure out what's wrong?
8.2. Incrementing and Changing the Serial Number
8.3. Where Can I Get Help?
A.1. Acknowledgements
A.1.1. A Brief History of the DNS
A.3. General DNS
A.4.3. Other Documents About BIND; recursive-clients ; rrset-order { [ class ] [ type ] [ name - ] ; ... }; + ] ; ... }; // not implemented serial-queries ; // obsolete serial-query-rate ; stacksize ; @@ -54,6 +54,7 @@ options { recursion ; provide-ixfr ; request-ixfr ; + try-edns ; fetch-glue ; // obsolete rfc2308-type1 ; // not yet implemented additional-from-auth ; @@ -133,6 +134,7 @@ view { file ; ixfr-base ; // obsolete ixfr-tmp-file ; // obsolete + max-journal-size ; masters [ port ] { ( | ) [ port ] [ key ]; ... }; pubkey ; // @@ -190,6 +192,7 @@ view { recursion ; provide-ixfr ; request-ixfr ; + try-edns ; fetch-glue ; // obsolete rfc2308-type1 ; // not yet implemented additional-from-auth ; @@ -252,6 +255,7 @@ zone { file ; ixfr-base ; // obsolete ixfr-tmp-file ; // obsolete + max-journal-size ; masters [ port ] { ( | ) [ port ] [ key ]; ... }; pubkey ; // obsolete diff --git a/lib/dns/include/dns/zone.h b/lib/dns/include/dns/zone.h index 7329feef8b..8e42c0e16f 100644 --- a/lib/dns/include/dns/zone.h +++ b/lib/dns/include/dns/zone.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.h,v 1.106 2001/08/27 21:47:00 gson Exp $ */ +/* $Id: zone.h,v 1.107 2001/09/08 00:21:39 gson Exp $ */ #ifndef DNS_ZONE_H #define DNS_ZONE_H 1 @@ -39,11 +39,13 @@ typedef enum { dns_zone_stub } dns_zonetype_t; -#define DNS_ZONEOPT_SERVERS 0x00000001U /* perform server checks */ -#define DNS_ZONEOPT_PARENTS 0x00000002U /* perform parent checks */ -#define DNS_ZONEOPT_CHILDREN 0x00000004U /* perform child checks */ -#define DNS_ZONEOPT_NOTIFY 0x00000008U /* perform NOTIFY */ -#define DNS_ZONEOPT_MANYERRORS 0x00000010U /* return many errors on load */ +#define DNS_ZONEOPT_SERVERS 0x00000001U /* perform server checks */ +#define DNS_ZONEOPT_PARENTS 0x00000002U /* perform parent checks */ +#define DNS_ZONEOPT_CHILDREN 0x00000004U /* perform child checks */ +#define DNS_ZONEOPT_NOTIFY 0x00000008U /* perform NOTIFY */ +#define DNS_ZONEOPT_MANYERRORS 0x00000010U /* return many errors on load */ +#define DNS_ZONEOPT_IXFRFROMDIFFS 0x00000020U /* calculate differences */ + #ifndef NOMINUM_PUBLIC /* * Nominum specific options build down. diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 7bf269c772..baff5a6749 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.c,v 1.343 2001/09/05 15:01:52 marka Exp $ */ +/* $Id: zone.c,v 1.344 2001/09/08 00:21:38 gson Exp $ */ #include @@ -196,7 +196,6 @@ struct dns_zone { isc_uint32_t maxxfrout; isc_uint32_t idlein; isc_uint32_t idleout; - isc_boolean_t diff_on_reload; isc_event_t ctlevent; dns_ssutable_t *ssutable; isc_uint32_t sigvalidityinterval; @@ -528,7 +527,6 @@ dns_zone_create(dns_zone_t **zonep, isc_mem_t *mctx) { zone->xfr = NULL; zone->maxxfrin = MAX_XFER_TIME; zone->maxxfrout = MAX_XFER_TIME; - zone->diff_on_reload = ISC_FALSE; zone->ssutable = NULL; zone->sigvalidityinterval = 30 * 24 * 3600; zone->view = NULL; @@ -4743,7 +4741,7 @@ zone_replacedb(dns_zone_t *zone, dns_db_t *db, isc_boolean_t dump) { * is enabled in the configuration. */ if (zone->db != NULL && zone->journal != NULL && - zone->diff_on_reload) { + DNS_ZONE_OPTION(zone, DNS_ZONEOPT_IXFRFROMDIFFS)) { isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_ZONE, ISC_LOG_DEBUG(3), "generating diffs"); @@ -4752,6 +4750,8 @@ zone_replacedb(dns_zone_t *zone, dns_db_t *db, isc_boolean_t dump) { zone->journal); if (result != ISC_R_SUCCESS) goto fail; + if (dump) + zone_needdump(zone, DNS_DUMP_DELAY); } else { if (dump && zone->masterfile != NULL) { isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index 80679a820b..5491c3439f 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: parser.c,v 1.76 2001/09/06 21:52:46 gson Exp $ */ +/* $Id: parser.c,v 1.77 2001/09/08 00:21:40 gson Exp $ */ #include @@ -919,6 +919,7 @@ zone_clauses[] = { { "dialup", &cfg_type_dialuptype, 0 }, { "forward", &cfg_type_forwardtype, 0 }, { "forwarders", &cfg_type_portiplist, 0 }, + { "ixfr-from-differences", &cfg_type_boolean, 0 }, { "maintain-ixfr-base", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE }, { "max-ixfr-log-size", &cfg_type_size, CFG_CLAUSEFLAG_OBSOLETE }, { "transfer-source", &cfg_type_sockaddr4wild, 0 },