Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions doc/admin-guide/tools/converting-records-to-yaml.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,14 @@ Now the records parser knows the type of the non core records.
Final Notes
===========

Internally ATS still uses the record style names, querying any record can still
Internally ATS still uses variables with record style names, querying any record can still
be done as usual. Either by using the ATS API or by using :program:`traffic_ctl`.


This implementation will only accept a ``records.yaml`` config file, if not found the
defaults will be used. If a ``record.config`` file is found in the config directory
a warning will be shown, the legacy file should be removed.
This is done to avoid someone having the legacy file thinking it is the current one.
ATS only accepts a :file:`records.yaml` config file, if a legacy file ``records.config`` is found
then ATS will fail to start.

.. code-block:: bash

traffic_server WARNING: Found a legacy config file. /home/to/ats/config/records.config
traffic_server WARNING: **** Found a legacy config file (/your/ats/records.config). Please remove it and migrate to the new YAML format before continuing. ****

9 changes: 5 additions & 4 deletions src/records/RecCore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,13 @@ RecCoreInit(RecModeT mode_type, Diags *_diags)

g_rec_config_fpath = ats_stringdup(RecConfigReadConfigPath(nullptr, ts::filename::RECORDS));

// Make sure there is no legacy file, if so we fail. This is to avoid issues with someone not knowing
// that we now are using records.yaml
// Make sure there is no legacy file, if so we drop a BIG WARNING and fail.
// This is to avoid issues with someone ignoring that we now use records.yaml
ts::file::path old_config{RecConfigReadConfigPath(nullptr, "records.config")};
if (ts::file::exists(old_config)) {
RecLog(DL_Warning, "Found a legacy config file. %s", old_config.c_str());
return REC_ERR_FAIL;
RecLog(DL_Fatal,
"**** Found a legacy config file (%s). Please remove it and migrate to the new YAML format before continuing. ****",
old_config.c_str());
}

if (RecFileExists(g_rec_config_fpath) == REC_ERR_FAIL) {
Expand Down
32 changes: 0 additions & 32 deletions tests/gold_tests/records/old_config_fail.test.py

This file was deleted.