{"record":{"id":"f055839fc0c489c9","repo":"microsoft/FASTER","slug":"warning-ignoring-invalid-hlog-field-s","errorCode":null,"errorMessage":"WARNING: Ignoring invalid *hlog* field '%s'\n","messagePattern":"WARNING: Ignoring invalid \\*hlog\\* field '(.+?)'\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cc/src/core/config.h","lineNumber":118,"sourceCode":"  }\n};\n\n\n// FASTER store config\n\n#ifdef TOML_CONFIG\nHlogConfig PopulateHlogConfig(const toml::value& hlog_table) {\n  // hlog\n  const uint64_t in_mem_size = toml::find<uint64_t>(hlog_table, \"in_mem_size_mb\") * (1 << 20);\n  // toml11 does not parse ints if 'double' type is specified; the following implements the intended behavior\n  double mutable_fraction = toml::find_or<int>(hlog_table, \"mutable_fraction\", -1);  // -1 \"means\" not found with int type\n  mutable_fraction = (mutable_fraction < 0) ? toml::find_or<double>(hlog_table, \"mutable_fraction\", DEFAULT_HLOG_MUTABLE_FRACTION) : mutable_fraction;\n  const bool pre_allocate = toml::find_or<bool>(hlog_table, \"pre_allocate\", false);\n\n  const std::vector<std::string> VALID_HLOG_FIELDS = { \"in_mem_size_mb\", \"mutable_fraction\", \"pre_allocate\", \"compaction\" };\n  for (auto& it : toml::get<toml::table>(hlog_table)) {\n    if (std::find(VALID_HLOG_FIELDS.begin(), VALID_HLOG_FIELDS.end(), it.first) == VALID_HLOG_FIELDS.end()) {\n      fprintf(stderr, \"WARNING: Ignoring invalid *hlog* field '%s'\\n\", it.first.c_str());\n    }\n  }\n\n  return { in_mem_size, mutable_fraction, pre_allocate };\n}\n\nHlogCompactionConfig PopulateHlogCompactionConfig(const toml::value& hlog_table) {\n  // hlog.compaction\n  HlogCompactionConfig hlog_compaction_config{ .enabled = false };\n  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);","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cc/src/core/config.h#L100-L136","documentation":"Faster's C++ config parser (config.h, PopulateHlogConfig) validates that every key inside the [hlog] TOML table is one of the known hlog fields: in_mem_size_mb, mutable_fraction, pre_allocate, compaction. Unknown keys are not fatal: the parser prints this WARNING to stderr and ignores the field, so a typo silently falls back to the default value.","triggerScenarios":"Supplying a TOML config string with a misspelled or unsupported hlog key (e.g. in_mem_size, mutible_fraction, 'InMemSizeMb'), or a key from a newer/older Faster version not supported by the linked parser.","commonSituations":"Typos in config files; copying config examples between Faster versions with renamed fields; using snake_case vs camelCase inconsistently; unnoticed because the app continues with defaults.","solutions":["Rename the key to one of the valid fields: in_mem_size_mb, mutable_fraction, pre_allocate, compaction.","Check stderr for the warning and verify the intended value is actually being applied (log the resulting HlogConfig).","Match the field names to the Faster version you compiled against; consult config.h for the supported set."],"exampleFix":"// before (toml)\n[hlog]\nin_mem_size = 512\n// after\n[hlog]\nin_mem_size_mb = 512","handlingStrategy":"validation","validationCode":"const VALID = new Set([\"in_mem_size_mb\", \"mutable_fraction\", \"pre_allocate\", \"compaction\"]);\nfor (const key of Object.keys(toml.hlog ?? {}))\n  if (!VALID.has(key)) console.warn(`invalid hlog field: ${key}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate config keys against the valid set (in_mem_size_mb, mutable_fraction, pre_allocate, compaction) before parsing.","Watch stderr for 'WARNING: Ignoring invalid *hlog* field' at startup.","Copy field names from the config.h of the exact Faster version you build against.","Log the resulting parsed HlogConfig to confirm intended values were applied."],"tags":["config","toml","validation","cpp"],"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"}