{"record":{"id":"920d5233f75d009a","repo":"microsoft/FASTER","slug":"warning-ignoring-invalid-index-field-s","errorCode":null,"errorMessage":"WARNING: Ignoring invalid *index* field '%s'","messagePattern":"WARNING: Ignoring invalid \\*index\\* field '(.+?)'","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cc/src/index/cold_index.h","lineNumber":104,"sourceCode":"\n  struct Config {\n    Config(uint64_t table_size_, uint64_t in_mem_size_, double mutable_fraction_)\n      : table_size{ table_size_ }\n      , in_mem_size{ in_mem_size_ }\n      , mutable_fraction{ mutable_fraction_ } {\n    }\n\n    #ifdef TOML_CONFIG\n    explicit Config(const toml::value& table) {\n      table_size = toml::find<uint64_t>(table, \"table_size\");\n      in_mem_size = toml::find<uint64_t>(table, \"in_mem_size_mb\") * (1 << 20);\n      mutable_fraction = toml::find<double>(table, \"mutable_fraction\");\n\n      // Warn if unexpected fields are found\n      const std::vector<std::string> VALID_INDEX_FIELDS = { \"table_size\", \"in_mem_size_mb\", \"mutable_fraction\" };\n      for (auto& it : toml::get<toml::table>(table)) {\n        if (std::find(VALID_INDEX_FIELDS.begin(), VALID_INDEX_FIELDS.end(), it.first) == VALID_INDEX_FIELDS.end()) {\n          fprintf(stderr, \"WARNING: Ignoring invalid *index* field '%s'\\n\", it.first.c_str());\n        }\n      }\n    }\n    #endif\n\n    uint64_t table_size;      // Size of the hash index table\n    uint64_t in_mem_size;     // In-memory size of the hlog\n    double mutable_fraction;  // Hlog mutable region fraction\n  };\n\n  void Initialize(const Config& config) {\n    if(!Utility::IsPowerOfTwo(config.table_size)) {\n      throw std::invalid_argument{ \"Index size is not a power of 2\" };\n    }\n    if(config.table_size > INT32_MAX) {\n      throw std::invalid_argument{ \"Cannot allocate such a large hash table\" };\n    }\n    this->resize_info.version = 0;","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cc/src/index/cold_index.h#L86-L122","documentation":"The cold index Config constructor parses an [index] TOML table and warns on any key not in its whitelist (table_size, in_mem_size_mb, mutable_fraction). Unknown keys are ignored, meaning the requested cold-index setting is not applied.","triggerScenarios":"Constructing a cold index Config from a TOML table containing keys other than table_size/in_mem_size_mb/mutable_fraction, e.g. passing a mem-index-style config with mutable_fraction to the cold index or vice versa.","commonSituations":"Sharing one [index] section between cold and memory index configs, version drift in index options, typos like 'tableSize'.","solutions":["Use only these keys for the cold index [index] section: table_size, in_mem_size_mb, mutable_fraction","Split cold-index and mem-index settings into separate sections if they need different fields","Remove or rename the offending key"],"exampleFix":"// before\n[index]\ntable_size = 4096\nmutable_fraction = 0.5\n// after (mem index only accepts table_size; move others appropriately)\n[index]\ntable_size = 4096","handlingStrategy":"validation","validationCode":"static const std::set<std::string> valid = {\"table_size\",\"in_mem_size_mb\",\"mutable_fraction\"};\nfor (const auto& [k, v] : indexTable)\n  if (!valid.count(k)) throw std::invalid_argument(\"invalid cold index field: \" + k);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Separate cold-index and mem-index config sections","Check field support per index type before reuse","Add a config unit test parsing each section"],"tags":["config","toml","validation","cold-index"],"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-16T09:17:16.951Z"}