2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

Merge branch '2555-workaround-truncated-64-bit-enum-in-journal-on-windows' into 'main'

Resolve "journal test fails on Windows"

Closes #2555

See merge request isc-projects/bind9!4784
This commit is contained in:
Ondřej Surý 2021-03-08 08:42:14 +00:00
commit 42e8db9e74
3 changed files with 40 additions and 19 deletions

View File

@ -302,8 +302,24 @@ dns_journal_compact(isc_mem_t *mctx, char *filename, uint32_t serial,
uint32_t flags, uint32_t target_size);
/*%<
* Attempt to compact the journal if it is greater that 'target_size'.
* Changes from 'serial' onwards will be preserved. If the journal
* exists and is non-empty 'serial' must exist in the journal.
* Changes from 'serial' onwards will be preserved. Changes prior than
* that may be dropped in order to get the journal below `target_size`.
*
* If 'flags' includes DNS_JOURNAL_COMPACTALL, the entire journal is copied.
* In this case, `serial` is ignored. This flag is used when upgrading or
* downgrading the format version of the journal. If 'flags' also includes
* DNS_JOURNAL_VERSION1, then the journal is copied out in the original
* format used prior to BIND 9.16.12; otherwise it is copied in the
* current format.
*
* If _COMPACTALL is not in use, and the journal file exists and is
* non-empty, then 'serial' must exist in the journal.
*
* Returns:
*\li ISC_R_SUCCESS
*\li ISC_R_RANGE serial is outside the range existing in the journal
*
* Other errors may be returned from file operations.
*/
bool
@ -314,7 +330,7 @@ dns_journal_set_sourceserial(dns_journal_t *j, uint32_t sourceserial);
* Get and set source serial.
*
* Returns:
* true if sourceserial has previously been set.
* true if sourceserial has previously been set.
*/
ISC_LANG_ENDDECLS

View File

@ -907,7 +907,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);
@ -921,7 +921,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);
@ -1636,6 +1636,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) {

View File

@ -474,17 +474,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,
@ -504,9 +505,11 @@ 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 */
/*
* DO NOT add any new zone flags here until all platforms
* support 64-bit enum values. Currently they fail on
* Windows.
*/
DNS_ZONEFLG___MAX = UINT64_MAX, /* trick to make the ENUM 64-bit wide */
} dns_zoneflg_t;