mirror of
https://gitlab.nic.cz/knot/knot-dns.git
synced 2026-02-03 18:49:28 -05:00
server: add statistics counter 'zone-update-error'
This commit is contained in:
parent
e84658eca9
commit
5d164cefa9
4 changed files with 15 additions and 9 deletions
|
|
@ -127,6 +127,7 @@ int stats_server(stats_dump_ctr_f fcn, stats_dump_ctx_t *ctx)
|
|||
}
|
||||
|
||||
DUMP_VAL(params, "zone-count", knot_zonedb_size(ctx->server->zone_db));
|
||||
DUMP_VAL(params, "zone-update-error", ATOMIC_GET(ctx->server->stats.zone_update_error));
|
||||
DUMP_VAL(params, "tcp-io-timeout", ATOMIC_GET(ctx->server->stats.tcp_io_timeout));
|
||||
DUMP_VAL(params, "tcp-idle-timeout", ATOMIC_GET(ctx->server->stats.tcp_idle_timeout));
|
||||
|
||||
|
|
|
|||
|
|
@ -1537,6 +1537,7 @@ int server_reload(server_t *server, reload_t mode)
|
|||
|
||||
ATOMIC_SET(server->stats.tcp_io_timeout, 0);
|
||||
ATOMIC_SET(server->stats.tcp_idle_timeout, 0);
|
||||
ATOMIC_SET(server->stats.zone_update_error, 0);
|
||||
}
|
||||
|
||||
conf_update_flag_t upd_flags = CONF_UPD_FNOFREE;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ typedef struct server {
|
|||
struct {
|
||||
knot_atomic_uint64_t tcp_io_timeout;
|
||||
knot_atomic_uint64_t tcp_idle_timeout;
|
||||
|
||||
knot_atomic_uint64_t zone_update_error;
|
||||
} stats;
|
||||
|
||||
knot_zonedb_t *zone_db;
|
||||
|
|
|
|||
|
|
@ -1144,7 +1144,7 @@ int zone_update_commit(conf_t *conf, zone_update_t *update)
|
|||
ret = commit_full(conf, update);
|
||||
}
|
||||
if (ret != KNOT_EOK) {
|
||||
return ret;
|
||||
goto error;
|
||||
}
|
||||
|
||||
conf_val_t thr = conf_zone_get(conf, C_ADJUST_THR, update->zone->name);
|
||||
|
|
@ -1155,7 +1155,7 @@ int zone_update_commit(conf_t *conf, zone_update_t *update)
|
|||
}
|
||||
if (ret != KNOT_EOK) {
|
||||
discard_adds_tree(update);
|
||||
return ret;
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Check the zone size. */
|
||||
|
|
@ -1164,7 +1164,8 @@ int zone_update_commit(conf_t *conf, zone_update_t *update)
|
|||
|
||||
if (update->new_cont->size > size_limit) {
|
||||
discard_adds_tree(update);
|
||||
return KNOT_EZONESIZE;
|
||||
ret = KNOT_EZONESIZE;
|
||||
goto error;
|
||||
}
|
||||
|
||||
val = conf_zone_get(conf, C_DNSSEC_VALIDATION, update->zone->name);
|
||||
|
|
@ -1177,7 +1178,7 @@ int zone_update_commit(conf_t *conf, zone_update_t *update)
|
|||
ret = knot_dnssec_validate_zone(update, &val_conf);
|
||||
if (ret != KNOT_EOK) {
|
||||
discard_adds_tree(update);
|
||||
return ret;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1186,7 +1187,7 @@ int zone_update_commit(conf_t *conf, zone_update_t *update)
|
|||
ret = zone_update_external(conf, update, &val);
|
||||
if (ret != KNOT_EOK) {
|
||||
discard_adds_tree(update);
|
||||
return ret;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1194,21 +1195,21 @@ int zone_update_commit(conf_t *conf, zone_update_t *update)
|
|||
if (ret != KNOT_EOK) {
|
||||
log_zone_error(update->zone->name, "failed to process catalog zone (%s)", knot_strerror(ret));
|
||||
discard_adds_tree(update);
|
||||
return ret;
|
||||
goto error;
|
||||
}
|
||||
|
||||
ret = commit_redis(conf, update);
|
||||
if (ret != KNOT_EOK) {
|
||||
log_zone_error(update->zone->name, "zone database update failed (%s)", knot_strerror(ret));
|
||||
discard_adds_tree(update);
|
||||
return ret;
|
||||
goto error;
|
||||
}
|
||||
|
||||
ret = commit_journal(conf, update);
|
||||
if (ret != KNOT_EOK) {
|
||||
log_zone_error(update->zone->name, "journal update failed (%s)", knot_strerror(ret));
|
||||
discard_adds_tree(update);
|
||||
return ret;
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (dnssec) {
|
||||
|
|
@ -1261,6 +1262,9 @@ int zone_update_commit(conf_t *conf, zone_update_t *update)
|
|||
memset(update, 0, sizeof(*update));
|
||||
|
||||
return KNOT_EOK;
|
||||
error:
|
||||
ATOMIC_ADD(update->zone->server->stats.zone_update_error, 1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool zone_update_no_change(zone_update_t *update)
|
||||
|
|
|
|||
Loading…
Reference in a new issue