Verified Commit 85684634 authored by Evan Hunt's avatar Evan Hunt Committed by Michal Nowak
Browse files

journal fixes

- silence out of range errors from dns_journal_compact() when serial == 0;
  just start from the beginning of the journal.
- add the starting and ending serial number from the journal header to
  the output of dns_journal_print().
- use a value less than 2^32 for DNS_ZONEFLG_FIXJOURNAL; a larger value
  could cause problems in some build environments.

(cherry picked from commit ffa7e3ab)
parent ccb21b3f
Pipeline #65822 canceled with stages
in 18 minutes and 28 seconds
......@@ -909,7 +909,7 @@ journal_next(dns_journal_t *j, journal_pos_t *pos, bool retry) {
/* XHDR_VERSION1 -> XHDR_VERSION2 */
isc_log_write(
JOURNAL_COMMON_LOGARGS, ISC_LOG_DEBUG(3),
"%s: XHDR_VERSION1 -> XHDR_VERSION2 at %u\n",
"%s: XHDR_VERSION1 -> XHDR_VERSION2 at %u",
j->filename, pos->serial);
j->xhdr_version = XHDR_VERSION2;
result = journal_next(j, pos, true);
......@@ -923,7 +923,7 @@ journal_next(dns_journal_t *j, journal_pos_t *pos, bool retry) {
/* XHDR_VERSION2 -> XHDR_VERSION1 */
isc_log_write(
JOURNAL_COMMON_LOGARGS, ISC_LOG_DEBUG(3),
"%s: XHDR_VERSION2 -> XHDR_VERSION1 at %u\n",
"%s: XHDR_VERSION2 -> XHDR_VERSION1 at %u",
j->filename, pos->serial);
j->xhdr_version = XHDR_VERSION1;
result = journal_next(j, pos, true);
......@@ -1638,6 +1638,8 @@ dns_journal_print(isc_mem_t *mctx, uint32_t flags, const char *filename,
if (printxhdr) {
fprintf(file, "Journal format = %sHeader version = %d\n",
j->header.format + 1, j->header_ver1 ? 1 : 2);
fprintf(file, "Start serial = %u\n", j->header.begin.serial);
fprintf(file, "End serial = %u\n", j->header.end.serial);
fprintf(file, "Index (size = %u):\n", j->header.index_size);
for (uint32_t i = 0; i < j->header.index_size; i++) {
if (j->index[i].offset == 0) {
......
......@@ -470,17 +470,18 @@ typedef enum {
* up-to-date */
DNS_ZONEFLG_NEEDNOTIFY = 0x00000400U, /*%< need to send out notify
* messages */
DNS_ZONEFLG_DIFFONRELOAD = 0x00000800U, /*%< generate a journal diff on
* reload */
DNS_ZONEFLG_NOMASTERS = 0x00001000U, /*%< an attempt to refresh a
* zone with no primaries
* occurred */
DNS_ZONEFLG_LOADING = 0x00002000U, /*%< load from disk in progress*/
DNS_ZONEFLG_HAVETIMERS = 0x00004000U, /*%< timer values have been set
* from SOA (if not set, we
* are still using
* default timer values) */
DNS_ZONEFLG_FORCEXFER = 0x00008000U, /*%< Force a zone xfer */
DNS_ZONEFLG_FIXJOURNAL = 0x00000800U, /*%< journal file had
* recoverable error,
* needs rewriting */
DNS_ZONEFLG_NOMASTERS = 0x00001000U, /*%< an attempt to refresh a
* zone with no primaries
* occurred */
DNS_ZONEFLG_LOADING = 0x00002000U, /*%< load from disk in progress*/
DNS_ZONEFLG_HAVETIMERS = 0x00004000U, /*%< timer values have been set
* from SOA (if not set, we
* are still using
* default timer values) */
DNS_ZONEFLG_FORCEXFER = 0x00008000U, /*%< Force a zone xfer */
DNS_ZONEFLG_NOREFRESH = 0x00010000U,
DNS_ZONEFLG_DIALNOTIFY = 0x00020000U,
DNS_ZONEFLG_DIALREFRESH = 0x00040000U,
......@@ -500,9 +501,6 @@ typedef enum {
* notify due to the zone
* just being loaded for
* the first time. */
DNS_ZONEFLG_FIXJOURNAL = 0x100000000U, /*%< journal file had
* recoverable error,
* needs rewriting */
DNS_ZONEFLG___MAX = UINT64_MAX, /* trick to make the ENUM 64-bit wide */
} dns_zoneflg_t;
 
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment