Skip to content
Snippets Groups Projects
Commit de1fffde authored by Daniel Salzman's avatar Daniel Salzman
Browse files

zone: don't ignore manually triggered zone flush

parent 59af883e
No related branches found
No related tags found
1 merge request!1463Don't ignore manually triggered zone flush
Pipeline #100246 passed
......@@ -464,6 +464,7 @@ static int zone_flush(zone_t *zone, ctl_args_t *args)
return ret;
}
zone_set_flag(zone, ZONE_USER_FLUSH);
if (ctl_has_flag(args->data[KNOT_CTL_IDX_FLAGS], CTL_FLAG_FORCE)) {
zone_set_flag(zone, ZONE_FORCE_FLUSH);
}
......
......@@ -70,6 +70,7 @@ static int flush_journal(conf_t *conf, zone_t *zone, bool allow_empty_zone, bool
zone_journal_t j = zone_journal(zone);
bool force = zone_get_flag(zone, ZONE_FORCE_FLUSH, true);
bool user_flush = zone_get_flag(zone, ZONE_USER_FLUSH, true);
conf_val_t val = conf_zone_get(conf, C_ZONEFILE_SYNC, zone->name);
int64_t sync_timeout = conf_int(&val);
......@@ -95,7 +96,8 @@ static int flush_journal(conf_t *conf, zone_t *zone, bool allow_empty_zone, bool
/* Check for updated zone. */
zone_contents_t *contents = zone->contents;
uint32_t serial_to = zone_contents_serial(contents);
if (!force && zone->zonefile.exists && zone->zonefile.serial == serial_to &&
if (!force && !user_flush &&
zone->zonefile.exists && zone->zonefile.serial == serial_to &&
!zone->zonefile.retransfer && !zone->zonefile.resigned) {
ret = KNOT_EOK; /* No differences. */
goto flush_journal_replan;
......
......@@ -47,6 +47,7 @@ typedef enum {
ZONE_IS_CATALOG = 1 << 5, /*!< This is a catalog. */
ZONE_IS_CAT_MEMBER = 1 << 6, /*!< This zone exists according to a catalog. */
ZONE_XFR_FROZEN = 1 << 7, /*!< Outgoing AXFR/IXFR temporarily disabled. */
ZONE_USER_FLUSH = 1 << 8, /*!< User-triggered flush. */
} zone_flag_t;
/*!
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment