Skip to content
Snippets Groups Projects
Commit 4b769401 authored by David Vasek's avatar David Vasek
Browse files

catalog: document and enforce 'unixtime' serial-policy for generated catalog zones

parent 417ef6db
No related branches found
No related tags found
1 merge request!1445catalog: document and enforce 'unixtime' serial-policy for generated catalog zones
Pipeline #97128 passed
......@@ -2110,10 +2110,12 @@ frequent updates), the serial is incremented instead.
To avoid user confusion, use \fBdateserial\fP only if you expect at most
100 updates per day per zone and \fBunixtime\fP only if you expect at most
one update per second per zone.
.sp
Generated catalog zones use \fBunixtime\fP only.
.UNINDENT
.UNINDENT
.sp
\fIDefault:\fP increment
\fIDefault:\fP increment (unixtime for generated catalog zones)
.SS refresh\-min\-interval
.sp
Forced minimum zone refresh interval (in seconds) to avoid flooding primary server.
......
......@@ -2288,7 +2288,9 @@ Possible values:
100 updates per day per zone and ``unixtime`` only if you expect at most
one update per second per zone.
*Default:* increment
Generated catalog zones use ``unixtime`` only.
*Default:* increment (unixtime for generated catalog zones)
.. _zone_refresh-min-interval:
......
......@@ -824,6 +824,8 @@ int check_zone(
C_CATALOG_TPL, yp_dname(args->id));
conf_val_t catalog_zone = conf_zone_get_txn(args->extra->conf, args->extra->txn,
C_CATALOG_ZONE, yp_dname(args->id));
conf_val_t catalog_serial = conf_zone_get_txn(args->extra->conf, args->extra->txn,
C_SERIAL_POLICY, yp_dname(args->id));
if ((bool)(conf_opt(&catalog_role) == CATALOG_ROLE_INTERPRET) !=
(bool)(catalog_tpl.code == KNOT_EOK)) {
args->err_str = "'catalog-role' must correspond to configured 'catalog-template'";
......@@ -834,6 +836,12 @@ int check_zone(
args->err_str = "'catalog-role' must correspond to configured 'catalog-zone'";
return KNOT_EINVAL;
}
if (conf_opt(&catalog_role) == CATALOG_ROLE_GENERATE &&
conf_opt(&catalog_serial) != SERIAL_POLICY_UNIXTIME && // Default doesn't harm.
catalog_serial.code == KNOT_EOK) {
args->err_str = "'serial-policy' must be 'unixtime' for generated catalog zones";
return KNOT_EINVAL;
}
return 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