Files
greptimedb/config
NightG1owZandNightG1owZ b886ae525d feat(config): support overriding region engine options from env (#9700)
* feat(config): support overriding region engine options from env

`region_engine` is a `Vec` of externally tagged enums, so plain dotted
environment keys cannot address it: `config` walks the path, replaces the
default sequence with a table and loading fails with `invalid type: map,
expected a sequence`.

Address the entries by tag name instead
(`<PREFIX>__REGION_ENGINE__<TAG>__<FIELD>`) and merge the overrides onto the
default entries in a dedicated source, so the engines and fields that are not
mentioned keep their configured value. An entry the default sequence does not
have is appended; a numeric index, an override of the whole sequence, a field
below a non-table default and two variables that set a path and a field below
it are reported with a dedicated error instead of a serde type error.

A configuration file that configures the sequence as a whole still replaces
the merged value, which the example configs document.

Closes #8620

Signed-off-by: NightG1owZ <316247938+NightG1owZ@users.noreply.github.com>

* docs(config): clarify that the metric engine is always enabled

`region_engine` defaults to [mito, file], but the datanode builds and
registers the metric engine unconditionally. Reword the example configs so
`mito` and `file` read as the default configuration entries and naming
`metric` only supplies its options, then regenerate config.md.

Signed-off-by: NightG1owZ <316247938+NightG1owZ@users.noreply.github.com>

* docs(config): drop the env-var explanation from the config reference

Environment variables are documented in the GreptimeTeam/docs repository, so the example configs and the generated config reference only describe the config file. Keep the note that the metric engine is always registered.

Signed-off-by: NightG1owZ <316247938+NightG1owZ@users.noreply.github.com>

* test(config): cover tagged sequence environment collection

Add unit tests for TaggedSeqEnvSource::collect: merging by tag, appending unknown tags, empty and null defaults, flat key removal, the error paths and the take_entries and is_index_like helpers. The variables are injected through Environment::source, so the tests do not touch the process environment.

Signed-off-by: NightG1owZ <316247938+NightG1owZ@users.noreply.github.com>

---------

Signed-off-by: NightG1owZ <316247938+NightG1owZ@users.noreply.github.com>
Co-authored-by: NightG1owZ <316247938+NightG1owZ@users.noreply.github.com>
2026-10-23 01:46:55 +00:00
..