{"record":{"id":"d63b21a176cdabda","repo":"microsoft/FASTER","slug":"warning-ignoring-invalid-hlog-compaction-field-s","errorCode":null,"errorMessage":"WARNING: Ignoring invalid *hlog-compaction* field '%s'\n","messagePattern":"WARNING: Ignoring invalid \\*hlog-compaction\\* field '(.+?)'\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cc/src/core/config.h","lineNumber":146,"sourceCode":"  if (hlog_table.contains(\"compaction\")) {\n    const auto compaction_table = toml::find(hlog_table, \"compaction\");\n    hlog_compaction_config.enabled = toml::find_or<bool>(compaction_table, \"enabled\", hlog_compaction_config.enabled);\n    hlog_compaction_config.hlog_size_budget = toml::find<uint64_t>(compaction_table, \"hlog_size_budget_mb\") * (1 << 20);\n    hlog_compaction_config.max_compacted_size = compaction_table.contains(\"max_compacted_size_mb\")\n                                                  ? toml::find<uint64_t>(compaction_table, \"max_compacted_size_mb\") * (1 << 20)\n                                                  : hlog_compaction_config.max_compacted_size;\n    hlog_compaction_config.trigger_pct = toml::find_or<double>(compaction_table, \"trigger_pct\", hlog_compaction_config.trigger_pct);\n    hlog_compaction_config.compact_pct = toml::find_or<double>(compaction_table, \"compact_pct\", hlog_compaction_config.compact_pct);\n    hlog_compaction_config.check_interval = compaction_table.contains(\"check_interval_ms\")\n                                              ? std::chrono::milliseconds(toml::find<size_t>(compaction_table, \"check_interval_ms\"))\n                                              : hlog_compaction_config.check_interval;\n    hlog_compaction_config.num_threads = static_cast<uint8_t>(toml::find_or<int>(compaction_table, \"num_threads\", hlog_compaction_config.num_threads));\n\n    const std::vector<std::string> VALID_HLOG_COMPACTION_FIELDS = {\n      \"enabled\", \"hlog_size_budget_mb\", \"max_compacted_size_mb\", \"trigger_pct\", \"compact_pct\", \"check_interval_ms\", \"num_threads\" };\n    for (auto& it : toml::get<toml::table>(compaction_table)) {\n      if (std::find(VALID_HLOG_COMPACTION_FIELDS.begin(), VALID_HLOG_COMPACTION_FIELDS.end(), it.first) == VALID_HLOG_COMPACTION_FIELDS.end()) {\n        fprintf(stderr, \"WARNING: Ignoring invalid *hlog-compaction* field '%s'\\n\", it.first.c_str());\n      }\n    }\n  }\n\n  return hlog_compaction_config;\n}\n\ntemplate<bool IsColdStore>\nReadCacheConfig PopulateReadCacheConfig(const toml::value& top_table);\n\ntemplate<>\nReadCacheConfig PopulateReadCacheConfig<true>(const toml::value& top_table) {\n  ReadCacheConfig rc_config{ .enabled = false };\n  if (top_table.contains(\"read_cache\")) {\n    throw std::runtime_error{ \"Found invalid 'read_cache' definition for cold store.\" };\n  }\n  return rc_config;\n}","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cc/src/core/config.h#L128-L164","documentation":"When parsing the [hlog-compaction] TOML table, FASTER validates each key against a whitelist of known fields (enabled, hlog_size_budget_mb, max_compacted_size_mb, trigger_pct, compact_pct, check_interval_ms, num_threads). Unknown keys are skipped entirely and this warning is printed to stderr; the setting silently has no effect.","triggerScenarios":"Calling F2Kv::FromConfigString with a config string whose hlog-compaction table contains a key not in VALID_HLOG_COMPACTION_FIELDS (e.g. a typo like 'num_thread' or 'thread_count').","commonSituations":"Renamed config keys across FASTER versions, hand-edited TOML configs with typos, copying fields from other config sections (e.g. read-cache) into hlog-compaction.","solutions":["Check the key name against the valid list: enabled, hlog_size_budget_mb, max_compacted_size_mb, trigger_pct, compact_pct, check_interval_ms, num_threads","Fix the typo or remove the unknown key from the [hlog-compaction] section","Consult the FASTER version's config.h to confirm which fields your version supports"],"exampleFix":"// before\n[hlog-compaction]\nnum_thread = 4\n// after\n[hlog-compaction]\nnum_threads = 4","handlingStrategy":"validation","validationCode":"static const std::set<std::string> valid = {\"enabled\",\"hlog_size_budget_mb\",\"max_compacted_size_mb\",\"trigger_pct\",\"compact_pct\",\"check_interval_ms\",\"num_threads\"};\nfor (const auto& [k, v] : hlogCompactionTable)\n  if (!valid.count(k)) throw std::invalid_argument(\"invalid hlog-compaction field: \" + k);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a copy of the whitelist next to your config template","Lint TOML configs against valid keys in CI","Test new configs with a startup smoke run and check stderr"],"tags":["config","toml","validation","hlog-compaction"],"backgroundTag":"invalid-config-value","analyzedSha":"321d872eabda6a0345c8bd76419f89723ed864ae","analyzedAt":"2026-09-15T22:18:00.693Z","contentChangedAt":"2026-09-15T22:18:00.693Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}