records. Add consistency check over default values defined in RecordConfig.cc
#11667
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feedback was requested by email, I'll add the details here anyway:
The goal:
Add records consistency check for default values on startup(core records and plugin records(
TSMgmt*Create
)The outcome
A
If consistency check fails, the record will not be registered, I think this is the main discussion point, so leaving this as draft till we decide what would be the outcome(if any).
Details:
Working around some record consistency check issues this week I found that we do not perform this check against the default values specified during registration (4th parameter) of a record(either core or throughout the TS API).
What’s the consistency check?
This is supposed to be used to validate the value you set on a record, so if the check(regex) does not match the value then you get an error and the value is not set. This is quite clear when you try to set a new record value using traffic_ctl:
This PR adds a record consistency check on startup for default records values defined in (RecordsConfig.cc and by the
TSMgmt*Create
API) to avoid possible bugs.As I said this is already done for values we read from the
records.yaml
and values set throughtraffic_ctl
but not for the default value specified in the record registration code(RecordsConfig.cc
and TS API)This may break some instances with plugins which registers new records with wrong value/regex in it.
Is important to note that currently if you register a new record and configure the check to be performed but you do not specify a regex, then ATS will fail(fatal). I think something similar could be done.
Plan B:
If this is not accepted then I can add a new autest which parses the
RecordsConfig.cc
and generates arecords.yaml
file which then gets injected into ATS which OFC will error out if the consistency check fails, so at least we will be covered by a single test, existing behavior will not change.In any case something should be done.
Probably we do not need this in
10
.