Commit ffa7e3ab authored by Evan Hunt's avatar Evan Hunt
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.
parent d6f33fcd
Pipeline #65821 canceled with stages
in 11 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) {
......
......@@ -474,8 +474,9 @@ 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_FIXJOURNAL = 0x00000800U, /*%< journal file had
* recoverable error,
* needs rewriting */
DNS_ZONEFLG_NOMASTERS = 0x00001000U, /*%< an attempt to refresh a
* zone with no primaries
* occurred */
......@@ -504,9 +505,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