From 73732bf151d6c63ab2f56a788e41cd32aad2a1ae Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Wed, 22 Nov 2000 18:58:12 +0000 Subject: [PATCH] don't blow away the journal file after a journal replay, only after a database dump [RT #482] --- lib/dns/zone.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 70fe9f7317..06052cb0d1 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.255 2000/11/18 02:54:18 gson Exp $ */ +/* $Id: zone.c,v 1.256 2000/11/22 18:58:12 gson Exp $ */ #include @@ -4393,13 +4393,22 @@ zone_replacedb(dns_zone_t *zone, dns_db_t *db, isc_boolean_t dump) { */ (void)isc_time_now(&zone->loadtime); } - if (zone->journal != NULL) { + + if (dump && zone->journal != NULL) { + /* + * The in-memory database just changed, and because 'dump' + * is set, it didn't change by being loaded from disk. + * Also, we have not journalled diffs for this change. + * Therefore, the on-disk journal is missing the deltas + * for this change and must be considered invalid. + */ isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_ZONE, ISC_LOG_DEBUG(3), "removing journal file"); (void)remove(zone->journal); } } + dns_db_closeversion(db, &ver, ISC_FALSE); isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL,