{"record":{"id":"bb99e31a945e69e1","repo":"microsoft/FASTER","slug":"warning-ignoring-invalid-index-field-s-mem","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/mem_index.h","lineNumber":82,"sourceCode":"    , grow_state_{ &grow_state } {\n  }\n\n  struct Config {\n    // Used to support legacy API\n    // i.e., initializing FasterKv class with index_table_size as first arg\n    Config(uint64_t table_size_)\n      : table_size{ table_size_ } {\n    }\n\n    #ifdef TOML_CONFIG\n    explicit Config(const toml::value& table) {\n      table_size = toml::find<uint64_t>(table, \"table_size\");\n\n      // Warn if unexpected fields are found\n      const std::vector<std::string> VALID_INDEX_FIELDS = { \"table_size\" };\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  };\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;\n\n    table_[0].Initialize(config.table_size, this->disk_.log().alignment());","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cc/src/index/mem_index.h#L64-L100","documentation":"The memory (hot) index Config constructor parses an [index] TOML table and warns on any key other than table_size. Unknown keys are ignored, so e.g. mutable_fraction under a mem-index config silently does nothing.","triggerScenarios":"Building a mem index Config from a TOML table that contains keys besides table_size (e.g. mutable_fraction or in_mem_size_mb, which belong to the cold index).","commonSituations":"Reusing the cold-index [index] table for the memory index, upgraded configs where fields were added for cold index only, typos like 'tables_size'.","solutions":["For the memory index, only table_size is valid in the [index] table","Move mutable_fraction/in_mem_size_mb to the cold-index config where supported","Correct typos so table_size is spelled exactly"],"exampleFix":"// before\n[index]\ntableSize = 8192\n// after\n[index]\ntable_size = 8192","handlingStrategy":"validation","validationCode":"static const std::set<std::string> valid = {\"table_size\"};\nfor (const auto& [k, v] : indexTable)\n  if (!valid.count(k)) throw std::invalid_argument(\"invalid mem index field: \" + k);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Mem index accepts only table_size — strip other keys","Don't share one [index] table between index types","Verify key spellings in lowercase snake_case"],"tags":["config","toml","validation","mem-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"}