microsoft/FASTER · warning

WARNING: Ignoring invalid *index* field

Error message

WARNING: Ignoring invalid *index* field '%s'

What it means

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.

Solutions

  1. For the memory index, only table_size is valid in the [index] table
  2. Move mutable_fraction/in_mem_size_mb to the cold-index config where supported
  3. Correct typos so table_size is spelled exactly

Example fix

// before
[index]
tableSize = 8192
// after
[index]
table_size = 8192
Defensive patterns

Strategy: validation

Validate before calling

static const std::set<std::string> valid = {"table_size"};
for (const auto& [k, v] : indexTable)
  if (!valid.count(k)) throw std::invalid_argument("invalid mem index field: " + k);

Prevention

When it happens

Trigger: 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).

Common situations: Reusing the cold-index [index] table for the memory index, upgraded configs where fields were added for cold index only, typos like 'tables_size'.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of microsoft/FASTER@321d872eab (2026-09-15). Data as JSON: /api/errors/bb99e31a945e69e1. Report an issue: GitHub.

Appendix: source

Thrown at cc/src/index/mem_index.h:82

    , grow_state_{ &grow_state } {
  }

  struct Config {
    // Used to support legacy API
    // i.e., initializing FasterKv class with index_table_size as first arg
    Config(uint64_t table_size_)
      : table_size{ table_size_ } {
    }

    #ifdef TOML_CONFIG
    explicit Config(const toml::value& table) {
      table_size = toml::find<uint64_t>(table, "table_size");

      // Warn if unexpected fields are found
      const std::vector<std::string> VALID_INDEX_FIELDS = { "table_size" };
      for (auto& it : toml::get<toml::table>(table)) {
        if (std::find(VALID_INDEX_FIELDS.begin(), VALID_INDEX_FIELDS.end(), it.first) == VALID_INDEX_FIELDS.end()) {
          fprintf(stderr, "WARNING: Ignoring invalid *index* field '%s'\n", it.first.c_str());
        }
      }
    }
    #endif

    uint64_t table_size;  // Size of the hash index table
  };

  void Initialize(const Config& config) {
    if(!Utility::IsPowerOfTwo(config.table_size)) {
      throw std::invalid_argument{ "Index size is not a power of 2" };
    }
    if(config.table_size > INT32_MAX) {
      throw std::invalid_argument{ "Cannot allocate such a large hash table" };
    }
    this->resize_info.version = 0;

    table_[0].Initialize(config.table_size, this->disk_.log().alignment());

View on GitHub (pinned to 321d872eab)