Skip to content
Snippets Groups Projects
Commit 894bc652 authored by Libor Peltan's avatar Libor Peltan
Browse files

Merge branch 'reload_preserve_flags' into 'master'

Preserve all zone flags (including zone XFR freeze) during reload

See merge request !1448
parents 6404af7f 4ee87878
No related branches found
No related tags found
1 merge request!1448Preserve all zone flags (including zone XFR freeze) during reload
Pipeline #97510 passed
......@@ -297,10 +297,22 @@ static int zone_status(zone_t *zone, ctl_args_t *args)
data[KNOT_CTL_IDX_DATA] = "no";
} else {
data[KNOT_CTL_IDX_DATA] = "freezing";
}
}
ret = knot_ctl_send(args->ctl, type, &data);
if (ret != KNOT_EOK) {
return ret;
} else {
type = KNOT_CTL_TYPE_EXTRA;
}
data[KNOT_CTL_IDX_TYPE] = "XFR freeze";
if (zone_get_flag(zone, ZONE_XFR_FROZEN, false)) {
data[KNOT_CTL_IDX_DATA] = "yes";
} else {
data[KNOT_CTL_IDX_DATA] = "no";
}
ret = knot_ctl_send(args->ctl, type, &data);
if (ret != KNOT_EOK) {
return ret;
}
......@@ -356,6 +368,8 @@ static int zone_status(zone_t *zone, ctl_args_t *args)
ret = knot_ctl_send(args->ctl, type, &data);
if (ret != KNOT_EOK) {
return ret;
} else {
type = KNOT_CTL_TYPE_EXTRA;
}
}
......@@ -387,8 +401,9 @@ static int zone_status(zone_t *zone, ctl_args_t *args)
ret = knot_ctl_send(args->ctl, type, &data);
if (ret != KNOT_EOK) {
return ret;
} else {
type = KNOT_CTL_TYPE_EXTRA;
}
type = KNOT_CTL_TYPE_EXTRA;
}
}
......
......@@ -421,7 +421,7 @@ static void set_flag(zone_t *zone, zone_flag_t flag, bool remove)
pthread_mutex_unlock(&zone->preferred_lock);
if (flag & ZONE_IS_CATALOG) {
zone->is_catalog_flag = true;
zone->is_catalog_flag = !remove;
}
}
......
......@@ -34,6 +34,8 @@ struct zone_backup_ctx;
/*!
* \brief Zone flags.
*
* When updating check create_zone_reload() if the flag mask is ok.
*/
typedef enum {
ZONE_FORCE_AXFR = 1 << 0, /*!< Force AXFR as next transfer. */
......
......@@ -91,7 +91,7 @@ static zone_t *create_zone_reload(conf_t *conf, const knot_dname_t *name,
}
zone->contents = old_zone->contents;
zone_set_flag(zone, zone_get_flag(old_zone, ZONE_IS_CATALOG | ZONE_IS_CAT_MEMBER, false));
zone_set_flag(zone, zone_get_flag(old_zone, ~0, false));
zone->timers = old_zone->timers;
zone_timers_sanitize(conf, zone);
......@@ -165,6 +165,7 @@ static zone_t *create_zone_new(conf_t *conf, const knot_dname_t *name,
zone_free(&zone);
return NULL;
}
zone_set_flag(zone, ZONE_IS_CATALOG);
} else if (conf_opt(&role) == CATALOG_ROLE_INTERPRET) {
ret = catalog_open(&server->catalog);
if (ret != KNOT_EOK) {
......
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